diff options
author | hackthetime <l4bg0jb7@duck.com> | 2023-11-08 12:45:33 +0100 |
---|---|---|
committer | hackthetime <l4bg0jb7@duck.com> | 2023-11-08 12:45:33 +0100 |
commit | ce208c31079689527a489eab2b54765591a8507f (patch) | |
tree | 221ced0ac7adee7bbc020d3a789184ab500667b2 /forge | |
parent | d67306935eec84aaae521d7c98f0291d7b3ff711 (diff) | |
download | BBsentials-ce208c31079689527a489eab2b54765591a8507f.tar.gz BBsentials-ce208c31079689527a489eab2b54765591a8507f.tar.bz2 BBsentials-ce208c31079689527a489eab2b54765591a8507f.zip |
added Island detection to 1.8.9
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() { |