Merge a9f68eb351
into c65c9e7827
This commit is contained in:
commit
c31f864b17
|
@ -868,6 +868,13 @@ public class BlockEventListener implements Listener {
|
|||
return;
|
||||
}
|
||||
}
|
||||
if (block.getType() == Material.MOVING_PISTON
|
||||
&& event.getBlocks().isEmpty()
|
||||
&& location.add(relative.getBlockX(), relative.getBlockY(), relative.getBlockZ()).isPlotArea()) {
|
||||
// Headless sticky pistons can delete the block in front of them
|
||||
// when retracting. Prevent this.
|
||||
event.setCancelled(true);
|
||||
}
|
||||
return;
|
||||
}
|
||||
Plot plot = area.getOwnedPlot(location);
|
||||
|
@ -891,6 +898,13 @@ public class BlockEventListener implements Listener {
|
|||
return;
|
||||
}
|
||||
}
|
||||
if (block.getType() == Material.MOVING_PISTON
|
||||
&& event.getBlocks().isEmpty()
|
||||
&& !plot.equals(area.getOwnedPlot(location.add(relative.getBlockX(), relative.getBlockY(), relative.getBlockZ())))) {
|
||||
// Headless sticky pistons can delete the block in front of them
|
||||
// when retracting. Prevent this.
|
||||
event.setCancelled(true);
|
||||
}
|
||||
}
|
||||
|
||||
@EventHandler(priority = EventPriority.HIGHEST, ignoreCancelled = true)
|
||||
|
|
Loading…
Reference in New Issue