From 98e8476a88a163ddb96aac6995bf854e470d8959 Mon Sep 17 00:00:00 2001 From: dordsor21 Date: Wed, 6 Jan 2021 21:56:26 +0000 Subject: [PATCH] Bring v5 entity spawn changes to v6 --- .../plotsquared/bukkit/listener/EntitySpawnListener.java | 9 ++++++--- 1 file changed, 6 insertions(+), 3 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 4e0bdebc3..9e5f2d373 100644 --- a/Bukkit/src/main/java/com/plotsquared/bukkit/listener/EntitySpawnListener.java +++ b/Bukkit/src/main/java/com/plotsquared/bukkit/listener/EntitySpawnListener.java @@ -131,21 +131,24 @@ public class EntitySpawnListener implements Listener { } Plot plot = location.getOwnedPlotAbs(); if (plot == null) { + EntityType type = entity.getType(); if (!area.isMobSpawning()) { - EntityType type = entity.getType(); switch (type) { case DROPPED_ITEM: if (Settings.Enabled_Components.KILL_ROAD_ITEMS) { event.setCancelled(true); - break; + return; } case PLAYER: return; } - if (type.isAlive() || !area.isMiscSpawnUnowned()) { + if (type.isAlive()) { event.setCancelled(true); } } + if (!area.isMiscSpawnUnowned() && !type.isAlive()) { + event.setCancelled(true); + } return; } if (Settings.Done.RESTRICT_BUILDING && DoneFlag.isDone(plot)) {