diff options
| author | CraftyOldMiner <85420839+CraftyOldMiner@users.noreply.github.com> | 2022-03-27 23:07:57 -0500 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2022-03-28 00:07:57 -0400 |
| commit | f237ae4cecdfa5c00ee83bd0176a591a2b174913 (patch) | |
| tree | 5b3e6d01296609b2a9f1701924e973b3bd19edd4 /src/main/java/io/github/moulberry/notenoughupdates/util/SBInfo.java | |
| parent | 4afcd516ffc58d55da24c5f4db14db7922f61121 (diff) | |
| download | notenoughupdates-f237ae4cecdfa5c00ee83bd0176a591a2b174913.tar.gz notenoughupdates-f237ae4cecdfa5c00ee83bd0176a591a2b174913.tar.bz2 notenoughupdates-f237ae4cecdfa5c00ee83bd0176a591a2b174913.zip | |
Restore metal detector and wishing compass changes that were nuked by #94 (#104)
Diffstat (limited to 'src/main/java/io/github/moulberry/notenoughupdates/util/SBInfo.java')
| -rw-r--r-- | src/main/java/io/github/moulberry/notenoughupdates/util/SBInfo.java | 14 |
1 files changed, 13 insertions, 1 deletions
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("(?<type>(♲ Ironman)|(☀ Stranded)|()) *Profile: (?<name>[^ ]+)"); |
