aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/cc/polyfrost/oneconfig/utils/commands/annotations
diff options
context:
space:
mode:
authorWyvest <45589059+Wyvest@users.noreply.github.com>2022-06-05 15:27:36 +0700
committerGitHub <noreply@github.com>2022-06-05 10:27:36 +0200
commit44dfbbb419f1736530c04c02a651f7757cf83f3d (patch)
tree1e8171573680b9415cecf199d479d49f7ad1f48a /src/main/java/cc/polyfrost/oneconfig/utils/commands/annotations
parent494d4f0bd0856e8e8d373003c82729ca722c6ccf (diff)
downloadOneConfig-44dfbbb419f1736530c04c02a651f7757cf83f3d.tar.gz
OneConfig-44dfbbb419f1736530c04c02a651f7757cf83f3d.tar.bz2
OneConfig-44dfbbb419f1736530c04c02a651f7757cf83f3d.zip
rewrite command manager, stop using essential relocate, and reformat code (#34)
* reformat code * reformat code rewrite command manager stop using essential relocate
Diffstat (limited to 'src/main/java/cc/polyfrost/oneconfig/utils/commands/annotations')
-rw-r--r--src/main/java/cc/polyfrost/oneconfig/utils/commands/annotations/Command.java6
-rw-r--r--src/main/java/cc/polyfrost/oneconfig/utils/commands/annotations/Main.java1
-rw-r--r--src/main/java/cc/polyfrost/oneconfig/utils/commands/annotations/Name.java1
-rw-r--r--src/main/java/cc/polyfrost/oneconfig/utils/commands/annotations/SubCommand.java3
4 files changed, 7 insertions, 4 deletions
diff --git a/src/main/java/cc/polyfrost/oneconfig/utils/commands/annotations/Command.java b/src/main/java/cc/polyfrost/oneconfig/utils/commands/annotations/Command.java
index b1a4ce5..deec7f1 100644
--- a/src/main/java/cc/polyfrost/oneconfig/utils/commands/annotations/Command.java
+++ b/src/main/java/cc/polyfrost/oneconfig/utils/commands/annotations/Command.java
@@ -1,6 +1,5 @@
package cc.polyfrost.oneconfig.utils.commands.annotations;
-import cc.polyfrost.oneconfig.utils.commands.CommandHelper;
import cc.polyfrost.oneconfig.utils.commands.CommandManager;
import cc.polyfrost.oneconfig.utils.commands.arguments.ArgumentParser;
@@ -72,9 +71,8 @@ import java.lang.annotation.Target;
* }
* }</pre>
* </p>
- *
- * To register commands, either extend {@link CommandHelper} and run {@link CommandHelper#preload()} (which does nothing,
- * just makes loading look nicer lol), or use {@link CommandManager#registerCommand(Object)}.
+ * <p>
+ * To register commands, use {@link CommandManager#registerCommand(Class)}.
*
* <p>
* Note: if you're viewing this in IntelliJ or just see the @literal tag everywhere, please ignore that.
diff --git a/src/main/java/cc/polyfrost/oneconfig/utils/commands/annotations/Main.java b/src/main/java/cc/polyfrost/oneconfig/utils/commands/annotations/Main.java
index 3c105c7..9b49fb4 100644
--- a/src/main/java/cc/polyfrost/oneconfig/utils/commands/annotations/Main.java
+++ b/src/main/java/cc/polyfrost/oneconfig/utils/commands/annotations/Main.java
@@ -16,5 +16,6 @@ import java.lang.annotation.Target;
@Target({ElementType.METHOD})
public @interface Main {
String description() default "";
+
int priority() default 1000;
}
diff --git a/src/main/java/cc/polyfrost/oneconfig/utils/commands/annotations/Name.java b/src/main/java/cc/polyfrost/oneconfig/utils/commands/annotations/Name.java
index ef178a0..f802697 100644
--- a/src/main/java/cc/polyfrost/oneconfig/utils/commands/annotations/Name.java
+++ b/src/main/java/cc/polyfrost/oneconfig/utils/commands/annotations/Name.java
@@ -16,6 +16,7 @@ import java.lang.annotation.Target;
public @interface Name {
/**
* The name of the parameter.
+ *
* @return The name of the parameter.
*/
String value();
diff --git a/src/main/java/cc/polyfrost/oneconfig/utils/commands/annotations/SubCommand.java b/src/main/java/cc/polyfrost/oneconfig/utils/commands/annotations/SubCommand.java
index b1cf035..1bfbd53 100644
--- a/src/main/java/cc/polyfrost/oneconfig/utils/commands/annotations/SubCommand.java
+++ b/src/main/java/cc/polyfrost/oneconfig/utils/commands/annotations/SubCommand.java
@@ -16,18 +16,21 @@ import java.lang.annotation.Target;
public @interface SubCommand {
/**
* The name of the command.
+ *
* @return The name of the command.
*/
String value();
/**
* The aliases of the command.
+ *
* @return The aliases of the command.
*/
String[] aliases() default {};
/**
* The description of the command.
+ *
* @return The description of the command.
*/
String description() default "";