Debug commands

Not fully tested. The ones tested do work, though.
This commit is contained in:
Nick 2016-03-14 19:00:03 -07:00
parent a3b7001d55
commit d9e9a4704a
9 changed files with 644 additions and 4 deletions

View file

@ -0,0 +1,38 @@
package WayofTime.bloodmagic.command.sub;
import WayofTime.bloodmagic.command.CommandBloodMagic;
import WayofTime.bloodmagic.command.ISubCommand;
import WayofTime.bloodmagic.command.SubCommandBase;
import WayofTime.bloodmagic.util.helper.TextHelper;
import net.minecraft.command.ICommand;
import net.minecraft.command.ICommandSender;
import net.minecraft.util.ChatComponentText;
import net.minecraft.util.StatCollector;
public class SubCommandHelp extends SubCommandBase {
public SubCommandHelp(ICommand parent) {
super(parent, "help");
}
@Override
public String getArgUsage(ICommandSender commandSender) {
return StatCollector.translateToLocal("commands.help.usage");
}
@Override
public String getHelpText() {
return StatCollector.translateToLocal("commands.help.help");
}
@Override
public void processSubCommand(ICommandSender commandSender, String[] args) {
super.processSubCommand(commandSender, args);
if (args.length > 0)
return;
for (ISubCommand subCommand : ((CommandBloodMagic)getParentCommand()).getSubCommands().values())
commandSender.addChatMessage(new ChatComponentText(TextHelper.localizeEffect("commands.format.help", capitalizeFirstLetter(subCommand.getSubCommandName()), subCommand.getArgUsage(commandSender))));
}
}