diff options
author | bowser0000 <bowser0000@gmail.com> | 2022-04-28 02:26:15 -0400 |
---|---|---|
committer | bowser0000 <bowser0000@gmail.com> | 2022-04-28 02:26:15 -0400 |
commit | d35e43b33b98796acc7b8dc76bc06848d0ee3129 (patch) | |
tree | ff97824562b64dce0fe50eca070c91a5d98811b7 /src | |
parent | b7a2bc13f61a60c99ce460d08d7c89d06ee72a34 (diff) | |
download | SkyblockMod-d35e43b33b98796acc7b8dc76bc06848d0ee3129.tar.gz SkyblockMod-d35e43b33b98796acc7b8dc76bc06848d0ee3129.tar.bz2 SkyblockMod-d35e43b33b98796acc7b8dc76bc06848d0ee3129.zip |
Fix custom colour replacing with colour codes
User 6940 makes 940k auctions become white
Diffstat (limited to 'src')
-rw-r--r-- | src/main/java/me/Danker/features/ColouredNames.java | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/main/java/me/Danker/features/ColouredNames.java b/src/main/java/me/Danker/features/ColouredNames.java index aad1ab1..90d722e 100644 --- a/src/main/java/me/Danker/features/ColouredNames.java +++ b/src/main/java/me/Danker/features/ColouredNames.java @@ -11,6 +11,7 @@ import net.minecraft.network.play.server.S45PacketTitle; import net.minecraft.util.ChatComponentText; import net.minecraft.util.EnumChatFormatting; import net.minecraft.util.IChatComponent; +import net.minecraft.util.StringUtils; import net.minecraftforge.client.event.ClientChatReceivedEvent; import net.minecraftforge.client.event.RenderLivingEvent; import net.minecraftforge.event.entity.player.ItemTooltipEvent; @@ -53,7 +54,7 @@ public class ColouredNames { for (String user : users) { for (int i = 0; i < event.toolTip.size(); i++) { - if (event.toolTip.get(i).contains(user)) { + if (StringUtils.stripControlCodes(event.toolTip.get(i)).contains(user)) { event.toolTip.set(i, replaceName(event.toolTip.get(i), user, getColourFromName(user))); } } |