From bd8ac78a879cbf441e3ceda79cceec0a6cc11c2b Mon Sep 17 00:00:00 2001 From: GeorgeRNG Date: Fri, 3 Nov 2023 10:52:17 +0000 Subject: [PATCH] show long function names in popup --- src/main/java/dev/dfonline/codeclient/dev/ChestPeeker.java | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/main/java/dev/dfonline/codeclient/dev/ChestPeeker.java b/src/main/java/dev/dfonline/codeclient/dev/ChestPeeker.java index 681d6623..514bd3c3 100644 --- a/src/main/java/dev/dfonline/codeclient/dev/ChestPeeker.java +++ b/src/main/java/dev/dfonline/codeclient/dev/ChestPeeker.java @@ -7,6 +7,7 @@ import dev.dfonline.codeclient.hypercube.item.Scope; import dev.dfonline.codeclient.location.Dev; import net.minecraft.block.Blocks; +import net.minecraft.block.entity.SignBlockEntity; import net.minecraft.item.ItemStack; import net.minecraft.item.Items; import net.minecraft.nbt.NbtCompound; @@ -105,6 +106,12 @@ public static boolean handlePacket(Packet packet) public static List getOverlayText() { if(!Config.getConfig().ChestPeeker) return null; + if(CodeClient.MC.crosshairTarget instanceof BlockHitResult block) { // TODO: this shouldn't be in ChestPeeker + if(CodeClient.MC.world.getBlockEntity(block.getBlockPos()) instanceof SignBlockEntity sign) { + Text name = sign.getFrontText().getMessage(1,false); + if(CodeClient.MC.textRenderer.getWidth(name) > 90) return List.of(name); + } + } if (CodeClient.location instanceof Dev && currentBlock != null && items != null) { ArrayList texts = new ArrayList<>(); if(items.isEmpty()) {