geforkt von Mirrors/FastAsyncWorldEdit
Fixes #910
Dieser Commit ist enthalten in:
Ursprung
0a721b18ce
Commit
af987016fc
@ -20,6 +20,7 @@
|
||||
package com.sk89q.worldedit.bukkit;
|
||||
|
||||
import com.sk89q.worldedit.entity.metadata.EntityProperties;
|
||||
import org.bukkit.entity.AbstractVillager;
|
||||
import org.bukkit.entity.Ambient;
|
||||
import org.bukkit.entity.Animals;
|
||||
import org.bukkit.entity.ArmorStand;
|
||||
@ -47,6 +48,19 @@ import static com.google.common.base.Preconditions.checkNotNull;
|
||||
|
||||
class BukkitEntityProperties implements EntityProperties {
|
||||
|
||||
private static final boolean HAS_ABSTRACT_VILLAGER;
|
||||
|
||||
static {
|
||||
boolean temp;
|
||||
try {
|
||||
Class.forName("org.bukkit.entity.AbstractVillager");
|
||||
temp = true;
|
||||
} catch (ClassNotFoundException e) {
|
||||
temp = false;
|
||||
}
|
||||
HAS_ABSTRACT_VILLAGER = temp;
|
||||
}
|
||||
|
||||
private final Entity entity;
|
||||
|
||||
BukkitEntityProperties(Entity entity) {
|
||||
@ -121,6 +135,9 @@ class BukkitEntityProperties implements EntityProperties {
|
||||
|
||||
@Override
|
||||
public boolean isNPC() {
|
||||
if (HAS_ABSTRACT_VILLAGER) {
|
||||
return entity instanceof AbstractVillager;
|
||||
}
|
||||
return entity instanceof Villager;
|
||||
}
|
||||
|
||||
|
Laden…
In neuem Issue referenzieren
Einen Benutzer sperren