chore: de-duplicate check

This commit is contained in:
Pierre Maurice Schwang 2022-08-09 18:50:41 +02:00
parent 62fac61c4d
commit 98ee2d162b

View File

@ -126,26 +126,20 @@ public class EntitySpawnListener implements Listener {
Plot plot = location.getOwnedPlotAbs();
EntityType type = entity.getType();
if (plot == null) {
if (!area.isMobSpawning()) {
if (type == EntityType.PLAYER) {
return;
}
if (type == EntityType.DROPPED_ITEM) {
if (Settings.Enabled_Components.KILL_ROAD_ITEMS) {
event.setCancelled(true);
}
return;
}
if (type.isAlive()) {
event.setCancelled(true);
}
}
if (type == EntityType.DROPPED_ITEM) {
if (Settings.Enabled_Components.KILL_ROAD_ITEMS) {
event.setCancelled(true);
}
return;
}
if (!area.isMobSpawning()) {
if (type == EntityType.PLAYER) {
return;
}
if (type.isAlive()) {
event.setCancelled(true);
}
}
if (!area.isMiscSpawnUnowned() && !type.isAlive()) {
event.setCancelled(true);
}