From d34a78bde7d6ba1d00c4ea74047f9addea00ba57 Mon Sep 17 00:00:00 2001 From: screret <68943070+screret@users.noreply.github.com> Date: Thu, 26 Sep 2024 18:49:18 +0300 Subject: [PATCH] fix laser bender grid overlay not working correctly --- .../client/renderer/BlockHighLightRenderer.java | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/main/java/com/gregtechceu/gtceu/client/renderer/BlockHighLightRenderer.java b/src/main/java/com/gregtechceu/gtceu/client/renderer/BlockHighLightRenderer.java index 8e9b8fb5ef..a01d1cabde 100644 --- a/src/main/java/com/gregtechceu/gtceu/client/renderer/BlockHighLightRenderer.java +++ b/src/main/java/com/gregtechceu/gtceu/client/renderer/BlockHighLightRenderer.java @@ -143,19 +143,19 @@ public ResourceTexture sideTips(Player player, BlockPos pos, BlockState state, } // draw pipe connection grid highlight - var pipeStructure = held.getItem() instanceof PipeBlockItem pipeBlockItem ? - pipeBlockItem.getBlock().getStructure() : - null; - if (pipeStructure != null && blockEntity instanceof PipeBlockEntity pipeBlockEntity && - pipeBlockEntity.getStructure() == pipeStructure) { + var pipeBlock = held.getItem() instanceof PipeBlockItem pipeBlockItem ? + pipeBlockItem.getBlock() : null; + var pipeStructure = pipeBlock == null ? null : pipeBlock.getStructure(); + if (pipeStructure != null && pipeBlock.hasPipeCollisionChangingItem(level, blockPos, player) && + blockEntity instanceof PipeBlockEntity pipeBlockEntity) { Vec3 pos = camera.getPosition(); poseStack.pushPose(); poseStack.translate(-pos.x, -pos.y, -pos.z); var buffer = multiBufferSource.getBuffer(RenderType.lines()); RenderSystem.lineWidth(3); - drawGridOverlays(poseStack, buffer, target, side -> level.isEmptyBlock(blockPos.relative(side)) ? - pipeStructure.getPipeTexture(true) : null); + drawGridOverlays(poseStack, buffer, target, side -> level.isEmptyBlock(blockPos.relative(side)) && + pipeBlockEntity.canConnectTo(side) ? pipeStructure.getPipeTexture(true) : null); poseStack.popPose(); }