mirror of
https://github.com/plexusorg/Plex-FAWE.git
synced 2025-07-04 12:06:41 +00:00
The /butcher command no longer kills mobs with a name tag.
PR: https://github.com/sk89q/worldedit/pull/292 Conflicts: src/bukkit/java/com/sk89q/worldedit/bukkit/BukkitWorld.java src/main/java/com/sk89q/worldedit/command/BrushCommands.java src/main/java/com/sk89q/worldedit/command/UtilityCommands.java
This commit is contained in:
@ -791,6 +791,7 @@ public class BukkitWorld extends LocalWorld {
|
||||
boolean withLightning = (flags & KillFlags.WITH_LIGHTNING) != 0;
|
||||
boolean killGolems = (flags & KillFlags.GOLEMS) != 0;
|
||||
boolean killAmbient = (flags & KillFlags.AMBIENT) != 0;
|
||||
boolean killTagged = (flags & KillFlags.TAGGED) != 0;
|
||||
|
||||
int num = 0;
|
||||
double radiusSq = radius * radius;
|
||||
@ -822,6 +823,10 @@ public class BukkitWorld extends LocalWorld {
|
||||
continue;
|
||||
}
|
||||
|
||||
if (!killTagged && isTagged(ent)) {
|
||||
continue;
|
||||
}
|
||||
|
||||
if (radius < 0 || bukkitOrigin.distanceSquared(ent.getLocation()) <= radiusSq) {
|
||||
if (withLightning) {
|
||||
world.strikeLightningEffect(ent.getLocation());
|
||||
@ -834,6 +839,10 @@ public class BukkitWorld extends LocalWorld {
|
||||
return num;
|
||||
}
|
||||
|
||||
private static boolean isTagged(LivingEntity ent) {
|
||||
return ent.getCustomName() != null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Remove entities in an area.
|
||||
*
|
||||
|
Reference in New Issue
Block a user