aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/me/xmrvizzy/skyblocker/utils/Utils.java
diff options
context:
space:
mode:
authorYasin <LifeIsAParadox@users.noreply.github.com>2023-09-22 23:17:11 +0200
committerGitHub <noreply@github.com>2023-09-22 23:17:11 +0200
commitdbdb0598086a4d31018294f87026da517ceb0ce2 (patch)
tree0df6b352acdef90569dd63630c5a61663a45075a /src/main/java/me/xmrvizzy/skyblocker/utils/Utils.java
parent2eab021f679fc91f87a344ac24c3db084f415670 (diff)
parenta72371d944c2fb5f311339bf20cd74f8d7bed967 (diff)
downloadSkyblocker-dbdb0598086a4d31018294f87026da517ceb0ce2.tar.gz
Skyblocker-dbdb0598086a4d31018294f87026da517ceb0ce2.tar.bz2
Skyblocker-dbdb0598086a4d31018294f87026da517ceb0ce2.zip
Merge pull request #324 from SkyblockerMod/1.20.2
1.20.2
Diffstat (limited to 'src/main/java/me/xmrvizzy/skyblocker/utils/Utils.java')
-rw-r--r--src/main/java/me/xmrvizzy/skyblocker/utils/Utils.java9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/main/java/me/xmrvizzy/skyblocker/utils/Utils.java b/src/main/java/me/xmrvizzy/skyblocker/utils/Utils.java
index 755e191d..b0fb6edf 100644
--- a/src/main/java/me/xmrvizzy/skyblocker/utils/Utils.java
+++ b/src/main/java/me/xmrvizzy/skyblocker/utils/Utils.java
@@ -15,6 +15,7 @@ import net.minecraft.client.network.ClientPlayNetworkHandler;
import net.minecraft.client.network.ClientPlayerEntity;
import net.minecraft.client.network.PlayerListEntry;
import net.minecraft.scoreboard.Scoreboard;
+import net.minecraft.scoreboard.ScoreboardDisplaySlot;
import net.minecraft.scoreboard.ScoreboardObjective;
import net.minecraft.scoreboard.ScoreboardPlayerScore;
import net.minecraft.scoreboard.Team;
@@ -167,7 +168,7 @@ public class Utils {
private static boolean isConnectedToHypixel(MinecraftClient client) {
String serverAddress = (client.getCurrentServerEntry() != null) ? client.getCurrentServerEntry().address.toLowerCase() : "";
- String serverBrand = (client.player != null && client.player.getServerBrand() != null) ? client.player.getServerBrand() : "";
+ String serverBrand = (client.player != null && client.player.networkHandler != null && client.player.networkHandler.getBrand() != null) ? client.player.networkHandler.getBrand() : "";
return serverAddress.equalsIgnoreCase(ALTERNATE_HYPIXEL_ADDRESS) || serverAddress.contains("hypixel.net") || serverAddress.contains("hypixel.io") || serverBrand.contains("Hypixel BungeeCord");
}
@@ -244,7 +245,7 @@ public class Utils {
ClientPlayerEntity client = MinecraftClient.getInstance().player;
if (client == null) return Collections.emptyList();
Scoreboard scoreboard = MinecraftClient.getInstance().player.getScoreboard();
- ScoreboardObjective objective = scoreboard.getObjectiveForSlot(1);
+ ScoreboardObjective objective = scoreboard.getObjectiveForSlot(ScoreboardDisplaySlot.FROM_ID.apply(1));
List<String> lines = new ArrayList<>();
for (ScoreboardPlayerScore score : scoreboard.getAllPlayerScores(objective)) {
Team team = scoreboard.getPlayerTeam(score.getPlayerName());
@@ -323,10 +324,10 @@ public class Utils {
if (locRaw.has("map")) {
map = locRaw.get("map").getAsString();
}
-
+
boolean shouldFilter = !sentLocRaw;
sentLocRaw = false;
-
+
return shouldFilter;
}
}