From f899bfe0abb64c41c1166cb6d8b19cd4d9e2f58e Mon Sep 17 00:00:00 2001 From: IThundxr Date: Mon, 6 May 2024 17:46:36 -0400 Subject: [PATCH] Fix #6205 --- .../link/controller/LecternControllerBlockEntity.java | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) 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; } }