diff options
Diffstat (limited to 'src/main/java/com/thatgravyboat/amod/commands')
| -rw-r--r-- | src/main/java/com/thatgravyboat/amod/commands/Commands.java | 31 | ||||
| -rw-r--r-- | src/main/java/com/thatgravyboat/amod/commands/SimpleCommand.java | 60 |
2 files changed, 0 insertions, 91 deletions
diff --git a/src/main/java/com/thatgravyboat/amod/commands/Commands.java b/src/main/java/com/thatgravyboat/amod/commands/Commands.java deleted file mode 100644 index 97188933a..000000000 --- a/src/main/java/com/thatgravyboat/amod/commands/Commands.java +++ /dev/null @@ -1,31 +0,0 @@ -package com.thatgravyboat.amod.commands; - -import at.lorenz.mod.LorenzMod; -import com.thatgravyboat.amod.config.ConfigEditor; -import com.thatgravyboat.amod.core.GuiScreenElementWrapper; -import net.minecraft.command.ICommandSender; -import net.minecraftforge.client.ClientCommandHandler; -import org.apache.commons.lang3.StringUtils; - -public class Commands { - - private static final boolean devMode = false; - - private static final SimpleCommand.ProcessCommandRunnable settingsRunnable = new SimpleCommand.ProcessCommandRunnable() { - public void processCommand(ICommandSender sender, String[] args) { - if (args.length > 0) { - LorenzMod.screenToOpen = new GuiScreenElementWrapper(new ConfigEditor(LorenzMod.feature, StringUtils.join(args, " "))); - } else { - LorenzMod.screenToOpen = new GuiScreenElementWrapper(new ConfigEditor(LorenzMod.feature)); - } - } - }; - - private static final SimpleCommand settingsCommand = new SimpleCommand("lm", settingsRunnable); - private static final SimpleCommand settingsCommand2 = new SimpleCommand("lorenzmod", settingsRunnable); - - public static void init() { - ClientCommandHandler.instance.registerCommand(settingsCommand); - ClientCommandHandler.instance.registerCommand(settingsCommand2); - } -} diff --git a/src/main/java/com/thatgravyboat/amod/commands/SimpleCommand.java b/src/main/java/com/thatgravyboat/amod/commands/SimpleCommand.java deleted file mode 100644 index dc1657976..000000000 --- a/src/main/java/com/thatgravyboat/amod/commands/SimpleCommand.java +++ /dev/null @@ -1,60 +0,0 @@ -package com.thatgravyboat.amod.commands; - -import java.util.List; -import net.minecraft.command.CommandBase; -import net.minecraft.command.ICommandSender; -import net.minecraft.util.BlockPos; - -/** - @author Moulberry - **/ -public class SimpleCommand extends CommandBase { - - private final String commandName; - private final ProcessCommandRunnable runnable; - private TabCompleteRunnable tabRunnable; - - public SimpleCommand(String commandName, ProcessCommandRunnable runnable) { - this.commandName = commandName; - this.runnable = runnable; - } - - public SimpleCommand(String commandName, ProcessCommandRunnable runnable, TabCompleteRunnable tabRunnable) { - this.commandName = commandName; - this.runnable = runnable; - this.tabRunnable = tabRunnable; - } - - public abstract static class ProcessCommandRunnable { - - public abstract void processCommand(ICommandSender sender, String[] args); - } - - public abstract static class TabCompleteRunnable { - - public abstract List<String> tabComplete(ICommandSender sender, String[] args, BlockPos pos); - } - - public boolean canCommandSenderUseCommand(ICommandSender sender) { - return true; - } - - public String getCommandName() { - return commandName; - } - - public String getCommandUsage(ICommandSender sender) { - return "/" + commandName; - } - - @Override - public void processCommand(ICommandSender sender, String[] args) { - runnable.processCommand(sender, args); - } - - @Override - public List<String> addTabCompletionOptions(ICommandSender sender, String[] args, BlockPos pos) { - if (tabRunnable != null) return tabRunnable.tabComplete(sender, args, pos); - return null; - } -} |
