mirror of
https://github.com/CitizensDev/Citizens2.git
synced 2024-12-01 07:03:34 +01:00
Ignore non-living entities
This commit is contained in:
parent
433c438398
commit
c8415740dc
@ -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