use of com.builtbroken.mc.core.commands.ext.SubCommandRegion in project Engine by VoltzEngine-Project.
the class CommandRegion method handleEntityPlayerCommand.
@Override
public boolean handleEntityPlayerCommand(EntityPlayer player, String[] args) {
if (args.length > 0) {
String name = args[0];
Region region = RegionManager.getControllerForWorld(player.worldObj).getRegion(name);
if (region != null) {
if (args.length > 1) {
for (AbstractCommand command : subCommands) {
if (command instanceof SubCommandRegion && command.getCommandName().equalsIgnoreCase(args[1])) {
if (((SubCommandRegion) command).handle(player, region, removeFront(args, 2))) {
return true;
}
}
}
}
player.addChatMessage(new ChatComponentText("Unknown region sub command"));
} else {
player.addChatMessage(new ChatComponentText("Unknown region"));
}
} else {
player.addChatMessage(new ChatComponentText("Missing region name"));
}
return true;
}
Aggregations