Mirror von
https://github.com/IntellectualSites/FastAsyncWorldEdit.git
synchronisiert 2024-11-12 22:20:08 +01:00
Temporary solution to fix Golems being butchered. This includes Iron and snow golems.
Dieser Commit ist enthalten in:
Ursprung
d82111a4fc
Commit
b2eb2741eb
@ -39,6 +39,7 @@ public abstract class LocalWorld {
|
|||||||
public static final int PETS = 1 << 0;
|
public static final int PETS = 1 << 0;
|
||||||
public static final int NPCS = 1 << 1;
|
public static final int NPCS = 1 << 1;
|
||||||
public static final int ANIMALS = 1 << 2;
|
public static final int ANIMALS = 1 << 2;
|
||||||
|
public static final int GOLEMS = 1 << 3;
|
||||||
public static final int WITH_LIGHTNING = 1 << 20;
|
public static final int WITH_LIGHTNING = 1 << 20;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -475,6 +475,7 @@ public class BukkitWorld extends LocalWorld {
|
|||||||
boolean killNPCs = (flags & KillFlags.NPCS) != 0;
|
boolean killNPCs = (flags & KillFlags.NPCS) != 0;
|
||||||
boolean killAnimals = (flags & KillFlags.ANIMALS) != 0;
|
boolean killAnimals = (flags & KillFlags.ANIMALS) != 0;
|
||||||
boolean withLightning = (flags & KillFlags.WITH_LIGHTNING) != 0;
|
boolean withLightning = (flags & KillFlags.WITH_LIGHTNING) != 0;
|
||||||
|
boolean killGolems = (flags & KillFlags.GOLEMS) != 0;
|
||||||
|
|
||||||
int num = 0;
|
int num = 0;
|
||||||
double radiusSq = radius * radius;
|
double radiusSq = radius * radius;
|
||||||
@ -494,6 +495,13 @@ public class BukkitWorld extends LocalWorld {
|
|||||||
continue; // tamed wolf
|
continue; // tamed wolf
|
||||||
}
|
}
|
||||||
|
|
||||||
|
try {
|
||||||
|
// Temporary solution to fix Golems being butchered.
|
||||||
|
if (!killGolems && Class.forName("org.bukkit.entity.Golem").isAssignableFrom(ent.getClass())) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
} catch (ClassNotFoundException e) {}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
// Temporary solution until org.bukkit.entity.NPC is widely deployed.
|
// Temporary solution until org.bukkit.entity.NPC is widely deployed.
|
||||||
if (!killNPCs && Class.forName("org.bukkit.entity.NPC").isAssignableFrom(ent.getClass())) {
|
if (!killNPCs && Class.forName("org.bukkit.entity.NPC").isAssignableFrom(ent.getClass())) {
|
||||||
|
@ -346,13 +346,14 @@ public class UtilityCommands {
|
|||||||
@Command(
|
@Command(
|
||||||
aliases = { "butcher" },
|
aliases = { "butcher" },
|
||||||
usage = "[radius]",
|
usage = "[radius]",
|
||||||
flags = "plan",
|
flags = "plang",
|
||||||
desc = "Kill all or nearby mobs",
|
desc = "Kill all or nearby mobs",
|
||||||
help =
|
help =
|
||||||
"Kills nearby mobs, based on radius, if none is given uses default in configuration.\n" +
|
"Kills nearby mobs, based on radius, if none is given uses default in configuration.\n" +
|
||||||
"Flags:" +
|
"Flags:" +
|
||||||
" -p also kills pets.\n" +
|
" -p also kills pets.\n" +
|
||||||
" -n also kills NPCs.\n" +
|
" -n also kills NPCs.\n" +
|
||||||
|
" -g also kills Golems.\n" +
|
||||||
" -a also kills animals.\n" +
|
" -a also kills animals.\n" +
|
||||||
" -l strikes lightning on each killed mob.",
|
" -l strikes lightning on each killed mob.",
|
||||||
min = 0,
|
min = 0,
|
||||||
@ -383,6 +384,10 @@ public class UtilityCommands {
|
|||||||
if (player.hasPermission("worldedit.butcher.npcs") && (args.hasFlag('n'))) {
|
if (player.hasPermission("worldedit.butcher.npcs") && (args.hasFlag('n'))) {
|
||||||
flags |= KillFlags.NPCS;
|
flags |= KillFlags.NPCS;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (player.hasPermission("worldedit.butcher.golems") && (args.hasFlag('g'))) {
|
||||||
|
flags |= KillFlags.GOLEMS;
|
||||||
|
}
|
||||||
|
|
||||||
if (player.hasPermission("worldedit.butcher.animals") && (args.hasFlag('a'))) {
|
if (player.hasPermission("worldedit.butcher.animals") && (args.hasFlag('a'))) {
|
||||||
flags |= KillFlags.ANIMALS;
|
flags |= KillFlags.ANIMALS;
|
||||||
|
Laden…
In neuem Issue referenzieren
Einen Benutzer sperren