chore: check in PaperListener for consistency

This commit is contained in:
Pierre Maurice Schwang 2022-08-09 18:52:33 +02:00
parent 98ee2d162b
commit 10d140b33c

View File

@ -229,17 +229,17 @@ public class PaperListener implements Listener {
Plot plot = location.getOwnedPlotAbs(); Plot plot = location.getOwnedPlotAbs();
if (plot == null) { if (plot == null) {
EntityType type = event.getType(); EntityType type = event.getType();
if (!area.isMobSpawning()) { // PreCreatureSpawnEvent **should** not be called for DROPPED_ITEM, just for the sake of consistency
if (type == EntityType.PLAYER) {
return;
}
if (type == EntityType.DROPPED_ITEM) { if (type == EntityType.DROPPED_ITEM) {
if (Settings.Enabled_Components.KILL_ROAD_ITEMS) { if (Settings.Enabled_Components.KILL_ROAD_ITEMS) {
event.setShouldAbortSpawn(true);
event.setCancelled(true); event.setCancelled(true);
} }
return; return;
} }
if (!area.isMobSpawning()) {
if (type == EntityType.PLAYER) {
return;
}
if (type.isAlive()) { if (type.isAlive()) {
event.setShouldAbortSpawn(true); event.setShouldAbortSpawn(true);
event.setCancelled(true); event.setCancelled(true);