From c5d5b52df4f64d18f5ed2fd8a8ee82a8374469b2 Mon Sep 17 00:00:00 2001 From: Jesse Boyd Date: Thu, 8 Feb 2018 19:42:36 +1100 Subject: [PATCH] Tweak item drop check --- .../bukkit/listeners/EntitySpawnListener.java | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/Bukkit/src/main/java/com/plotsquared/bukkit/listeners/EntitySpawnListener.java b/Bukkit/src/main/java/com/plotsquared/bukkit/listeners/EntitySpawnListener.java index 1d609af3b..a61e260d3 100644 --- a/Bukkit/src/main/java/com/plotsquared/bukkit/listeners/EntitySpawnListener.java +++ b/Bukkit/src/main/java/com/plotsquared/bukkit/listeners/EntitySpawnListener.java @@ -8,6 +8,7 @@ import com.intellectualcrafters.plot.object.Plot; import com.intellectualcrafters.plot.object.PlotArea; import com.plotsquared.bukkit.util.BukkitUtil; import org.bukkit.entity.Entity; +import org.bukkit.entity.EntityType; import org.bukkit.event.EventHandler; import org.bukkit.event.EventPriority; import org.bukkit.event.Listener; @@ -27,7 +28,16 @@ public class EntitySpawnListener implements Listener { Plot plot = area.getOwnedPlotAbs(location); if (plot == null) { if (!area.MOB_SPAWNING) { - if (event.getEntityType().isAlive() || !area.MISC_SPAWN_UNOWNED) { + EntityType type = entity.getType(); + switch (type) { + case DROPPED_ITEM: + if (Settings.Enabled_Components.KILL_ROAD_MOBS) { + break; + } + case PLAYER: + return; + } + if (type.isAlive() || !area.MISC_SPAWN_UNOWNED) { event.setCancelled(true); } }