use of com.sk89q.worldedit.command.tool.brush.ButcherBrush in project FastAsyncWorldEdit by IntellectualSites.
the class BrushCommands method butcherBrush.
@Command(name = "butcher", aliases = { "kill" }, desc = "Butcher brush, kills mobs within a radius")
@CommandPermissions("worldedit.brush.butcher")
public void butcherBrush(Player player, LocalSession session, @Arg(desc = "Radius to kill mobs in", def = "5") Expression radius, @Switch(name = 'p', desc = "Also kill pets") boolean killPets, @Switch(name = 'n', desc = "Also kill NPCs") boolean killNpcs, @Switch(name = 'g', desc = "Also kill golems") boolean killGolems, @Switch(name = 'a', desc = "Also kill animals") boolean killAnimals, @Switch(name = 'b', desc = "Also kill ambient mobs") boolean killAmbient, @Switch(name = 't', desc = "Also kill mobs with name tags") boolean killWithName, @Switch(name = 'f', desc = "Also kill all friendly mobs (Applies the flags `-abgnpt`)") boolean killFriendly, @Switch(name = 'r', desc = "Also destroy armor stands") boolean killArmorStands, @Switch(name = 'w', desc = "Also kill water mobs") boolean killWater, InjectedValueAccess context) throws WorldEditException {
worldEdit.checkMaxBrushRadius(radius);
CreatureButcher flags = new CreatureButcher(player);
flags.or(CreatureButcher.Flags.FRIENDLY, killFriendly);
// No permission check here. Flags will instead be filtered by the subsequent calls.
flags.or(CreatureButcher.Flags.PETS, killPets, "worldedit.butcher.pets");
flags.or(CreatureButcher.Flags.NPCS, killNpcs, "worldedit.butcher.npcs");
flags.or(CreatureButcher.Flags.GOLEMS, killGolems, "worldedit.butcher.golems");
flags.or(CreatureButcher.Flags.ANIMALS, killAnimals, "worldedit.butcher.animals");
flags.or(CreatureButcher.Flags.AMBIENT, killAmbient, "worldedit.butcher.ambient");
flags.or(CreatureButcher.Flags.TAGGED, killWithName, "worldedit.butcher.tagged");
flags.or(CreatureButcher.Flags.ARMOR_STAND, killArmorStands, "worldedit.butcher.armorstands");
flags.or(CreatureButcher.Flags.WATER, killWater, "worldedit.butcher.water");
set(context, new ButcherBrush(flags), "worldedit.brush.butcher").setSize(radius);
}
Aggregations