Skip to content

Commit

Permalink
Fix crash related to spawn interdiction
Browse files Browse the repository at this point in the history
  • Loading branch information
malte0811 committed Jan 23, 2024
1 parent 7f6987d commit 70a3daf
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -45,10 +45,10 @@ public static void onEnderTeleport(EntityTeleportEvent.EnderEntity event)
@SubscribeEvent
public static void onEntitySpawnCheck(MobSpawnEvent.FinalizeSpawn event)
{
if(event.getResult()==Event.Result.ALLOW||event.getResult()==Event.Result.DENY||event.getSpawner()!=null)
if(event.isSpawnCancelled()||event.getSpawner()!=null)
return;
if(shouldCancel(event.getEntity()))
event.setResult(Event.Result.DENY);
event.setSpawnCancelled(true);
}

@SubscribeEvent
Expand Down

0 comments on commit 70a3daf

Please sign in to comment.