From 4bfc982fdc3d2bbe8cf5ce2f30df9dfe4e9d5459 Mon Sep 17 00:00:00 2001 From: dordsor21 Date: Sun, 3 Dec 2023 14:17:37 +0000 Subject: [PATCH] fix: allow pistons on merged plot road if detect-invalid-edge-pistons true - 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"); }