use of com.comphenix.protocol.wrappers.MovingObjectPositionBlock in project CombatLogX by SirBlobman.
the class ForceFieldAdapter method getLocation1.
@Nullable
private Location getLocation1(World world, PacketContainer packetContainer) {
try {
StructureModifier<MovingObjectPositionBlock> movingBlockPositionModifier = packetContainer.getMovingBlockPositions();
MovingObjectPositionBlock movingObjectPositionBlock = movingBlockPositionModifier.readSafely(0);
if (movingObjectPositionBlock == null) {
return null;
}
BlockPosition blockPosition = movingObjectPositionBlock.getBlockPosition();
return (blockPosition == null ? null : blockPosition.toLocation(world));
} catch (FieldAccessException ex) {
return null;
}
}
Aggregations