Fix condition in entityportalevent

This commit is contained in:
fullwall 2020-08-30 17:00:33 +08:00
parent 4b4b0b7803
commit 7d10e25da5

View File

@ -311,7 +311,7 @@ public class EventListen implements Listener {
@EventHandler
public void onEntityPortal(EntityPortalEvent event) {
NPC npc = CitizensAPI.getNPCRegistry().getNPC(event.getEntity());
if (npc == null && event.getEntityType() != EntityType.PLAYER)
if (npc == null || event.getEntityType() != EntityType.PLAYER)
return;
event.setCancelled(true);
npc.despawn(DespawnReason.PENDING_RESPAWN);