aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/com/thatgravyboat/skyblockhud/Utils.java
diff options
context:
space:
mode:
authorThatGravyBoat <thatgravyboat@gmail.com>2021-07-11 18:57:24 -0230
committerThatGravyBoat <thatgravyboat@gmail.com>2021-07-11 18:57:24 -0230
commit3a1917c8a0af4157cc1e6d5f3986e89377f245d8 (patch)
tree0a25fdc3ad1fc48da3f0d06c501f772ac9cfc353 /src/main/java/com/thatgravyboat/skyblockhud/Utils.java
parent5a98a98dfc0009599b90280ae3a1f166de21e6e8 (diff)
downloadSkyblockHud-Death-Defied-3a1917c8a0af4157cc1e6d5f3986e89377f245d8.tar.gz
SkyblockHud-Death-Defied-3a1917c8a0af4157cc1e6d5f3986e89377f245d8.tar.bz2
SkyblockHud-Death-Defied-3a1917c8a0af4157cc1e6d5f3986e89377f245d8.zip
Added Mining Overlay including drill bar and heat bar
Added mana cost display Update Location Stuff Added new mining events stopped scoreboard logging spam removed missing location logging as hypixel dumb and sends the wrong thing once and a while causing it to log useless stuff. Added DEV Commands
Diffstat (limited to 'src/main/java/com/thatgravyboat/skyblockhud/Utils.java')
-rw-r--r--src/main/java/com/thatgravyboat/skyblockhud/Utils.java31
1 files changed, 21 insertions, 10 deletions
diff --git a/src/main/java/com/thatgravyboat/skyblockhud/Utils.java b/src/main/java/com/thatgravyboat/skyblockhud/Utils.java
index 62cf6a3..3d176c9 100644
--- a/src/main/java/com/thatgravyboat/skyblockhud/Utils.java
+++ b/src/main/java/com/thatgravyboat/skyblockhud/Utils.java
@@ -1,9 +1,5 @@
package com.thatgravyboat.skyblockhud;
-import java.nio.FloatBuffer;
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.LinkedList;
import net.minecraft.client.Minecraft;
import net.minecraft.client.entity.EntityPlayerSP;
import net.minecraft.client.gui.FontRenderer;
@@ -14,12 +10,19 @@ import net.minecraft.client.renderer.WorldRenderer;
import net.minecraft.client.renderer.vertex.DefaultVertexFormats;
import net.minecraft.init.Items;
import net.minecraft.item.Item;
+import net.minecraft.item.ItemStack;
+import net.minecraft.nbt.NBTTagCompound;
import net.minecraftforge.client.event.RenderGameOverlayEvent;
import net.minecraftforge.fml.common.Loader;
import org.lwjgl.BufferUtils;
import org.lwjgl.opengl.GL11;
import org.lwjgl.opengl.GL14;
+import java.nio.FloatBuffer;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.LinkedList;
+
public class Utils {
private static LinkedList<Integer> guiScales = new LinkedList<>();
@@ -59,6 +62,18 @@ public class Utils {
return (int) (g + f * (h - g));
}
+ public static NBTTagCompound getSkyBlockTag(ItemStack stack){
+ if (stack == null) return null;
+ if (!stack.hasTagCompound()) return null;
+ if (!stack.getTagCompound().hasKey("ExtraAttributes")) return null;
+ return stack.getTagCompound().getCompoundTag("ExtraAttributes");
+ }
+
+ public static boolean isDrill(ItemStack stack){
+ NBTTagCompound tag = getSkyBlockTag(stack);
+ return tag != null && tag.hasKey("drill_fuel");
+ }
+
public static int whatRomanNumeral(String roman) {
switch (roman.toLowerCase()) {
case "i":
@@ -119,17 +134,13 @@ public class Utils {
public static boolean overlayShouldRender(boolean hideOnf3, RenderGameOverlayEvent.ElementType type, RenderGameOverlayEvent.ElementType checkType, boolean... booleans) {
Minecraft mc = Minecraft.getMinecraft();
- boolean shouldRender;
- if (booleans.length > 1) {
- for (boolean aBoolean : booleans) if (!aBoolean) return false;
- shouldRender = true;
- } else shouldRender = booleans.length != 1 || booleans[0];
+ for (boolean aBoolean : booleans) if (!aBoolean) return false;
if (hideOnf3) {
if (mc.gameSettings.showDebugInfo || (mc.gameSettings.keyBindPlayerList.isKeyDown() && (!mc.isIntegratedServerRunning() || mc.thePlayer.sendQueue.getPlayerInfoMap().size() > 1))) {
return false;
}
}
- return (shouldRender && ((type == null && Loader.isModLoaded("labymod")) || type == checkType));
+ return ((type == null && Loader.isModLoaded("labymod")) || type == checkType);
}
public static void drawStringScaledMaxWidth(String str, FontRenderer fr, float x, float y, boolean shadow, int len, int colour) {