Skip to content

Commit

Permalink
ChatSigns - Fixed oldSignESP rendering empty signs.
Browse files Browse the repository at this point in the history
fr this time i swear™
  • Loading branch information
0xTas committed Apr 4, 2024
1 parent 7e733ee commit 459394f
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/main/java/dev/stardust/modules/ChatSigns.java
Original file line number Diff line number Diff line change
Expand Up @@ -282,8 +282,12 @@ private ArrayList<SignBlockEntity> getNearbySigns(WorldChunk chunk) {
return signs;
}

private boolean isSignEmpty(SignBlockEntity sbe) {
return !sbe.getFrontText().hasText(mc.player) && !sbe.getBackText().hasText(mc.player);
}

private String formatSignText(SignBlockEntity sign, WorldChunk chunk) {
if (mc.world == null) return "";
if (mc.world == null || isSignEmpty(sign)) return "";
ArrayList<String> lines = new ArrayList<>();

String color = signColor.get().label;
Expand Down Expand Up @@ -317,7 +321,7 @@ private String formatSignText(SignBlockEntity sign, WorldChunk chunk) {
boolean couldBeOld = false;

RegistryKey<World> dimension = mc.world.getRegistryKey();
if (!String.join("", lines).trim().isEmpty() && dimension != World.NETHER || !ignoreNether.get()) {
if (dimension != World.NETHER || !ignoreNether.get()) {
WoodType woodType = WoodType.BAMBOO;
Block block = sign.getCachedState().getBlock();
if (block instanceof SignBlock signBlock) woodType = signBlock.getWoodType();
Expand Down

0 comments on commit 459394f

Please sign in to comment.