diff options
author | ExternalTime <84183548+ExternalTime@users.noreply.github.com> | 2021-09-16 22:43:46 +0200 |
---|---|---|
committer | ExternalTime <84183548+ExternalTime@users.noreply.github.com> | 2021-09-16 22:43:46 +0200 |
commit | 6fc7918adabec07479ee0cb5dfb1598f4c227801 (patch) | |
tree | 14f1518ef082eee118bdc08db002e096c83c3170 /src/main/java | |
parent | 541ca4eb1f37fef765b530c1661ce1efb2387772 (diff) | |
download | Skyblocker-6fc7918adabec07479ee0cb5dfb1598f4c227801.tar.gz Skyblocker-6fc7918adabec07479ee0cb5dfb1598f4c227801.tar.bz2 Skyblocker-6fc7918adabec07479ee0cb5dfb1598f4c227801.zip |
Added absorption bar drawn on top of health bar
Diffstat (limited to 'src/main/java')
-rw-r--r-- | src/main/java/me/xmrvizzy/skyblocker/skyblock/FancyStatusBars.java | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/src/main/java/me/xmrvizzy/skyblocker/skyblock/FancyStatusBars.java b/src/main/java/me/xmrvizzy/skyblocker/skyblock/FancyStatusBars.java index 1c86e733..e5b13032 100644 --- a/src/main/java/me/xmrvizzy/skyblocker/skyblock/FancyStatusBars.java +++ b/src/main/java/me/xmrvizzy/skyblocker/skyblock/FancyStatusBars.java @@ -48,9 +48,8 @@ public class FancyStatusBars extends DrawableHelper { int top = scaledHeight - 35; int hpFillWidth = (int) (health.getFillLevel() * 33.0F); - if (hpFillWidth > 33) hpFillWidth = 33; + int hpOverflowWidth = (int) (health.getOverflow() * 33.0F); int manaFillWidth = (int) (mana.getFillLevel() * 33.0F); - if (manaFillWidth > 33) manaFillWidth = 33; int xp = (int) (client.player.experienceProgress * 33.0F); // Icons @@ -69,6 +68,7 @@ public class FancyStatusBars extends DrawableHelper { // Progress Bars this.drawTexture(matrices, left + 10, top + 1, 0, 16, hpFillWidth, 7); + this.drawTexture(matrices, left + 10, top + 1, 0, 44, hpOverflowWidth, 7); this.drawTexture(matrices, left + 55, top + 1, 0, 23, manaFillWidth, 7); this.drawTexture(matrices, left + 102, top + 1, 0, 30, 33, 7); this.drawTexture(matrices, left + 149, top + 1, 0, 37, xp, 7); @@ -109,7 +109,10 @@ public class FancyStatusBars extends DrawableHelper { return value; } public double getFillLevel() { - return ((double)value)/((double)max); + return Math.min(((double)value)/((double)max), 1); + } + public double getOverflow() { + return Math.max(((double)value)/((double)max) - 1, 0); } } }
\ No newline at end of file |