mirror of
https://github.com/plexusorg/Plex-FAWE.git
synced 2025-06-12 04:23:54 +00:00
Excluded armor stands from //butcher by default.
Someone got lazy and just made armor stands a living entity instead of extracting an ArmorEquippable interface.
This commit is contained in:
@ -22,12 +22,7 @@ package com.sk89q.worldedit.command;
|
||||
import com.sk89q.minecraft.util.commands.Command;
|
||||
import com.sk89q.minecraft.util.commands.CommandContext;
|
||||
import com.sk89q.minecraft.util.commands.CommandPermissions;
|
||||
import com.sk89q.worldedit.EditSession;
|
||||
import com.sk89q.worldedit.LocalConfiguration;
|
||||
import com.sk89q.worldedit.LocalSession;
|
||||
import com.sk89q.worldedit.Vector;
|
||||
import com.sk89q.worldedit.WorldEdit;
|
||||
import com.sk89q.worldedit.WorldEditException;
|
||||
import com.sk89q.worldedit.*;
|
||||
import com.sk89q.worldedit.blocks.BaseBlock;
|
||||
import com.sk89q.worldedit.blocks.BlockID;
|
||||
import com.sk89q.worldedit.command.tool.BrushTool;
|
||||
@ -229,10 +224,10 @@ public class BrushCommands {
|
||||
@Command(
|
||||
aliases = { "butcher", "kill" },
|
||||
usage = "[radius]",
|
||||
flags = "plangbtf",
|
||||
flags = "plangbtfr",
|
||||
desc = "Butcher brush",
|
||||
help = "Kills nearby mobs within the specified radius.\n" +
|
||||
"Flags:" +
|
||||
"Flags:\n" +
|
||||
" -p also kills pets.\n" +
|
||||
" -n also kills NPCs.\n" +
|
||||
" -g also kills Golems.\n" +
|
||||
@ -240,6 +235,7 @@ public class BrushCommands {
|
||||
" -b also kills ambient mobs.\n" +
|
||||
" -t also kills mobs with name tags.\n" +
|
||||
" -f compounds all previous flags.\n" +
|
||||
" -r also destroys armor stands.\n" +
|
||||
" -l currently does nothing.",
|
||||
min = 0,
|
||||
max = 1
|
||||
|
@ -366,11 +366,11 @@ public class UtilityCommands {
|
||||
@Command(
|
||||
aliases = { "butcher" },
|
||||
usage = "[radius]",
|
||||
flags = "plangbtf",
|
||||
flags = "plangbtfr",
|
||||
desc = "Kill all or nearby mobs",
|
||||
help =
|
||||
"Kills nearby mobs, based on radius, if none is given uses default in configuration.\n" +
|
||||
"Flags:" +
|
||||
"Flags:\n" +
|
||||
" -p also kills pets.\n" +
|
||||
" -n also kills NPCs.\n" +
|
||||
" -g also kills Golems.\n" +
|
||||
@ -378,6 +378,7 @@ public class UtilityCommands {
|
||||
" -b also kills ambient mobs.\n" +
|
||||
" -t also kills mobs with name tags.\n" +
|
||||
" -f compounds all previous flags.\n" +
|
||||
" -r also destroys armor stands.\n" +
|
||||
" -l currently does nothing.",
|
||||
min = 0,
|
||||
max = 1
|
||||
|
@ -41,6 +41,7 @@ public class CreatureButcher {
|
||||
public static final int AMBIENT = 1 << 4;
|
||||
public static final int TAGGED = 1 << 5;
|
||||
public static final int FRIENDLY = PETS | NPCS | ANIMALS | GOLEMS | AMBIENT | TAGGED;
|
||||
public static final int ARMOR_STAND = 1 << 6;
|
||||
public static final int WITH_LIGHTNING = 1 << 20;
|
||||
|
||||
private Flags() {
|
||||
@ -74,6 +75,8 @@ public class CreatureButcher {
|
||||
or(Flags.ANIMALS , args.hasFlag('a'), "worldedit.butcher.animals");
|
||||
or(Flags.AMBIENT , args.hasFlag('b'), "worldedit.butcher.ambient");
|
||||
or(Flags.TAGGED , args.hasFlag('t'), "worldedit.butcher.tagged");
|
||||
or(Flags.ARMOR_STAND , args.hasFlag('r'), "worldedit.butcher.armorstands");
|
||||
|
||||
or(Flags.WITH_LIGHTNING, args.hasFlag('l'), "worldedit.butcher.lightning");
|
||||
}
|
||||
|
||||
@ -87,6 +90,7 @@ public class CreatureButcher {
|
||||
boolean killGolems = (flags & Flags.GOLEMS) != 0;
|
||||
boolean killAmbient = (flags & Flags.AMBIENT) != 0;
|
||||
boolean killTagged = (flags & Flags.TAGGED) != 0;
|
||||
boolean killArmorStands = (flags & Flags.ARMOR_STAND) != 0;
|
||||
|
||||
EntityType type = entity.getFacet(EntityType.class);
|
||||
|
||||
@ -126,6 +130,10 @@ public class CreatureButcher {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!killArmorStands && type.isArmorStand()) {
|
||||
return false;
|
||||
}
|
||||
|
||||
entity.remove();
|
||||
return true;
|
||||
}
|
||||
|
@ -148,4 +148,10 @@ public interface EntityType {
|
||||
*/
|
||||
boolean isTagged();
|
||||
|
||||
/**
|
||||
* Test whether the entity is an armor stand.
|
||||
*
|
||||
* @return true if an armor stand
|
||||
*/
|
||||
boolean isArmorStand();
|
||||
}
|
||||
|
Reference in New Issue
Block a user