diff --git a/src/main/java/dan200/computercraft/ComputerCraft.java b/src/main/java/dan200/computercraft/ComputerCraft.java index 2dc474c22..c79489d7d 100644 --- a/src/main/java/dan200/computercraft/ComputerCraft.java +++ b/src/main/java/dan200/computercraft/ComputerCraft.java @@ -44,7 +44,6 @@ import java.util.EnumSet; import java.util.List; import java.util.concurrent.TimeUnit; -import static dan200.computercraft.shared.ComputerCraftRegistry.ModBlocks; import static dan200.computercraft.shared.ComputerCraftRegistry.init; public final class ComputerCraft implements ModInitializer diff --git a/src/main/java/dan200/computercraft/client/render/CableHighlightRenderer.java b/src/main/java/dan200/computercraft/client/render/CableHighlightRenderer.java index 32965f478..ee0a1e93a 100644 --- a/src/main/java/dan200/computercraft/client/render/CableHighlightRenderer.java +++ b/src/main/java/dan200/computercraft/client/render/CableHighlightRenderer.java @@ -18,6 +18,7 @@ import net.minecraft.client.render.Camera; import net.minecraft.client.render.VertexConsumer; import net.minecraft.client.util.math.MatrixStack; import net.minecraft.entity.Entity; +import net.minecraft.util.hit.HitResult; import net.minecraft.util.math.*; import net.minecraft.util.shape.VoxelShape; @@ -40,8 +41,12 @@ public final class CableHighlightRenderer return false; } + HitResult hitResult = MinecraftClient.getInstance().crosshairTarget; + + Vec3d hitPos = hitResult != null ? hitResult.getPos() : new Vec3d( d, e, f ); + VoxelShape shape = WorldUtil.isVecInside( CableShapes.getModemShape( state ), - new Vec3d( d, e, f ).subtract( pos.getX(), + hitPos.subtract( pos.getX(), pos.getY(), pos.getZ() ) ) ? CableShapes.getModemShape( state ) : CableShapes.getCableShape( state );