mirror of
https://github.com/CitizensDev/Citizens2.git
synced 2024-08-19 20:33:04 +02:00
Work around some plugins not extending from CraftEntity
This commit is contained in:
parent
27f7835305
commit
eb64a43bf3
|
@ -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