aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorbowser0000 <bowser0000@gmail.com>2022-04-28 02:26:15 -0400
committerbowser0000 <bowser0000@gmail.com>2022-04-28 02:26:15 -0400
commitd35e43b33b98796acc7b8dc76bc06848d0ee3129 (patch)
treeff97824562b64dce0fe50eca070c91a5d98811b7 /src
parentb7a2bc13f61a60c99ce460d08d7c89d06ee72a34 (diff)
downloadSkyblockMod-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.java3
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)));
}
}