fix: allow pistons on merged plot road if detect-invalid-edge-pistons true (#4257)

- fixes #4232
This commit is contained in:
Jordan 2023-12-31 19:50:29 +01:00 committed by GitHub
parent 1991142d48
commit ead7acdd76
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

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