aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/io/github/moulberry/notenoughupdates/util/SBInfo.java
diff options
context:
space:
mode:
authorBuildTools <james.jenour@protonmail.com>2021-02-20 23:37:59 +0800
committerBuildTools <james.jenour@protonmail.com>2021-02-20 23:37:59 +0800
commit06cb4d208801e276a0e4d96252c00ae01d9e522d (patch)
treeedb9ea57e98398c004433be0b9a7fd7ce324b385 /src/main/java/io/github/moulberry/notenoughupdates/util/SBInfo.java
parentde834a97505c66b5655ee7ff91e78e84da3f81f3 (diff)
downloadnotenoughupdates-06cb4d208801e276a0e4d96252c00ae01d9e522d.tar.gz
notenoughupdates-06cb4d208801e276a0e4d96252c00ae01d9e522d.tar.bz2
notenoughupdates-06cb4d208801e276a0e4d96252c00ae01d9e522d.zip
charzard just 4 u
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.java15
1 files changed, 15 insertions, 0 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 090b3b59..13317776 100644
--- a/src/main/java/io/github/moulberry/notenoughupdates/util/SBInfo.java
+++ b/src/main/java/io/github/moulberry/notenoughupdates/util/SBInfo.java
@@ -5,11 +5,13 @@ import io.github.moulberry.notenoughupdates.NotEnoughUpdates;
import io.github.moulberry.notenoughupdates.miscfeatures.EnchantingSolvers;
import net.minecraft.client.Minecraft;
import net.minecraft.client.gui.inventory.GuiChest;
+import net.minecraft.client.network.NetworkPlayerInfo;
import net.minecraft.inventory.ContainerChest;
import net.minecraft.scoreboard.Score;
import net.minecraft.scoreboard.ScoreObjective;
import net.minecraft.scoreboard.ScorePlayerTeam;
import net.minecraft.scoreboard.Scoreboard;
+import net.minecraft.util.IChatComponent;
import net.minecraftforge.client.event.ClientChatReceivedEvent;
import net.minecraftforge.client.event.GuiOpenEvent;
import net.minecraftforge.event.world.WorldEvent;
@@ -31,6 +33,9 @@ public class SBInfo {
private static final Pattern timePattern = Pattern.compile(".+(am|pm)");
+ public IChatComponent footer;
+ public IChatComponent header;
+
public String location = "";
public String date = "";
public String time = "";
@@ -51,6 +56,8 @@ public class SBInfo {
private long joinedWorld = -1;
private JsonObject locraw = null;
+ public String currentProfile = null;
+
@SubscribeEvent
public void onGuiOpen(GuiOpenEvent event) {
if(!NotEnoughUpdates.INSTANCE.hasSkyblockScoreboard()) return;
@@ -120,6 +127,14 @@ public class SBInfo {
}
try {
+ for(NetworkPlayerInfo info : Minecraft.getMinecraft().thePlayer.sendQueue.getPlayerInfoMap()) {
+ String name = Minecraft.getMinecraft().ingameGUI.getTabList().getPlayerName(info);
+ final String profilePrefix = "\u00a7r\u00a7e\u00a7lProfile: \u00a7r\u00a7a";
+ if(name.startsWith(profilePrefix)) {
+ currentProfile = Utils.cleanColour(name.substring(profilePrefix.length()));
+ }
+ }
+
Scoreboard scoreboard = Minecraft.getMinecraft().thePlayer.getWorldScoreboard();
ScoreObjective sidebarObjective = scoreboard.getObjectiveInDisplaySlot(1); //ยง707/14/20