mirror of
https://github.com/CitizensDev/Citizens2.git
synced 2025-02-16 04:11:33 +01:00
Work around some plugins not extending from CraftEntity
This commit is contained in:
parent
fb068c593f
commit
414c82d78f
@ -143,7 +143,7 @@ public class CitizensNPCRegistry implements NPCRegistry {
|
||||
|
||||
@Override
|
||||
public NPC getNPC(Entity entity) {
|
||||
if (entity == null)
|
||||
if (entity == null || !(entity instanceof CraftEntity))
|
||||
return null;
|
||||
net.minecraft.server.Entity handle = ((CraftEntity) entity).getHandle();
|
||||
return handle != null && handle instanceof NPCHolder ? ((NPCHolder) handle).getNPC() : null;
|
||||
|
Loading…
Reference in New Issue
Block a user