Skip to content

Commit

Permalink
Move mob name above healthbar and adjust name colors (#18)
Browse files Browse the repository at this point in the history
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
  • Loading branch information
wlhlm and github-actions[bot] authored Dec 8, 2024
1 parent c585bc3 commit 299b6f2
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -132,16 +132,18 @@ public void onPreRenderGameOverlay(RenderGameOverlayEvent.Pre event) {
* (float) (lifeBarLength + 1));
byte y = 12;
gui.drawTexturedModalRect(x, y, 0, 74, lifeBarLength, 5);
gui.drawTexturedModalRect(x, y, 0, 74, lifeBarLength, 5);

if (lifeBarLeft > 0) {
gui.drawTexturedModalRect(x, y, 0, 79, lifeBarLeft, 5);
}

int yCoord = 10;
int yCoord = 1;
fontR
.drawStringWithShadow(buffer, screenwidth / 2 - fontR.getStringWidth(buffer) / 2, yCoord, 0x2F96EB);

// spacing for healthbar
yCoord += 8;

String[] display = mod.getDisplayNames();
int i = 0;
while (i < display.length && display[i] != null) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -417,11 +417,10 @@ public String getEntityDisplayName(EntityLivingBase target) {
}

String prefix = size <= 5
? EnumChatFormatting.AQUA + StatCollector.translateToLocal("translation.infernalmobs:rareClass")
? EnumChatFormatting.YELLOW + StatCollector.translateToLocal("translation.infernalmobs:rareClass")
: size <= 10
? EnumChatFormatting.YELLOW + StatCollector.translateToLocal("translation.infernalmobs:ultraClass")
: EnumChatFormatting.GOLD
+ StatCollector.translateToLocal("translation.infernalmobs:infernalClass");
? EnumChatFormatting.GOLD + StatCollector.translateToLocal("translation.infernalmobs:ultraClass")
: EnumChatFormatting.RED + StatCollector.translateToLocal("translation.infernalmobs:infernalClass");

buffer = prefix + modprefix + buffer;

Expand Down

0 comments on commit 299b6f2

Please sign in to comment.