mirror of
https://github.com/GTNewHorizons/waila.git
synced 2026-11-22 21:19:45 +00:00
Max hp before text is now a config option
This commit is contained in:
1 parent
78039db017
commit
7eb35b7544
3 files changed
+6
-3
No files matched your search
@@ -148,7 +148,8 @@ public class ConfigHandler implements IWailaConfigHandler {
|
||||
OverlayConfig.fontcolor = config.get(Configuration.CATEGORY_GENERAL, Constants.CFG_WAILA_FONTCOLOR, 0xA0A0A0).getInt();
|
||||
OverlayConfig.scale = config.get(Configuration.CATEGORY_GENERAL, Constants.CFG_WAILA_SCALE, 100).getInt() / 100.0f;
|
||||
|
||||
HUDHandlerEntities.nhearts = config.get(Configuration.CATEGORY_GENERAL, Constants.CFG_WAILA_NHEARTS, 20).getInt();
|
||||
HUDHandlerEntities.nhearts = config.get(Configuration.CATEGORY_GENERAL, Constants.CFG_WAILA_NHEARTS, 20).getInt();
|
||||
HUDHandlerEntities.maxhpfortext = config.get(Configuration.CATEGORY_GENERAL, Constants.CFG_WAILA_MAXHP, 40).getInt();
|
||||
|
||||
config.getCategory(Constants.CATEGORY_MODULES).setComment("Those are the config keys defined in modules.\nServer side, it is used to enforce keys client side using the next section.");
|
||||
config.getCategory(Constants.CATEGORY_SERVER).setComment("Any key set to true here will ensure that the client is using the configuration set in the 'module' section above.\nThis is useful for enforcing false to 'cheating' keys like silverfish.");
|
||||
|
||||
@@ -19,6 +19,7 @@ import static mcp.mobius.waila.api.SpecialChars.*;
|
||||
public class HUDHandlerEntities implements IWailaEntityProvider {
|
||||
|
||||
public static int nhearts = 20;
|
||||
public static float maxhpfortext = 40.0f;
|
||||
|
||||
@Override
|
||||
public Entity getWailaOverride(IWailaEntityAccessor accessor, IWailaConfigHandler config) {
|
||||
@@ -45,7 +46,7 @@ public class HUDHandlerEntities implements IWailaEntityProvider {
|
||||
float health = ((EntityLivingBase)entity).getHealth() / 2.0f;
|
||||
float maxhp = ((EntityLivingBase)entity).getMaxHealth() / 2.0f;
|
||||
|
||||
if (maxhp > 20.0f)
|
||||
if (((EntityLivingBase)entity).getHealth() > maxhpfortext)
|
||||
currenttip.add(String.format("HP : " + WHITE + "%.0f" + GRAY + " / " + WHITE + "%.0f", ((EntityLivingBase)entity).getHealth(), ((EntityLivingBase)entity).getMaxHealth()));
|
||||
|
||||
else{
|
||||
|
||||
@@ -25,7 +25,8 @@ public final class Constants {
|
||||
public static String CFG_WAILA_SCALE = "waila.cfg.scale";
|
||||
public static String CFG_WAILA_SHIFTBLOCK = "waila.cfg.shiftblock";
|
||||
public static String CFG_WAILA_SHIFTENTS = "waila.cfg.shiftents";
|
||||
public static String CFG_WAILA_NHEARTS = "waila.cfg.nhearts";
|
||||
public static String CFG_WAILA_NHEARTS = "waila.cfg.heartsperline";
|
||||
public static String CFG_WAILA_MAXHP = "waila.cfg.maxhpbeforetext";
|
||||
|
||||
public static String CFG_WAILA_ALPHA = "waila.cfg.alpha";
|
||||
public static String CFG_WAILA_BGCOLOR = "waila.cfg.bgcolor";
|
||||
|
||||
Reference in new issue
Block a user