use of WayofTime.alchemicalWizardry.api.command.ISubCommand in project BloodMagic by WayofTime.
the class CommandBloodMagic method processCommand.
@Override
public void processCommand(ICommandSender commandSender, String[] args) {
if (args.length > 0 && subCommands.containsKey(args[0])) {
ISubCommand subCommand = subCommands.get(args[0]);
String[] subArgs = Arrays.copyOfRange(args, 1, args.length);
if (subCommand.canSenderUseSubCommand(commandSender))
subCommand.processSubCommand(commandSender, subArgs);
else
commandSender.addChatMessage(new ChatComponentTranslation("commands.error.perm").setChatStyle(new ChatStyle().setColor(EnumChatFormatting.RED)));
} else {
commandSender.addChatMessage(new ChatComponentTranslation("commands.error.unknown").setChatStyle(new ChatStyle().setColor(EnumChatFormatting.RED)));
}
}
Aggregations