diff options
Diffstat (limited to 'src/main/java/com/thatgravyboat/skyblockhud/playerstats')
-rw-r--r-- | src/main/java/com/thatgravyboat/skyblockhud/playerstats/ActionBarParsing.java | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/src/main/java/com/thatgravyboat/skyblockhud/playerstats/ActionBarParsing.java b/src/main/java/com/thatgravyboat/skyblockhud/playerstats/ActionBarParsing.java index 4e895f9..5340fad 100644 --- a/src/main/java/com/thatgravyboat/skyblockhud/playerstats/ActionBarParsing.java +++ b/src/main/java/com/thatgravyboat/skyblockhud/playerstats/ActionBarParsing.java @@ -3,8 +3,6 @@ package com.thatgravyboat.skyblockhud.playerstats; import com.thatgravyboat.skyblockhud.SkyblockHud; import com.thatgravyboat.skyblockhud.Utils; import com.thatgravyboat.skyblockhud.overlay.RPGHud; -import java.util.regex.Matcher; -import java.util.regex.Pattern; import net.minecraft.util.ChatComponentText; import net.minecraft.util.IChatComponent; import net.minecraftforge.client.event.ClientChatReceivedEvent; @@ -12,10 +10,13 @@ import net.minecraftforge.fml.common.eventhandler.EventPriority; import net.minecraftforge.fml.common.eventhandler.SubscribeEvent; import net.minecraftforge.fml.common.gameevent.TickEvent; +import java.util.regex.Matcher; +import java.util.regex.Pattern; + public class ActionBarParsing { private static String lastActionBar = ""; - private static String lastLowActionBar = ""; + public static String lastLowActionBar = ""; private static IChatComponent lastLowEditedActionBar = null; private static final Pattern HealthRegex = Pattern.compile("([0-9]+)/([0-9]+)\u2764"); @@ -64,7 +65,10 @@ public class ActionBarParsing { message = HealthAbsorptionReplaceRegex.matcher(message).replaceAll(""); message = DefenseReplaceRegex.matcher(message).replaceAll(""); message = ManaReplaceRegex.matcher(message).replaceAll(""); - message = ManaOverflowReplaceRegex.matcher(message).replaceAll(""); + Matcher overflowMatcher = ManaOverflowReplaceRegex.matcher(message); + if (overflowMatcher.find()){ + message = overflowMatcher.replaceAll("\u00A73\u02AC " + overflowMatcher.group(3)); + } lastLowEditedActionBar = new ChatComponentText(message.trim()); } |