From f314dd1fe5e37943268f5507647b38324177e21c Mon Sep 17 00:00:00 2001 From: Bella Date: Tue, 3 Mar 2020 10:25:24 -0500 Subject: [PATCH] add weakness to textradar and clean up modes --- .../me/zeroeightsix/kami/gui/kami/KamiGUI.java | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/src/main/java/me/zeroeightsix/kami/gui/kami/KamiGUI.java b/src/main/java/me/zeroeightsix/kami/gui/kami/KamiGUI.java index c4f865b7..661f243b 100644 --- a/src/main/java/me/zeroeightsix/kami/gui/kami/KamiGUI.java +++ b/src/main/java/me/zeroeightsix/kami/gui/kami/KamiGUI.java @@ -312,10 +312,18 @@ public class KamiGUI extends GUI { Map players = new HashMap<>(); for (Entity e : entityList) { if (e.getName().equals(mc.player.getName())) continue; + String posString = (e.posY > mc.player.posY ? ChatFormatting.DARK_GREEN + "+" : (e.posY == mc.player.posY ? " " : ChatFormatting.DARK_RED + "-")); - String strengthfactor = ""; - EntityPlayer eplayer = (EntityPlayer) e; - if (eplayer.isPotionActive(MobEffects.STRENGTH)) strengthfactor = "S "; else strengthfactor = " "; + String weaknessFactor; + String strengthFactor; + String extraPaddingForFactors; + EntityPlayer ePlayer = (EntityPlayer) e; + + if (ePlayer.isPotionActive(MobEffects.WEAKNESS)) weaknessFactor = "W"; else weaknessFactor = ""; + if (ePlayer.isPotionActive(MobEffects.STRENGTH)) strengthFactor = "S"; else strengthFactor = ""; + if (weaknessFactor.equals("") && strengthFactor.equals("")) extraPaddingForFactors = ""; + else extraPaddingForFactors = " "; + float hpRaw = ((EntityLivingBase) e).getHealth() + ((EntityLivingBase) e).getAbsorptionAmount(); String hp = dfHealth.format(hpRaw); healthSB.append(KamiMod.colour); @@ -329,7 +337,8 @@ public class KamiGUI extends GUI { healthSB.append("c"); } healthSB.append(hp); - players.put(ChatFormatting.GRAY + posString + " " + healthSB.toString() + " " + ChatFormatting.RED + strengthfactor + ChatFormatting.GRAY + e.getName(), (int) mc.player.getDistance(e)); + + players.put(ChatFormatting.GRAY + posString + " " + healthSB.toString() + " " + ChatFormatting.DARK_GRAY + weaknessFactor + ChatFormatting.DARK_PURPLE + strengthFactor + ChatFormatting.GRAY + extraPaddingForFactors + e.getName(), (int) mc.player.getDistance(e)); healthSB.setLength(0); }