diff options
author | TymanWasTaken <tyman@tyman.tech> | 2021-07-06 17:15:21 -0400 |
---|---|---|
committer | TymanWasTaken <tyman@tyman.tech> | 2021-07-06 17:17:22 -0400 |
commit | a8e475fa0a7977f64f072548459d592274169d66 (patch) | |
tree | 2f6e3c2fc4aa55c52b848adc493a9ecc842e53f8 /src/main/java/com/thatgravyboat/skyblockhud/handlers/HeldItemHandler.java | |
parent | bb75fd7b83b238f1f922ffc64b2a0a535c5524b7 (diff) | |
download | SkyblockHud-Death-Defied-a8e475fa0a7977f64f072548459d592274169d66.tar.gz SkyblockHud-Death-Defied-a8e475fa0a7977f64f072548459d592274169d66.tar.bz2 SkyblockHud-Death-Defied-a8e475fa0a7977f64f072548459d592274169d66.zip |
Format v2
Diffstat (limited to 'src/main/java/com/thatgravyboat/skyblockhud/handlers/HeldItemHandler.java')
-rw-r--r-- | src/main/java/com/thatgravyboat/skyblockhud/handlers/HeldItemHandler.java | 86 |
1 files changed, 45 insertions, 41 deletions
diff --git a/src/main/java/com/thatgravyboat/skyblockhud/handlers/HeldItemHandler.java b/src/main/java/com/thatgravyboat/skyblockhud/handlers/HeldItemHandler.java index 8211f0f..e7686d2 100644 --- a/src/main/java/com/thatgravyboat/skyblockhud/handlers/HeldItemHandler.java +++ b/src/main/java/com/thatgravyboat/skyblockhud/handlers/HeldItemHandler.java @@ -12,50 +12,54 @@ import net.minecraftforge.fml.common.eventhandler.SubscribeEvent; public class HeldItemHandler extends Gui { - public void drawFuelBar(Minecraft mc, int current, int max) { - GenericOverlays.drawSmallBar( - mc, - 100, - 100, - (double) current / (double) max, - 1.0d, - 0xff00ff, - 0xffff00, - 0 - ); - drawString( - mc.fontRendererObj, - "Fuel - " + Math.round(((double) current / (double) max) * 100) + "%", - 100, - 100, - 0xffffff - ); - } + public void drawFuelBar(Minecraft mc, int current, int max) { + GenericOverlays.drawSmallBar( + mc, + 100, + 100, + (double) current / (double) max, + 1.0d, + 0xff00ff, + 0xffff00, + 0 + ); + drawString( + mc.fontRendererObj, + "Fuel - " + + Math.round(((double) current / (double) max) * 100) + + "%", + 100, + 100, + 0xffffff + ); + } - public boolean isDrill(ItemStack stack) { - if (stack == null) return false; - if (!stack.getTagCompound().hasKey("ExtraAttributes")) return false; - return stack - .getTagCompound() - .getCompoundTag("ExtraAttributes") - .hasKey("drill_fuel"); - } + public boolean isDrill(ItemStack stack) { + if (stack == null) return false; + if (!stack.getTagCompound().hasKey("ExtraAttributes")) return false; + return stack + .getTagCompound() + .getCompoundTag("ExtraAttributes") + .hasKey("drill_fuel"); + } - public String getDrillFuel(ItemStack stack) { - NBTTagCompound display = stack.getTagCompound().getCompoundTag("display"); - NBTTagList lore = display.getTagList("Lore", 8); - for (int i = lore.tagCount() - 1; i >= 0; i--) { - String line = Utils.removeColor(lore.getStringTagAt(i)); - if (line.trim().startsWith("Fuel:")) { - return line; - } + public String getDrillFuel(ItemStack stack) { + NBTTagCompound display = stack + .getTagCompound() + .getCompoundTag("display"); + NBTTagList lore = display.getTagList("Lore", 8); + for (int i = lore.tagCount() - 1; i >= 0; i--) { + String line = Utils.removeColor(lore.getStringTagAt(i)); + if (line.trim().startsWith("Fuel:")) { + return line; + } + } + return ""; } - return ""; - } - @SubscribeEvent - public void drawOverlay(RenderGameOverlayEvent.Post event) { - /* + @SubscribeEvent + public void drawOverlay(RenderGameOverlayEvent.Post event) { + /* if (Utils.overlayShouldRender(event.type, SkyblockHud.hasSkyblockScoreboard())){ Minecraft mc = Minecraft.getMinecraft(); ItemStack stack = mc.thePlayer.getHeldItem(); @@ -72,5 +76,5 @@ public class HeldItemHandler extends Gui { } } */ - } + } } |