aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/cc/polyfrost/oneconfig/utils/commands
diff options
context:
space:
mode:
authornextdaydelivery <79922345+nxtdaydelivery@users.noreply.github.com>2022-06-05 10:36:43 +0100
committernextdaydelivery <79922345+nxtdaydelivery@users.noreply.github.com>2022-06-05 10:36:43 +0100
commit087f5404658a1543834f16a89e3436f8399297f6 (patch)
tree4b6d18abbc2e6f3083e664786dbbef98bb142a33 /src/main/java/cc/polyfrost/oneconfig/utils/commands
parent3e472ea407d128de61820fc167e08b8fe24186c9 (diff)
downloadOneConfig-087f5404658a1543834f16a89e3436f8399297f6.tar.gz
OneConfig-087f5404658a1543834f16a89e3436f8399297f6.tar.bz2
OneConfig-087f5404658a1543834f16a89e3436f8399297f6.zip
Reformat code and OC-38
Diffstat (limited to 'src/main/java/cc/polyfrost/oneconfig/utils/commands')
-rw-r--r--src/main/java/cc/polyfrost/oneconfig/utils/commands/CommandManager.java1
-rw-r--r--src/main/java/cc/polyfrost/oneconfig/utils/commands/annotations/Command.java2
-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
-rw-r--r--src/main/java/cc/polyfrost/oneconfig/utils/commands/arguments/ArgumentParser.java4
6 files changed, 9 insertions, 3 deletions
diff --git a/src/main/java/cc/polyfrost/oneconfig/utils/commands/CommandManager.java b/src/main/java/cc/polyfrost/oneconfig/utils/commands/CommandManager.java
index 913ee73..4a008d3 100644
--- a/src/main/java/cc/polyfrost/oneconfig/utils/commands/CommandManager.java
+++ b/src/main/java/cc/polyfrost/oneconfig/utils/commands/CommandManager.java
@@ -6,7 +6,6 @@ import cc.polyfrost.oneconfig.utils.commands.annotations.*;
import cc.polyfrost.oneconfig.utils.commands.arguments.*;
import net.minecraft.command.CommandBase;
import net.minecraft.command.ICommandSender;
-import net.minecraft.util.BlockPos;
import net.minecraftforge.client.ClientCommandHandler;
import java.lang.reflect.InvocationTargetException;
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..89b5227 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
@@ -72,7 +72,7 @@ import java.lang.annotation.Target;
* }
* }</pre>
* </p>
- *
+ * <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)}.
*
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 "";
diff --git a/src/main/java/cc/polyfrost/oneconfig/utils/commands/arguments/ArgumentParser.java b/src/main/java/cc/polyfrost/oneconfig/utils/commands/arguments/ArgumentParser.java
index d9d51b0..61d1e07 100644
--- a/src/main/java/cc/polyfrost/oneconfig/utils/commands/arguments/ArgumentParser.java
+++ b/src/main/java/cc/polyfrost/oneconfig/utils/commands/arguments/ArgumentParser.java
@@ -5,8 +5,10 @@ import org.jetbrains.annotations.Nullable;
@SuppressWarnings("unstable")
public abstract class ArgumentParser<T> {
- private final TypeToken<T> type = new TypeToken<T>(getClass()) {};
+ private final TypeToken<T> type = new TypeToken<T>(getClass()) {
+ };
public final Class<?> typeClass = type.getRawType();
+
@Nullable
public abstract T parse(Arguments arguments);
}