From 98ee2d162b646623a1e04dff165f23ba1e98bf26 Mon Sep 17 00:00:00 2001 From: Pierre Maurice Schwang Date: Tue, 9 Aug 2022 18:50:41 +0200 Subject: [PATCH] chore: de-duplicate check --- .../bukkit/listener/EntitySpawnListener.java | 22 +++++++------------ 1 file changed, 8 insertions(+), 14 deletions(-) diff --git a/Bukkit/src/main/java/com/plotsquared/bukkit/listener/EntitySpawnListener.java b/Bukkit/src/main/java/com/plotsquared/bukkit/listener/EntitySpawnListener.java index caad6393c..841f52970 100644 --- a/Bukkit/src/main/java/com/plotsquared/bukkit/listener/EntitySpawnListener.java +++ b/Bukkit/src/main/java/com/plotsquared/bukkit/listener/EntitySpawnListener.java @@ -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); }