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 e3995d9df..0413802e7 100644 --- a/Bukkit/src/main/java/com/plotsquared/bukkit/listener/PaperListener.java +++ b/Bukkit/src/main/java/com/plotsquared/bukkit/listener/PaperListener.java @@ -221,18 +221,24 @@ public class PaperListener implements Listener { } Plot plot = location.getOwnedPlotAbs(); if (plot == null) { + EntityType type = event.getType(); if (!area.isMobSpawning()) { - EntityType type = event.getType(); switch (type) { case DROPPED_ITEM: if (Settings.Enabled_Components.KILL_ROAD_ITEMS) { event.setShouldAbortSpawn(true); event.setCancelled(true); - break; + return; } case PLAYER: return; } + if (type.isAlive()) { + event.setShouldAbortSpawn(true); + event.setCancelled(true); + } + } + if (!area.isMiscSpawnUnowned() && !type.isAlive()) { event.setShouldAbortSpawn(true); event.setCancelled(true); } diff --git a/Bukkit/src/main/java/com/plotsquared/bukkit/listener/PlayerEventListener.java b/Bukkit/src/main/java/com/plotsquared/bukkit/listener/PlayerEventListener.java index 8392591b5..c5bcfd8c9 100644 --- a/Bukkit/src/main/java/com/plotsquared/bukkit/listener/PlayerEventListener.java +++ b/Bukkit/src/main/java/com/plotsquared/bukkit/listener/PlayerEventListener.java @@ -82,6 +82,7 @@ import org.bukkit.FluidCollisionMode; import org.bukkit.Material; import org.bukkit.block.Block; import org.bukkit.block.BlockFace; +import org.bukkit.block.data.Waterlogged; import org.bukkit.command.PluginCommand; import org.bukkit.entity.ArmorStand; import org.bukkit.entity.Entity; @@ -1070,9 +1071,16 @@ public class PlayerEventListener extends PlotListener implements Listener { @EventHandler(priority = EventPriority.HIGHEST, ignoreCancelled = true) public void onBucketEmpty(PlayerBucketEmptyEvent event) { BlockFace bf = event.getBlockFace(); - Block block = - event.getBlockClicked().getLocation().add(bf.getModX(), bf.getModY(), bf.getModZ()) - .getBlock(); + final Block block; + // if the block can be waterlogged, the event might waterlog the block + // sometimes + if (event.getBlockClicked().getBlockData() instanceof Waterlogged) { + block = event.getBlockClicked(); + } else { + block = event.getBlockClicked().getLocation() + .add(bf.getModX(), bf.getModY(), bf.getModZ()) + .getBlock(); + } Location location = BukkitUtil.getLocation(block.getLocation()); PlotArea area = location.getPlotArea(); if (area == null) { diff --git a/Core/src/main/java/com/plotsquared/core/setup/CommonSetupSteps.java b/Core/src/main/java/com/plotsquared/core/setup/CommonSetupSteps.java index 0a8c7ba9a..f2ff58dd2 100644 --- a/Core/src/main/java/com/plotsquared/core/setup/CommonSetupSteps.java +++ b/Core/src/main/java/com/plotsquared/core/setup/CommonSetupSteps.java @@ -282,7 +282,7 @@ public enum CommonSetupSteps implements SetupStep { private static boolean isValidWorldName(String s) { return s.chars().allMatch((i) -> { - return i == 95 || i == 45 || i >= 97 && i <= 122 || i >= 48 && i <= 57 || i == 46; + return i == 95 || i == 45 || i >= 97 && i <= 122 || i >= 65 && i <= 90 || i >= 48 && i <= 57 || i == 46; }); } }