add weakness to textradar and clean up modes

This commit is contained in:
Bella 2020-03-03 10:25:24 -05:00
parent 51498c590e
commit f314dd1fe5
1 changed files with 13 additions and 4 deletions

View File

@ -312,10 +312,18 @@ public class KamiGUI extends GUI {
Map<String, Integer> 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);
}