mirror of
https://github.com/CitizensDev/Citizens2.git
synced 2025-01-06 16:37:37 +01:00
Fix spout compat
This commit is contained in:
parent
4696f27825
commit
b096dcfd8b
@ -37,6 +37,7 @@ import net.citizensnpcs.npc.entity.CitizensWolfNPC;
|
|||||||
import net.citizensnpcs.npc.entity.CitizensZombieNPC;
|
import net.citizensnpcs.npc.entity.CitizensZombieNPC;
|
||||||
import net.citizensnpcs.util.ByIdArray;
|
import net.citizensnpcs.util.ByIdArray;
|
||||||
|
|
||||||
|
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;
|
||||||
|
|
||||||
@ -144,7 +145,10 @@ public class CitizensNPCRegistry implements NPCRegistry {
|
|||||||
public NPC getNPC(Entity entity) {
|
public NPC getNPC(Entity entity) {
|
||||||
if (entity == null)
|
if (entity == null)
|
||||||
return null;
|
return null;
|
||||||
return entity instanceof NPCHolder ? ((NPCHolder) entity).getNPC() : null;
|
if (entity instanceof NPCHolder)
|
||||||
|
return ((NPCHolder) entity).getNPC();
|
||||||
|
net.minecraft.server.Entity handle = ((CraftEntity) entity).getHandle();
|
||||||
|
return handle instanceof NPCHolder ? ((NPCHolder) handle).getNPC() : null;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
Loading…
Reference in New Issue
Block a user