diff --git a/src/main/java/com/simibubi/create/content/redstone/link/controller/LecternControllerBlockEntity.java b/src/main/java/com/simibubi/create/content/redstone/link/controller/LecternControllerBlockEntity.java index 1c0cd29ba..11991f050 100644 --- a/src/main/java/com/simibubi/create/content/redstone/link/controller/LecternControllerBlockEntity.java +++ b/src/main/java/com/simibubi/create/content/redstone/link/controller/LecternControllerBlockEntity.java @@ -28,7 +28,7 @@ import net.minecraftforge.fml.DistExecutor; public class LecternControllerBlockEntity extends SmartBlockEntity { - private ItemStack controller; + private ItemStack controller = ItemStack.EMPTY; private UUID user; private UUID prevUser; // used only on client private boolean deactivatedThisTick; // used only on server @@ -161,9 +161,9 @@ public class LecternControllerBlockEntity extends SmartBlockEntity { stopUsing((Player) playerEntity); Direction dir = state.getValue(LecternControllerBlock.FACING); - double x = worldPosition.getX() + 0.5 + 0.25*dir.getStepX(); + double x = worldPosition.getX() + 0.5 + 0.25 * dir.getStepX(); double y = worldPosition.getY() + 1; - double z = worldPosition.getZ() + 0.5 + 0.25*dir.getStepZ(); + double z = worldPosition.getZ() + 0.5 + 0.25 * dir.getStepZ(); ItemEntity itementity = new ItemEntity(level, x, y, z, controller.copy()); itementity.setDefaultPickUpDelay(); level.addFreshEntity(itementity); @@ -172,8 +172,8 @@ public class LecternControllerBlockEntity extends SmartBlockEntity { public static boolean playerInRange(Player player, Level world, BlockPos pos) { //double modifier = world.isRemote ? 0 : 1.0; - double reach = 0.4*player.getAttributeValue(ForgeMod.REACH_DISTANCE.get());// + modifier; - return player.distanceToSqr(Vec3.atCenterOf(pos)) < reach*reach; + double reach = 0.4 * player.getAttributeValue(ForgeMod.REACH_DISTANCE.get());// + modifier; + return player.distanceToSqr(Vec3.atCenterOf(pos)) < reach * reach; } }