aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/cc/polyfrost/oneconfig/command
diff options
context:
space:
mode:
authorWyvest <45589059+Wyvest@users.noreply.github.com>2022-05-28 23:11:16 +0700
committerWyvest <45589059+Wyvest@users.noreply.github.com>2022-05-28 23:11:16 +0700
commita112193704fce1dc704aa58a51fdf30f55f32a9c (patch)
tree0676f9f084e0be4861e8a5d27857d450dd772c81 /src/main/java/cc/polyfrost/oneconfig/command
parent4df2a5f6c815b0dd8cc8b68aaf164a40e63fa57d (diff)
downloadOneConfig-a112193704fce1dc704aa58a51fdf30f55f32a9c.tar.gz
OneConfig-a112193704fce1dc704aa58a51fdf30f55f32a9c.tar.bz2
OneConfig-a112193704fce1dc704aa58a51fdf30f55f32a9c.zip
migrate OneConfigCommand to new command util
make classes that end with `_Test` be excluded from non-sourcejar jars javadoc some more stuff
Diffstat (limited to 'src/main/java/cc/polyfrost/oneconfig/command')
-rw-r--r--src/main/java/cc/polyfrost/oneconfig/command/OneConfigCommand.java69
1 files changed, 25 insertions, 44 deletions
diff --git a/src/main/java/cc/polyfrost/oneconfig/command/OneConfigCommand.java b/src/main/java/cc/polyfrost/oneconfig/command/OneConfigCommand.java
index 0743b54..ab2c403 100644
--- a/src/main/java/cc/polyfrost/oneconfig/command/OneConfigCommand.java
+++ b/src/main/java/cc/polyfrost/oneconfig/command/OneConfigCommand.java
@@ -2,54 +2,35 @@ package cc.polyfrost.oneconfig.command;
import cc.polyfrost.oneconfig.gui.HudGui;
import cc.polyfrost.oneconfig.gui.OneConfigGui;
-import cc.polyfrost.oneconfig.test.TestNanoVGGui;
import cc.polyfrost.oneconfig.utils.GuiUtils;
-import net.minecraft.command.CommandBase;
-import net.minecraft.command.ICommandSender;
-
-import java.util.ArrayList;
-import java.util.List;
-
-public class OneConfigCommand extends CommandBase {
-
- @Override
- public String getCommandName() {
- return "oneconfig";
- }
-
- @Override
- public String getCommandUsage(ICommandSender sender) {
- return "oneconfig <>";
- }
-
- @Override
- public List<String> getCommandAliases() {
- return new ArrayList<String>() {{
- add("oneconfig");
- add("ocfg");
- }};
+import cc.polyfrost.oneconfig.utils.commands.annotations.Command;
+import cc.polyfrost.oneconfig.utils.commands.annotations.Main;
+import cc.polyfrost.oneconfig.utils.commands.annotations.SubCommand;
+
+/**
+ * The main OneConfig command.
+ */
+@Command(value = "oneconfig", aliases = {"ocfg", "oneconfig"}, description = "Access the OneConfig GUI.")
+public class OneConfigCommand {
+
+ @Main
+ private static void main() {
+ GuiUtils.displayScreen(OneConfigGui.create());
}
- @Override
- public void processCommand(ICommandSender sender, String[] args) {
- if (args.length == 0) GuiUtils.displayScreen(OneConfigGui.create());
- else {
- switch (args[0]) {
- case "hud":
- GuiUtils.displayScreen(new HudGui());
- break;
- case "lwjgl":
- GuiUtils.displayScreen(new TestNanoVGGui());
- break;
- case "destroy":
- OneConfigGui.instanceToRestore = null;
- break;
- }
+ @SubCommand(value = "hud", description = "Open the OneConfig HUD config.")
+ private static class HUDSubCommand {
+ @Main
+ private static void main() {
+ GuiUtils.displayScreen(new HudGui());
}
}
- @Override
- public int getRequiredPermissionLevel() {
- return -1;
+ @SubCommand(value = "destory", description = "Destroy the cached OneConfig GUI.")
+ private static class DestroySubCommand {
+ @Main
+ private static void main() {
+ OneConfigGui.instanceToRestore = null;
+ }
}
-}
+} \ No newline at end of file