aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/cc/polyfrost/oneconfig/utils
diff options
context:
space:
mode:
authornextdaydelivery <79922345+nxtdaydelivery@users.noreply.github.com>2022-05-30 13:22:05 +0100
committernextdaydelivery <79922345+nxtdaydelivery@users.noreply.github.com>2022-05-30 13:22:05 +0100
commitc305d7b4b3b446ed85343e5248862fc157a13e5b (patch)
tree351fddaa0a6f4c6f9f037820fdd031333922393d /src/main/java/cc/polyfrost/oneconfig/utils
parentd5c493075b9fc50edc7d8a22efeed08310d9ffe2 (diff)
downloadOneConfig-c305d7b4b3b446ed85343e5248862fc157a13e5b.tar.gz
OneConfig-c305d7b4b3b446ed85343e5248862fc157a13e5b.tar.bz2
OneConfig-c305d7b4b3b446ed85343e5248862fc157a13e5b.zip
finish OC-5, OC-10, checkboxes OC-6
Diffstat (limited to 'src/main/java/cc/polyfrost/oneconfig/utils')
-rw-r--r--src/main/java/cc/polyfrost/oneconfig/utils/commands/CommandManager.java10
1 files changed, 7 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 f168b8f..913ee73 100644
--- a/src/main/java/cc/polyfrost/oneconfig/utils/commands/CommandManager.java
+++ b/src/main/java/cc/polyfrost/oneconfig/utils/commands/CommandManager.java
@@ -6,6 +6,7 @@ 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;
@@ -42,7 +43,7 @@ public class CommandManager {
* Adds a parser to the parsers map.
*
* @param parser The parser to add.
- * @param clazz The class of the parser.
+ * @param clazz The class of the parser.
*/
public void addParser(ArgumentParser<?> parser, Class<?> clazz) {
parsers.put(clazz, parser);
@@ -50,6 +51,7 @@ public class CommandManager {
/**
* Adds a parser to the parsers map.
+ *
* @param parser The parser to add.
*/
public void addParser(ArgumentParser<?> parser) {
@@ -93,7 +95,8 @@ public class CommandManager {
if (!root.invokers.isEmpty()) {
try {
root.invokers.stream().findFirst().get().method.invoke(null);
- } catch (IllegalAccessException | InvocationTargetException | IllegalArgumentException | ExceptionInInitializerError e) {
+ } catch (IllegalAccessException | InvocationTargetException | IllegalArgumentException |
+ ExceptionInInitializerError e) {
UChat.chat(ChatColor.RED.toString() + ChatColor.BOLD + METHOD_RUN_ERROR);
}
}
@@ -224,7 +227,8 @@ public class CommandManager {
}
invoker.method.invoke(null, params.toArray());
return null;
- } catch (IllegalAccessException | InvocationTargetException | IllegalArgumentException | ExceptionInInitializerError e) {
+ } catch (IllegalAccessException | InvocationTargetException | IllegalArgumentException |
+ ExceptionInInitializerError e) {
return ChatColor.RED.toString() + ChatColor.BOLD + METHOD_RUN_ERROR;
}
}