From 7eacb4b62638c1ef5d5d23d7c2a8d8b0045e6bbc Mon Sep 17 00:00:00 2001 From: Florian Rinke Date: Thu, 14 Oct 2021 17:02:44 +0200 Subject: implements colf command #13 --- src/main/java/de/torui/coflsky/CoflSky.java | 2 +- src/main/java/de/torui/coflsky/ColfCommand.java | 31 +++++++++++++++++++++++++ 2 files changed, 32 insertions(+), 1 deletion(-) create mode 100644 src/main/java/de/torui/coflsky/ColfCommand.java diff --git a/src/main/java/de/torui/coflsky/CoflSky.java b/src/main/java/de/torui/coflsky/CoflSky.java index 1ff879e..d625238 100644 --- a/src/main/java/de/torui/coflsky/CoflSky.java +++ b/src/main/java/de/torui/coflsky/CoflSky.java @@ -6,7 +6,6 @@ import java.net.URISyntaxException; import org.lwjgl.input.Keyboard; - import de.torui.coflsky.websocket.WSClientWrapper; import net.minecraft.client.settings.KeyBinding; import net.minecraftforge.client.ClientCommandHandler; @@ -50,6 +49,7 @@ public class CoflSky if(event.getSide() == Side.CLIENT) { ClientCommandHandler.instance.registerCommand(new CoflSkyCommand()); + ClientCommandHandler.instance.registerCommand(new ColfCommand()); for (int i = 0; i < keyBindings.length; ++i) { diff --git a/src/main/java/de/torui/coflsky/ColfCommand.java b/src/main/java/de/torui/coflsky/ColfCommand.java new file mode 100644 index 0000000..85091c2 --- /dev/null +++ b/src/main/java/de/torui/coflsky/ColfCommand.java @@ -0,0 +1,31 @@ +package de.torui.coflsky; + +import net.minecraft.command.CommandBase; +import net.minecraft.command.CommandException; +import net.minecraft.command.ICommandSender; + +public class ColfCommand extends CommandBase{ + + @Override + public int getRequiredPermissionLevel() { + return 0; + } + + @Override + public String getCommandName() { + // TODO Auto-generated method stub + return "colf"; + } + + @Override + public String getCommandUsage(ICommandSender sender) { + // TODO Auto-generated method stub + return "you misspelled /cofl"; + } + + @Override + public void processCommand(ICommandSender sender, String[] args) throws CommandException { + throw new CommandException("you misspelled /cofl"); + } + +} -- cgit