From ead7acdd76d1aabf7e3680b29b32aef2e4cf0580 Mon Sep 17 00:00:00 2001 From: Jordan Date: Sun, 31 Dec 2023 19:50:29 +0100 Subject: [PATCH] fix: allow pistons on merged plot road if detect-invalid-edge-pistons true (#4257) - fixes #4232 --- .../com/plotsquared/bukkit/listener/BlockEventListener.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/Bukkit/src/main/java/com/plotsquared/bukkit/listener/BlockEventListener.java b/Bukkit/src/main/java/com/plotsquared/bukkit/listener/BlockEventListener.java index 52e8ba623..f2be27c88 100644 --- a/Bukkit/src/main/java/com/plotsquared/bukkit/listener/BlockEventListener.java +++ b/Bukkit/src/main/java/com/plotsquared/bukkit/listener/BlockEventListener.java @@ -261,7 +261,10 @@ public class BlockEventListener implements Listener { final BlockFace facing = piston.getFacing(); location = location.add(facing.getModX(), facing.getModY(), facing.getModZ()); Plot newPlot = area.getOwnedPlotAbs(location); - if (!plot.equals(newPlot)) { + if (plot.equals(newPlot)) { + return; + } + if (!plot.isMerged() || !plot.getConnectedPlots().contains(newPlot)) { event.setCancelled(true); plot.debug("Prevented piston update because of invalid edge piston detection"); }