Command system rewrite using Drink and Maven support.

This commit is contained in:
BattleDash
2021-06-26 19:08:15 -07:00
parent 08118bff57
commit 6243636243
20 changed files with 299 additions and 445 deletions

View File

@@ -0,0 +1,7 @@
package net.nuggetmc.ai.utils;
import net.md_5.bungee.api.ChatColor;
public class ChatUtils {
public static String LINE = ChatColor.GRAY + "------------------------------------------------";
}

View File

@@ -0,0 +1,24 @@
package net.nuggetmc.ai.utils;
import com.google.gson.JsonObject;
import com.google.gson.JsonParser;
import java.io.InputStreamReader;
import java.net.URL;
public class MojangAPI {
public static String[] getSkin(String name) {
try {
String uuid = new JsonParser().parse(new InputStreamReader(new URL("https://api.mojang.com/users/profiles/minecraft/" + name)
.openStream())).getAsJsonObject().get("id").getAsString();
JsonObject property = new JsonParser()
.parse(new InputStreamReader(new URL("https://sessionserver.mojang.com/session/minecraft/profile/" + uuid + "?unsigned=false")
.openStream())).getAsJsonObject().get("properties").getAsJsonArray().get(0).getAsJsonObject();
return new String[] {property.get("value").getAsString(), property.get("signature").getAsString()};
} catch (Exception e) {
e.printStackTrace();
return null;
}
}
}

View File

@@ -0,0 +1,16 @@
package net.nuggetmc.ai.utils;
import java.util.UUID;
public class SteveUUID {
public static UUID generate() {
UUID uuid = UUID.randomUUID();
if (uuid.hashCode() % 2 == 0) {
return uuid;
}
return generate();
}
}