diff options
Diffstat (limited to 'src/main/java/me/Danker/utils')
-rw-r--r-- | src/main/java/me/Danker/utils/Utils.java | 20 |
1 files changed, 19 insertions, 1 deletions
diff --git a/src/main/java/me/Danker/utils/Utils.java b/src/main/java/me/Danker/utils/Utils.java index 4749305..5dc30c6 100644 --- a/src/main/java/me/Danker/utils/Utils.java +++ b/src/main/java/me/Danker/utils/Utils.java @@ -5,17 +5,20 @@ import java.util.List; import java.util.regex.Matcher; import me.Danker.TheMod; +import me.Danker.handlers.ScoreboardHandler; import me.Danker.handlers.TextRenderer; import net.minecraft.client.Minecraft; import net.minecraft.client.gui.ScaledResolution; import net.minecraft.entity.item.EntityItem; import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.scoreboard.ScoreObjective; import net.minecraft.util.AxisAlignedBB; -import net.minecraft.util.ChatComponentText; import net.minecraft.util.StringUtils; public class Utils { + public static boolean inSkyblock = false; + public static int getItems(String item) { Minecraft mc = Minecraft.getMinecraft(); EntityPlayer player = mc.thePlayer; @@ -85,4 +88,19 @@ public class Utils { new TextRenderer(mc, text, titleX, titleY, scale); } + public static void checkForSkyblock() { + Minecraft mc = Minecraft.getMinecraft(); + if (mc != null && mc.theWorld != null && !mc.isSingleplayer()) { + ScoreObjective scoreboardObj = mc.theWorld.getScoreboard().getObjectiveInDisplaySlot(1); + if (scoreboardObj != null) { + String scObjName = ScoreboardHandler.cleanSB(scoreboardObj.getDisplayName()); + if (scObjName.contains("SKYBLOCK")) { + inSkyblock = true; + return; + } + } + } + inSkyblock = false; + } + } |