mirror of
https://github.com/CitizensDev/Citizens2.git
synced 2025-02-19 13:51:42 +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
|
@Override
|
||||||
public NPC getNPC(Entity entity) {
|
public NPC getNPC(Entity entity) {
|
||||||
if (entity == null)
|
if (entity == null || !(entity instanceof CraftEntity))
|
||||||
return null;
|
return null;
|
||||||
net.minecraft.server.Entity handle = ((CraftEntity) entity).getHandle();
|
net.minecraft.server.Entity handle = ((CraftEntity) entity).getHandle();
|
||||||
return handle != null && handle instanceof NPCHolder ? ((NPCHolder) handle).getNPC() : null;
|
return handle != null && handle instanceof NPCHolder ? ((NPCHolder) handle).getNPC() : null;
|
||||||
|
Loading…
Reference in New Issue
Block a user