diff options
Diffstat (limited to 'src/main/java/me/Danker/commands')
-rw-r--r-- | src/main/java/me/Danker/commands/ReloadRepoCommand.java | 15 | ||||
-rw-r--r-- | src/main/java/me/Danker/commands/ToggleCommand.java | 2 |
2 files changed, 2 insertions, 15 deletions
diff --git a/src/main/java/me/Danker/commands/ReloadRepoCommand.java b/src/main/java/me/Danker/commands/ReloadRepoCommand.java index 1681971..a50a5c8 100644 --- a/src/main/java/me/Danker/commands/ReloadRepoCommand.java +++ b/src/main/java/me/Danker/commands/ReloadRepoCommand.java @@ -1,18 +1,13 @@ package me.Danker.commands; import me.Danker.DankersSkyblockMod; -import me.Danker.features.ColouredNames; -import me.Danker.handlers.APIHandler; +import me.Danker.utils.Utils; import net.minecraft.command.CommandBase; import net.minecraft.command.CommandException; import net.minecraft.command.ICommandSender; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.util.ChatComponentText; -import java.util.ArrayList; -import java.util.Map; -import java.util.stream.Collectors; - public class ReloadRepoCommand extends CommandBase { @Override @@ -39,13 +34,7 @@ public class ReloadRepoCommand extends CommandBase { // MULTI THREAD DRIFTING new Thread(() -> { EntityPlayer player = (EntityPlayer) arg0; - - DankersSkyblockMod.data = APIHandler.getResponse("https://raw.githubusercontent.com/bowser0000/SkyblockMod-REPO/main/data.json"); - System.out.println("Loaded data from GitHub?: " + (DankersSkyblockMod.data != null && DankersSkyblockMod.data.has("trivia"))); - ColouredNames.users = DankersSkyblockMod.data.get("colourednames").getAsJsonObject().entrySet().stream() - .map(Map.Entry::getKey) - .collect(Collectors.toCollection(ArrayList::new)); - + Utils.refreshRepo(); player.addChatMessage(new ChatComponentText(DankersSkyblockMod.MAIN_COLOUR + "Refreshed Danker's Skyblock Mod repo.")); }).start(); } diff --git a/src/main/java/me/Danker/commands/ToggleCommand.java b/src/main/java/me/Danker/commands/ToggleCommand.java index 44b1df2..3770d8f 100644 --- a/src/main/java/me/Danker/commands/ToggleCommand.java +++ b/src/main/java/me/Danker/commands/ToggleCommand.java @@ -1,9 +1,7 @@ package me.Danker.commands; -import jdk.nashorn.internal.runtime.regexp.joni.Config; import me.Danker.DankersSkyblockMod; import me.Danker.features.CustomMusic; -import me.Danker.features.EndOfFarmAlert; import me.Danker.handlers.ConfigHandler; import net.minecraft.command.CommandBase; import net.minecraft.command.CommandException; |