Skip to content

Commit

Permalink
Merge pull request #1 from kirothos/Issue_19
Browse files Browse the repository at this point in the history
Closes VazkiiMods#19 - Config option to Show Entity Name above bar
  • Loading branch information
kirothos authored Feb 8, 2017
2 parents aa42250 + 57e2db0 commit 992b18a
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
10 changes: 8 additions & 2 deletions src/main/java/vazkii/neat/HealthBarRenderer.java
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -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;
Expand Down
2 changes: 2 additions & 0 deletions src/main/java/vazkii/neat/NeatConfig.java
Original file line number Diff line number Diff line change
Expand Up @@ -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<String> blacklist;

Expand Down Expand Up @@ -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.");
Expand Down

0 comments on commit 992b18a

Please sign in to comment.