From 57e2db030f51bd9634558ae61f309392b09fa590 Mon Sep 17 00:00:00 2001 From: kirothos Date: Wed, 8 Feb 2017 09:53:27 -0500 Subject: [PATCH] Closes #19 --- src/main/java/vazkii/neat/HealthBarRenderer.java | 10 ++++++++-- src/main/java/vazkii/neat/NeatConfig.java | 2 ++ 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/src/main/java/vazkii/neat/HealthBarRenderer.java b/src/main/java/vazkii/neat/HealthBarRenderer.java index 9653a67..a618553 100644 --- a/src/main/java/vazkii/neat/HealthBarRenderer.java +++ b/src/main/java/vazkii/neat/HealthBarRenderer.java @@ -190,7 +190,11 @@ public void renderHealthBar(EntityLivingBase passedEntity, float partialTicks, E if(namel + 20 > size * 2) size = namel / 2F + 10F; float healthSize = size * (health / maxHealth); - + + if (!NeatConfig.showEntityName) { + bgHeight -= 4F; + } + // Background if(NeatConfig.drawBackground) { buffer.begin(7, DefaultVertexFormats.POSITION_COLOR); @@ -222,7 +226,9 @@ public void renderHealthBar(EntityLivingBase passedEntity, float partialTicks, E GlStateManager.pushMatrix(); GlStateManager.translate(-size, -4.5F, 0F); GlStateManager.scale(s, s, s); - mc.fontRendererObj.drawString(name, 0, 0, 0xFFFFFF); + if (NeatConfig.showEntityName) { + mc.fontRendererObj.drawString(name, 0, 0, 0xFFFFFF); + } GlStateManager.pushMatrix(); float s1 = 0.75F; diff --git a/src/main/java/vazkii/neat/NeatConfig.java b/src/main/java/vazkii/neat/NeatConfig.java index 792c15b..0666e66 100644 --- a/src/main/java/vazkii/neat/NeatConfig.java +++ b/src/main/java/vazkii/neat/NeatConfig.java @@ -33,6 +33,7 @@ public class NeatConfig { public static boolean showOnBosses = true; public static boolean showOnlyFocused = false; public static boolean enableDebugInfo = true; + public static boolean showEntityName = true; public static List blacklist; @@ -69,6 +70,7 @@ public static void load() { showOnBosses = loadPropBool("Display on Bosses", showOnBosses); showOnlyFocused = loadPropBool("Only show the health bar for the entity looked at", showOnlyFocused); enableDebugInfo = loadPropBool("Show Debug Info with F3", enableDebugInfo); + showEntityName = loadPropBool("Show Entity Name", showEntityName); Property prop = config.get(Configuration.CATEGORY_GENERAL, "Blacklist", new String[] { "Shulker", "ArmorStand" }); prop.setComment("Blacklist uses entity IDs, not their display names. Use F3 to see them in the Neat bar.");