Skip to content

Commit

Permalink
Fixed blockCreatureSpawn not working.
Browse files Browse the repository at this point in the history
  • Loading branch information
me4502 committed Sep 26, 2018
1 parent 87e5770 commit 01dfebe
Showing 1 changed file with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -632,7 +632,9 @@ public void onCreatureSpawn(CreatureSpawnEvent event) {

EntityType entityType = event.getEntityType();

if (wcfg.blockCreatureSpawn.contains(entityType)) {
com.sk89q.worldedit.world.entity.EntityType weEntityType = BukkitAdapter.adapt(entityType);

if (weEntityType != null && wcfg.blockCreatureSpawn.contains(weEntityType)) {
event.setCancelled(true);
return;
}
Expand All @@ -649,7 +651,6 @@ public void onCreatureSpawn(CreatureSpawnEvent event) {
}

Set<com.sk89q.worldedit.world.entity.EntityType> entityTypes = set.queryValue(null, Flags.DENY_SPAWN);
com.sk89q.worldedit.world.entity.EntityType weEntityType = BukkitAdapter.adapt(entityType);
if (entityTypes != null && weEntityType != null && entityTypes.contains(weEntityType)) {
event.setCancelled(true);
return;
Expand Down

0 comments on commit 01dfebe

Please sign in to comment.