aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/io
diff options
context:
space:
mode:
authorefefury <69400149+efefury@users.noreply.github.com>2023-01-16 18:53:50 +0000
committerGitHub <noreply@github.com>2023-01-16 18:53:50 +0000
commit2f0c6f5aed1fc2e15555b80bbd2e32df279d3640 (patch)
tree07db0adf0c2538001332686de52537d3bb839175 /src/main/java/io
parenta86faac67f4125716562d16c951320356bf87c30 (diff)
parent02b1db43c537e9d317565b3bb32c4ba1a14ecd62 (diff)
downloadNotEnoughUpdates-2f0c6f5aed1fc2e15555b80bbd2e32df279d3640.tar.gz
NotEnoughUpdates-2f0c6f5aed1fc2e15555b80bbd2e32df279d3640.tar.bz2
NotEnoughUpdates-2f0c6f5aed1fc2e15555b80bbd2e32df279d3640.zip
Merge pull request #9 from romangraef/pvlevel
Diffstat (limited to 'src/main/java/io')
-rw-r--r--src/main/java/io/github/moulberry/notenoughupdates/commands/dev/DevTestCommand.java36
1 files changed, 34 insertions, 2 deletions
diff --git a/src/main/java/io/github/moulberry/notenoughupdates/commands/dev/DevTestCommand.java b/src/main/java/io/github/moulberry/notenoughupdates/commands/dev/DevTestCommand.java
index cf266dca..5787c075 100644
--- a/src/main/java/io/github/moulberry/notenoughupdates/commands/dev/DevTestCommand.java
+++ b/src/main/java/io/github/moulberry/notenoughupdates/commands/dev/DevTestCommand.java
@@ -19,6 +19,9 @@
package io.github.moulberry.notenoughupdates.commands.dev;
+import com.google.gson.JsonArray;
+import com.google.gson.JsonElement;
+import com.google.gson.JsonObject;
import io.github.moulberry.notenoughupdates.BuildFlags;
import io.github.moulberry.notenoughupdates.NotEnoughUpdates;
import io.github.moulberry.notenoughupdates.commands.ClientCommandBase;
@@ -34,6 +37,7 @@ import io.github.moulberry.notenoughupdates.util.PronounDB;
import io.github.moulberry.notenoughupdates.util.SBInfo;
import io.github.moulberry.notenoughupdates.util.TabListUtils;
import io.github.moulberry.notenoughupdates.util.Utils;
+import io.github.moulberry.notenoughupdates.util.hypixelapi.ProfileCollectionInfo;
import net.minecraft.client.Minecraft;
import net.minecraft.client.gui.GuiScreen;
import net.minecraft.command.CommandException;
@@ -122,6 +126,32 @@ public class DevTestCommand extends ClientCommandBase {
Utils.addChatMessage(EnumChatFormatting.RED + DEV_FAIL_STRINGS[devFailIndex++]);
return;
}
+ if (args.length == 1 && args[0].equalsIgnoreCase("testprofile")) {
+ NotEnoughUpdates.INSTANCE.manager.apiUtils.newHypixelApiRequest("skyblock/profiles")
+ .queryArgument(
+ "uuid",
+ "" + Minecraft.getMinecraft().thePlayer.getUniqueID()
+ )
+ .requestJson()
+ .thenApply(jsonObject -> {
+ JsonArray profiles = jsonObject.get("profiles").getAsJsonArray();
+ JsonObject cp = null;
+ for (JsonElement profile : profiles) {
+ JsonObject asJsonObject = profile.getAsJsonObject();
+ if ((asJsonObject.has("selected") &&
+ asJsonObject.get("selected").getAsBoolean()) || cp == null) {
+ cp = asJsonObject;
+ }
+ }
+ return cp;
+ })
+ .thenCompose(obj -> ProfileCollectionInfo.getCollectionData(
+ obj,
+ Minecraft.getMinecraft().thePlayer.getUniqueID()
+ ))
+ .thenAccept(it ->
+ Utils.addChatMessage("Response: " + it));
+ }
if (args.length >= 1 && args[0].equalsIgnoreCase("profileinfo")) {
String currentProfile = SBInfo.getInstance().currentProfile;
SBInfo.Gamemode gamemode = SBInfo.getInstance().getGamemodeForProfile(currentProfile);
@@ -146,7 +176,8 @@ public class DevTestCommand extends ClientCommandBase {
Arrays.copyOfRange(args, 1, args.length)
);
}
- Utils.addChatMessage("§e[NEU] §fYour external editor is: §Z" + NotEnoughUpdates.INSTANCE.config.hidden.externalEditor);
+ Utils.addChatMessage(
+ "§e[NEU] §fYour external editor is: §Z" + NotEnoughUpdates.INSTANCE.config.hidden.externalEditor);
return;
}
if (args.length >= 1 && args[0].equalsIgnoreCase("pricetest")) {
@@ -181,7 +212,8 @@ public class DevTestCommand extends ClientCommandBase {
}
if (args.length == 1 && args[0].equalsIgnoreCase("dev")) {
NotEnoughUpdates.INSTANCE.config.hidden.dev = !NotEnoughUpdates.INSTANCE.config.hidden.dev;
- Utils.addChatMessage("§e[NEU] Dev mode " + (NotEnoughUpdates.INSTANCE.config.hidden.dev ? "§aenabled": "§cdisabled"));
+ Utils.addChatMessage(
+ "§e[NEU] Dev mode " + (NotEnoughUpdates.INSTANCE.config.hidden.dev ? "§aenabled" : "§cdisabled"));
return;
}
if (args.length == 1 && args[0].equalsIgnoreCase("saveconfig")) {