aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/com/thatgravyboat/skyblockhud/overlay/MiningHud.java
diff options
context:
space:
mode:
authornea <romangraef@gmail.com>2022-08-23 18:20:16 +0200
committernea <romangraef@gmail.com>2022-08-23 18:20:16 +0200
commit1e870d3d55b4965c24919c0a69bdd2fa4958b7f8 (patch)
treed741b50ec639e723259e1d1341c7a8abc98d8c8e /src/main/java/com/thatgravyboat/skyblockhud/overlay/MiningHud.java
parent50f5ff6cf4fb9fc37270114317d0192788c1c64e (diff)
downloadSkyblockHud-Death-Defied-drillbar.tar.gz
SkyblockHud-Death-Defied-drillbar.tar.bz2
SkyblockHud-Death-Defied-drillbar.zip
Allow Drill bar to be absolute valuesdrillbar
Diffstat (limited to 'src/main/java/com/thatgravyboat/skyblockhud/overlay/MiningHud.java')
-rw-r--r--src/main/java/com/thatgravyboat/skyblockhud/overlay/MiningHud.java18
1 files changed, 12 insertions, 6 deletions
diff --git a/src/main/java/com/thatgravyboat/skyblockhud/overlay/MiningHud.java b/src/main/java/com/thatgravyboat/skyblockhud/overlay/MiningHud.java
index a3aab50..063a74f 100644
--- a/src/main/java/com/thatgravyboat/skyblockhud/overlay/MiningHud.java
+++ b/src/main/java/com/thatgravyboat/skyblockhud/overlay/MiningHud.java
@@ -30,14 +30,14 @@ public class MiningHud extends Gui {
@SubscribeEvent
public void renderOverlay(RenderGameOverlayEvent.Post event) {
- if (Utils.overlayShouldRender(event.type, SkyblockHud.hasSkyblockScoreboard(), SkyblockHud.config.mining.showDrillBar || SkyblockHud.config.mining.showHeatBar)) {
+ if (Utils.overlayShouldRender(event.type, SkyblockHud.hasSkyblockScoreboard(), SkyblockHud.config.mining.showDrillBar != 0 || SkyblockHud.config.mining.showHeatBar)) {
Minecraft mc = Minecraft.getMinecraft();
if (SkyblockHud.config.mining.barMode == 1) {
- if (heat > 0 && Utils.isDrill(mc.thePlayer.getHeldItem()) && SkyblockHud.config.mining.showDrillBar && SkyblockHud.config.mining.showHeatBar) {
+ if (heat > 0 && Utils.isDrill(mc.thePlayer.getHeldItem()) && SkyblockHud.config.mining.showDrillBar != 0 && SkyblockHud.config.mining.showHeatBar) {
renderFuelBar(mc, (event.resolution.getScaledWidth() / 2) - 91, event.resolution.getScaledHeight() - 31);
renderHeatBar(mc, (event.resolution.getScaledWidth() / 2) + 46, event.resolution.getScaledHeight() - 31);
- } else if (Utils.isDrill(mc.thePlayer.getHeldItem()) && SkyblockHud.config.mining.showDrillBar) {
+ } else if (Utils.isDrill(mc.thePlayer.getHeldItem()) && SkyblockHud.config.mining.showDrillBar != 0) {
renderFuelBar(mc, (event.resolution.getScaledWidth() / 2) - 68, event.resolution.getScaledHeight() - 31);
} else if (heat > 0 && SkyblockHud.config.mining.showHeatBar) {
renderHeatBar(mc, (event.resolution.getScaledWidth() / 2) - 22, event.resolution.getScaledHeight() - 31);
@@ -47,7 +47,7 @@ public class MiningHud extends Gui {
Position position = SkyblockHud.config.mining.heatBar;
renderHeatBar(mc, position.getAbsX(event.resolution, 45), position.getAbsY(event.resolution, 7));
}
- if (Utils.isDrill(mc.thePlayer.getHeldItem()) && SkyblockHud.config.mining.showDrillBar) {
+ if (Utils.isDrill(mc.thePlayer.getHeldItem()) && SkyblockHud.config.mining.showDrillBar != 0) {
Position position = SkyblockHud.config.mining.drillBar;
renderFuelBar(mc, position.getAbsX(event.resolution, 136), position.getAbsY(event.resolution, 7));
}
@@ -62,8 +62,14 @@ public class MiningHud extends Gui {
mc.renderEngine.bindTexture(Textures.texture.mines);
drawTexturedModalRect(x, y, 0, 0, 136, 7);
drawTexturedModalRect(x, y, 0, 7, Utils.lerp((float) fuel / (float) maxFuel, 0, 136), 7);
- String percentageText = Math.round(((float) fuel / (float) maxFuel) * 100) + "%";
- this.drawCenteredString(mc.fontRendererObj, percentageText, x + 68, y - 2, 0xffffff);
+
+ String renderedText;
+ if (SkyblockHud.config.mining.showDrillBar == 1) {
+ renderedText = Math.round(((float) fuel / (float) maxFuel) * 100) + "%";
+ } else {
+ renderedText = fuel + "/" + maxFuel;
+ }
+ this.drawCenteredString(mc.fontRendererObj, renderedText, x + 68, y - 2, 0xffffff);
}
private void renderHeatBar(Minecraft mc, int x, int y) {