From f237ae4cecdfa5c00ee83bd0176a591a2b174913 Mon Sep 17 00:00:00 2001 From: CraftyOldMiner <85420839+CraftyOldMiner@users.noreply.github.com> Date: Sun, 27 Mar 2022 23:07:57 -0500 Subject: Restore metal detector and wishing compass changes that were nuked by #94 (#104) --- .../io/github/moulberry/notenoughupdates/util/SBInfo.java | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) (limited to 'src/main/java/io/github/moulberry/notenoughupdates/util/SBInfo.java') diff --git a/src/main/java/io/github/moulberry/notenoughupdates/util/SBInfo.java b/src/main/java/io/github/moulberry/notenoughupdates/util/SBInfo.java index 95a3539a..f1e40671 100644 --- a/src/main/java/io/github/moulberry/notenoughupdates/util/SBInfo.java +++ b/src/main/java/io/github/moulberry/notenoughupdates/util/SBInfo.java @@ -18,6 +18,8 @@ import net.minecraft.scoreboard.Score; import net.minecraft.scoreboard.ScoreObjective; import net.minecraft.scoreboard.ScorePlayerTeam; import net.minecraft.scoreboard.Scoreboard; +import net.minecraft.util.ChatComponentText; +import net.minecraft.util.EnumChatFormatting; import net.minecraft.util.IChatComponent; import net.minecraftforge.client.event.ClientChatReceivedEvent; import net.minecraftforge.client.event.GuiOpenEvent; @@ -57,7 +59,7 @@ public class SBInfo { public String slayer = ""; public boolean stranded = false; - public String mode = ""; + public String mode = null; public Date currentTimeDate = null; @@ -120,6 +122,16 @@ public class SBInfo { } } + public boolean checkForSkyblockLocation() { + if (!NotEnoughUpdates.INSTANCE.hasSkyblockScoreboard() || getLocation() == null) { + Minecraft.getMinecraft().thePlayer.addChatMessage(new ChatComponentText(EnumChatFormatting.RED + + "[NEU] This command is not available outside SkyBlock")); + return false; + } + + return true; + } + private static final Pattern PROFILE_PATTERN = Pattern.compile("(?(♲ Ironman)|(☀ Stranded)|()) *Profile: (?[^ ]+)"); -- cgit