aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/main/java/io/github/moulberry/notenoughupdates/NEUManager.java9
-rw-r--r--src/main/java/io/github/moulberry/notenoughupdates/listener/ChatListener.java4
-rw-r--r--src/main/java/io/github/moulberry/notenoughupdates/miscgui/minionhelper/render/MinionHelperOverlay.java8
-rw-r--r--src/main/java/io/github/moulberry/notenoughupdates/util/SBInfo.java10
4 files changed, 21 insertions, 10 deletions
diff --git a/src/main/java/io/github/moulberry/notenoughupdates/NEUManager.java b/src/main/java/io/github/moulberry/notenoughupdates/NEUManager.java
index 3dd13d49..f1220b34 100644
--- a/src/main/java/io/github/moulberry/notenoughupdates/NEUManager.java
+++ b/src/main/java/io/github/moulberry/notenoughupdates/NEUManager.java
@@ -157,11 +157,6 @@ public class NEUManager {
repoLocation.mkdir();
}
- public void setCurrentProfile(String currentProfile) {
- SBInfo.getInstance().currentProfile = currentProfile;
- MinionHelperManager.getInstance().onProfileSwitch();
- }
-
public String getCurrentProfile() {
return SBInfo.getInstance().currentProfile;
}
@@ -674,7 +669,8 @@ public class NEUManager {
ea = ea.getCompoundTag("Properties");
ea = ea.getTagList("textures", 10).getCompoundTagAt(0);
String name = ea3.getString("Name").replaceAll(" M{0,4}(CM|CD|D?C{0,3})(XC|XL|L?X{0,3})(IX|IV|V?I{0,3})$", "");
- return "put(\"ID\", Utils.createSkull(EnumChatFormatting.AQUA + \"" + name + "\" ,\"" + ea2.getString("Id") + "\", \"" + ea.getString("Value") +"\"));";
+ return "put(\"ID\", Utils.createSkull(EnumChatFormatting.AQUA + \"" + name + "\" ,\"" + ea2.getString("Id") +
+ "\", \"" + ea.getString("Value") + "\"));";
}
}
return null;
@@ -914,6 +910,7 @@ public class NEUManager {
NBTTagCompound tag = stack.getTagCompound();
return getSkullValueFromNBT(tag);
}
+
public String getInternalNameForItem(ItemStack stack) {
if (stack == null) return null;
NBTTagCompound tag = stack.getTagCompound();
diff --git a/src/main/java/io/github/moulberry/notenoughupdates/listener/ChatListener.java b/src/main/java/io/github/moulberry/notenoughupdates/listener/ChatListener.java
index 6b350789..379a0b6d 100644
--- a/src/main/java/io/github/moulberry/notenoughupdates/listener/ChatListener.java
+++ b/src/main/java/io/github/moulberry/notenoughupdates/listener/ChatListener.java
@@ -160,11 +160,11 @@ public class ChatListener {
String unformatted = Utils.cleanColour(e.message.getUnformattedText());
Matcher matcher = SLAYER_XP.matcher(unformatted);
if (unformatted.startsWith("You are playing on profile: ")) {
- neu.manager.setCurrentProfile(unformatted
+ SBInfo.getInstance().setCurrentProfile(unformatted
.substring("You are playing on profile: ".length())
.split(" ")[0].trim());
} else if (unformatted.startsWith("Your profile was changed to: ")) {//Your profile was changed to:
- neu.manager.setCurrentProfile(unformatted
+ SBInfo.getInstance().setCurrentProfile(unformatted
.substring("Your profile was changed to: ".length())
.split(" ")[0].trim());
} else if (unformatted.startsWith("Your new API key is ")) {
diff --git a/src/main/java/io/github/moulberry/notenoughupdates/miscgui/minionhelper/render/MinionHelperOverlay.java b/src/main/java/io/github/moulberry/notenoughupdates/miscgui/minionhelper/render/MinionHelperOverlay.java
index 8606721c..2cebf0ff 100644
--- a/src/main/java/io/github/moulberry/notenoughupdates/miscgui/minionhelper/render/MinionHelperOverlay.java
+++ b/src/main/java/io/github/moulberry/notenoughupdates/miscgui/minionhelper/render/MinionHelperOverlay.java
@@ -46,6 +46,7 @@ import org.lwjgl.input.Mouse;
import org.lwjgl.opengl.GL11;
import java.util.Arrays;
+import java.util.Collections;
import java.util.HashMap;
import java.util.LinkedHashMap;
import java.util.Map;
@@ -84,7 +85,12 @@ public class MinionHelperOverlay {
@SubscribeEvent
public void onDrawBackground(GuiScreenEvent.BackgroundDrawnEvent event) {
if (!manager.inCraftedMinionsInventory()) return;
- if (!manager.isReadyToUse()) return;
+ if (!manager.isReadyToUse()) {
+ LinkedHashMap<String, OverviewLine> map = new LinkedHashMap<>();
+ map.put("§cLoading...", new OverviewText(Collections.emptyList(), () -> {}));
+ render(event, map);
+ return;
+ }
if (manager.getApi().isNotifyNoCollectionApi()) {
NotificationHandler.displayNotification(Lists.newArrayList(
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 8bac8dbc..dd7ccbcf 100644
--- a/src/main/java/io/github/moulberry/notenoughupdates/util/SBInfo.java
+++ b/src/main/java/io/github/moulberry/notenoughupdates/util/SBInfo.java
@@ -24,6 +24,7 @@ import com.google.gson.JsonObject;
import io.github.moulberry.notenoughupdates.NotEnoughUpdates;
import io.github.moulberry.notenoughupdates.listener.ScoreboardLocationChangeListener;
import io.github.moulberry.notenoughupdates.miscfeatures.customblockzones.LocationChangeEvent;
+import io.github.moulberry.notenoughupdates.miscgui.minionhelper.MinionHelperManager;
import io.github.moulberry.notenoughupdates.overlays.SlayerOverlay;
import net.minecraft.client.Minecraft;
import net.minecraft.client.gui.GuiScreen;
@@ -294,7 +295,7 @@ public class SBInfo {
for (NetworkPlayerInfo info : Minecraft.getMinecraft().thePlayer.sendQueue.getPlayerInfoMap()) {
String name = Minecraft.getMinecraft().ingameGUI.getTabList().getPlayerName(info);
if (name.startsWith(profilePrefix)) {
- currentProfile = Utils.cleanColour(name.substring(profilePrefix.length()));
+ setCurrentProfile(Utils.cleanColour(name.substring(profilePrefix.length())));
hasNewTab = true;
} else if (name.startsWith(skillsPrefix)) {
String levelInfo = name.substring(skillsPrefix.length()).trim();
@@ -413,4 +414,11 @@ public class SBInfo {
e.printStackTrace();
}
}
+
+ public void setCurrentProfile(String newProfile) {
+ if (!newProfile.equals(currentProfile)) {
+ currentProfile = newProfile;
+ MinionHelperManager.getInstance().onProfileSwitch();
+ }
+ }
}