aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/io/polyfrost/oneconfig/command
diff options
context:
space:
mode:
authornextdaydelivery <12willettsh@gmail.com>2022-02-12 09:24:51 +0000
committernextdaydelivery <12willettsh@gmail.com>2022-02-12 09:24:51 +0000
commit88df999a8ff35ea30b8fa9cf94c46dd748215581 (patch)
tree8cf665d5460fc07e15f62f9d01d9889eca76ef2b /src/main/java/io/polyfrost/oneconfig/command
downloadOneConfig-88df999a8ff35ea30b8fa9cf94c46dd748215581.tar.gz
OneConfig-88df999a8ff35ea30b8fa9cf94c46dd748215581.tar.bz2
OneConfig-88df999a8ff35ea30b8fa9cf94c46dd748215581.zip
swoosh
Diffstat (limited to 'src/main/java/io/polyfrost/oneconfig/command')
-rw-r--r--src/main/java/io/polyfrost/oneconfig/command/OneConfigCommand.java65
1 files changed, 65 insertions, 0 deletions
diff --git a/src/main/java/io/polyfrost/oneconfig/command/OneConfigCommand.java b/src/main/java/io/polyfrost/oneconfig/command/OneConfigCommand.java
new file mode 100644
index 0000000..3433c56
--- /dev/null
+++ b/src/main/java/io/polyfrost/oneconfig/command/OneConfigCommand.java
@@ -0,0 +1,65 @@
+package io.polyfrost.oneconfig.command;
+
+import io.polyfrost.oneconfig.gui.Window;
+import io.polyfrost.oneconfig.utils.TickDelay;
+import net.minecraft.client.Minecraft;
+import net.minecraft.command.CommandException;
+import net.minecraft.command.ICommand;
+import net.minecraft.command.ICommandSender;
+import net.minecraft.util.BlockPos;
+import org.jetbrains.annotations.NotNull;
+
+import java.util.ArrayList;
+import java.util.List;
+
+public class OneConfigCommand implements ICommand {
+
+ private final List<String> aliases;
+ private static final Minecraft mc = Minecraft.getMinecraft();
+
+ public OneConfigCommand() {
+ aliases = new ArrayList<>();
+ aliases.add("oneconfig");
+ aliases.add("ocfg");
+ }
+
+ @Override
+ public String getCommandName() {
+ return "oneconfig";
+ }
+
+ @Override
+ public String getCommandUsage(ICommandSender sender) {
+ return "oneconfig <>";
+ }
+
+ @Override
+ public List<String> getCommandAliases() {
+ return this.aliases;
+ }
+
+ @Override
+ public void processCommand(ICommandSender sender, String[] args) throws CommandException {
+ new TickDelay(() -> mc.displayGuiScreen(new Window()), 1);
+ }
+
+ @Override
+ public boolean canCommandSenderUseCommand(ICommandSender sender) {
+ return true;
+ }
+
+ @Override
+ public List<String> addTabCompletionOptions(ICommandSender sender, String[] args, BlockPos pos) {
+ return null;
+ }
+
+ @Override
+ public boolean isUsernameIndex(String[] args, int index) {
+ return false;
+ }
+
+ @Override
+ public int compareTo(@NotNull ICommand o) {
+ return 0;
+ }
+}