From 10d140b33c891d3cc8e97d4659d816f978e794b6 Mon Sep 17 00:00:00 2001 From: Pierre Maurice Schwang Date: Tue, 9 Aug 2022 18:52:33 +0200 Subject: [PATCH] chore: check in PaperListener for consistency --- .../plotsquared/bukkit/listener/PaperListener.java | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/Bukkit/src/main/java/com/plotsquared/bukkit/listener/PaperListener.java b/Bukkit/src/main/java/com/plotsquared/bukkit/listener/PaperListener.java index a2609fb23..9e3d9ba8e 100644 --- a/Bukkit/src/main/java/com/plotsquared/bukkit/listener/PaperListener.java +++ b/Bukkit/src/main/java/com/plotsquared/bukkit/listener/PaperListener.java @@ -229,17 +229,17 @@ public class PaperListener implements Listener { Plot plot = location.getOwnedPlotAbs(); if (plot == null) { EntityType type = event.getType(); + // PreCreatureSpawnEvent **should** not be called for DROPPED_ITEM, just for the sake of consistency + 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 == EntityType.DROPPED_ITEM) { - if (Settings.Enabled_Components.KILL_ROAD_ITEMS) { - event.setShouldAbortSpawn(true); - event.setCancelled(true); - } - return; - } if (type.isAlive()) { event.setShouldAbortSpawn(true); event.setCancelled(true);