Skip to content

Commit

Permalink
Unmerged 1.6.4 commit: Fix heart rendering #918
Browse files Browse the repository at this point in the history
  • Loading branch information
mDiyo authored and bonii-xx committed Aug 28, 2014
1 parent 52be72d commit fe3a075
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
Binary file modified resources/assets/tinker/textures/gui/newhearts.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
14 changes: 9 additions & 5 deletions src/main/java/tconstruct/armor/ArmorProxyClient.java
Expand Up @@ -207,7 +207,7 @@ public void goggleZoom (FOVUpdateEvent event)
@SubscribeEvent
public void renderHealthbar (RenderGameOverlayEvent.Pre event)
{
if (!Loader.isModLoaded("tukmc_Vz"))// Loader check to avoid conflicting
if (!Loader.isModLoaded("tukmc_Vz") || Loader.isModLoaded("borderlands"))// Loader check to avoid conflicting
// with a GUI mod (thanks Vazkii!)
{
if (event.type == ElementType.HEALTH)
Expand Down Expand Up @@ -297,12 +297,13 @@ else if (i * 2 + 1 == health)
}
}

int potionOffset = 0;
PotionEffect potion = mc.thePlayer.getActivePotionEffect(Potion.wither);
if (potion != null)
return;
potionOffset = 18;
potion = mc.thePlayer.getActivePotionEffect(Potion.poison);
if (potion != null)
return;
potionOffset = 9;

// Extra hearts
this.mc.getTextureManager().bindTexture(hearts);
Expand All @@ -315,11 +316,14 @@ else if (i * 2 + 1 == health)
renderHearts = 10;
for (int i = 0; i < renderHearts; i++)
{
this.drawTexturedModalRect(xBasePos + 8 * i, yBasePos, 0 + 18 * iter, 0, 8, 8);
int y = 0;
if (i == regen)
y -= 2;
this.drawTexturedModalRect(xBasePos + 8 * i, yBasePos + y, 0 + 18 * iter, potionOffset, 9, 9);
}
if (hp % 2 == 1 && renderHearts < 10)
{
this.drawTexturedModalRect(xBasePos + 8 * renderHearts, yBasePos, 9 + 18 * iter, 0, 8, 8);
this.drawTexturedModalRect(xBasePos + 8 * renderHearts, yBasePos, 9 + 18 * iter, potionOffset, 9, 9);
}
}

Expand Down

0 comments on commit fe3a075

Please sign in to comment.