mirror of
https://github.com/CitizensDev/Citizens2.git
synced 2024-11-22 18:45:29 +01:00
Ignore non-living entities
This commit is contained in:
parent
f405d4cb7d
commit
a975b9ebf5
@ -21,6 +21,7 @@ import org.bukkit.Bukkit;
|
|||||||
import org.bukkit.craftbukkit.entity.CraftEntity;
|
import org.bukkit.craftbukkit.entity.CraftEntity;
|
||||||
import org.bukkit.entity.Entity;
|
import org.bukkit.entity.Entity;
|
||||||
import org.bukkit.entity.EntityType;
|
import org.bukkit.entity.EntityType;
|
||||||
|
import org.bukkit.entity.LivingEntity;
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
import org.bukkit.metadata.FixedMetadataValue;
|
import org.bukkit.metadata.FixedMetadataValue;
|
||||||
import org.bukkit.metadata.MetadataValue;
|
import org.bukkit.metadata.MetadataValue;
|
||||||
@ -71,6 +72,8 @@ public class CitizensNPCManager implements NPCManager {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public NPC getNPC(Entity entity) {
|
public NPC getNPC(Entity entity) {
|
||||||
|
if (!(entity instanceof LivingEntity))
|
||||||
|
return null;
|
||||||
net.minecraft.server.Entity handle = ((CraftEntity) entity).getHandle();
|
net.minecraft.server.Entity handle = ((CraftEntity) entity).getHandle();
|
||||||
if (handle instanceof NPCHandle)
|
if (handle instanceof NPCHandle)
|
||||||
return ((NPCHandle) handle).getNPC();
|
return ((NPCHandle) handle).getNPC();
|
||||||
|
Loading…
Reference in New Issue
Block a user