Skip to content

Commit

Permalink
fix laser bender grid overlay not working correctly
Browse files Browse the repository at this point in the history
  • Loading branch information
screret committed Sep 29, 2024
1 parent b923f29 commit d34a78b
Showing 1 changed file with 7 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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();
}
Expand Down

0 comments on commit d34a78b

Please sign in to comment.