fix: allow pistons on merged plot road if detect-invalid-edge-pistons true

- fixes #4232
This commit is contained in:
dordsor21 2023-12-03 14:17:37 +00:00
parent 1a18adcd95
commit 4bfc982fdc
No known key found for this signature in database
GPG Key ID: 1E53E88969FFCF0B

View File

@ -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");
}