mirror of
https://github.com/IntellectualSites/PlotSquared.git
synced 2024-11-22 05:06:44 +01:00
Improve piston interaction with area border
This commit is contained in:
parent
4576cfd961
commit
cfd389883b
@ -1513,11 +1513,19 @@ public class PlayerEvents extends PlotListener implements Listener {
|
||||
return;
|
||||
}
|
||||
for (Block block1 : event.getBlocks()) {
|
||||
if (BukkitUtil.getLocation(block1.getLocation().add(relative)).isPlotArea()) {
|
||||
Location bloc = BukkitUtil.getLocation(block1.getLocation());
|
||||
if (bloc.isPlotArea() || bloc.add(relative.getBlockX(),
|
||||
relative.getBlockY(), relative.getBlockZ()).isPlotArea()) {
|
||||
event.setCancelled(true);
|
||||
return;
|
||||
}
|
||||
}
|
||||
if (location.add(relative.getBlockX(), relative.getBlockY(), relative.getBlockZ())
|
||||
.isPlotArea()) {
|
||||
// Prevent pistons from extending if they are: bordering a plot
|
||||
// area, facing inside plot area, and not pushing any blocks
|
||||
event.setCancelled(true);
|
||||
}
|
||||
return;
|
||||
}
|
||||
Plot plot = area.getOwnedPlot(location);
|
||||
@ -1559,7 +1567,9 @@ public class PlayerEvents extends PlotListener implements Listener {
|
||||
return;
|
||||
}
|
||||
for (Block block1 : event.getBlocks()) {
|
||||
if (BukkitUtil.getLocation(block1.getLocation().add(relative)).isPlotArea()) {
|
||||
Location bloc = BukkitUtil.getLocation(block1.getLocation());
|
||||
if (bloc.isPlotArea() || bloc.add(relative.getBlockX(),
|
||||
relative.getBlockY(), relative.getBlockZ()).isPlotArea()) {
|
||||
event.setCancelled(true);
|
||||
return;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user