diff options
Diffstat (limited to 'forge')
-rw-r--r-- | forge/src/main/java/de/hype/bbsentials/forge/BBUtils.java | 25 |
1 files changed, 13 insertions, 12 deletions
diff --git a/forge/src/main/java/de/hype/bbsentials/forge/BBUtils.java b/forge/src/main/java/de/hype/bbsentials/forge/BBUtils.java index 3acf95e..c7d2e22 100644 --- a/forge/src/main/java/de/hype/bbsentials/forge/BBUtils.java +++ b/forge/src/main/java/de/hype/bbsentials/forge/BBUtils.java @@ -1,24 +1,25 @@ package de.hype.bbsentials.forge; import com.google.common.collect.Lists; +import de.hype.bbsentials.common.chat.Chat; import de.hype.bbsentials.common.constants.enviromentShared.Islands; +import net.minecraft.client.Minecraft; import java.util.List; public class BBUtils implements de.hype.bbsentials.common.mclibraries.BBUtils { public Islands getCurrentIsland() { -// try { -// String string = MinecraftClient.getInstance().player.networkHandler.getPlayerListEntry("!C-b").getDisplayName().getString(); -// if (!string.startsWith("Area: ")) { -// Chat.sendPrivateMessageToSelfError("Could not get Area data. Are you in Skyblock?"); -// } -// else { -// return Islands.getByDisplayName(string.replace("Area: ", "").trim()); -// } -// } catch (Exception e) { -// } -// return null; - return Islands.PRIVATE_ISLAND; + try { + String string = Minecraft.getMinecraft().getNetHandler().getPlayerInfo("!C-b").getDisplayName().getUnformattedText(); + if (!string.startsWith("Area: ")) { + Chat.sendPrivateMessageToSelfError("Could not get Area data. Are you in Skyblock?"); + } + else { + return Islands.getByDisplayName(string.replace("Area: ", "").trim()); + } + } catch (Exception e) { + } + return null; } public int getPlayerCount() { |