Fixed blockCreatureSpawn not working.

This commit is contained in:
Matthew Miller 2018-09-26 15:03:30 +10:00
parent 87e5770405
commit 01dfebe531

View File

@ -632,7 +632,9 @@ public void onCreatureSpawn(CreatureSpawnEvent event) {
EntityType entityType = event.getEntityType(); 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); event.setCancelled(true);
return; return;
} }
@ -649,7 +651,6 @@ public void onCreatureSpawn(CreatureSpawnEvent event) {
} }
Set<com.sk89q.worldedit.world.entity.EntityType> entityTypes = set.queryValue(null, Flags.DENY_SPAWN); 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)) { if (entityTypes != null && weEntityType != null && entityTypes.contains(weEntityType)) {
event.setCancelled(true); event.setCancelled(true);
return; return;