From 8d351b494e0957f02a2ae9eb11e315dbb7ebfd8e Mon Sep 17 00:00:00 2001 From: "yrsegal@gmail.com" Date: Sun, 24 Apr 2022 14:18:14 -0400 Subject: [PATCH] fancy up redstone display --- .../hexcasting/client/RegisterClientStuff.java | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/src/main/java/at/petrak/hexcasting/client/RegisterClientStuff.java b/src/main/java/at/petrak/hexcasting/client/RegisterClientStuff.java index 85da2a0e..12260dcb 100644 --- a/src/main/java/at/petrak/hexcasting/client/RegisterClientStuff.java +++ b/src/main/java/at/petrak/hexcasting/client/RegisterClientStuff.java @@ -28,6 +28,7 @@ import net.minecraft.client.renderer.ItemBlockRenderTypes; import net.minecraft.client.renderer.RenderType; import net.minecraft.client.renderer.entity.EntityRenderers; import net.minecraft.client.renderer.item.ItemProperties; +import net.minecraft.core.Direction; import net.minecraft.network.chat.TextComponent; import net.minecraft.network.chat.TranslatableComponent; import net.minecraft.world.item.Item; @@ -162,13 +163,13 @@ public class RegisterClientStuff { ScryingLensOverlayRegistry.addPredicateDisplayer( (state, pos, observer, world, direction, lensHand) -> state.isSignalSource() && !state.is(Blocks.COMPARATOR), (lines, state, pos, observer, world, direction, lensHand) -> { - int signalStrength; - if (state.getBlock() instanceof DiodeBlock) - signalStrength = state.getSignal(world, pos, state.getValue(DiodeBlock.FACING)); - else if (state.getBlock() instanceof RedStoneWireBlock) + int signalStrength = 0; + if (state.getBlock() instanceof RedStoneWireBlock) signalStrength = state.getValue(RedStoneWireBlock.POWER); - else - signalStrength = state.getSignal(world, pos, direction); + else { + for (Direction dir : Direction.values()) + signalStrength = Math.max(signalStrength, state.getSignal(world, pos, dir)); + } lines.add(0, new Pair<>( new ItemStack(Items.REDSTONE),