mirror of
https://github.com/IntellectualSites/PlotSquared.git
synced 2024-11-25 22:56:45 +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;
|
return;
|
||||||
}
|
}
|
||||||
for (Block block1 : event.getBlocks()) {
|
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);
|
event.setCancelled(true);
|
||||||
return;
|
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;
|
return;
|
||||||
}
|
}
|
||||||
Plot plot = area.getOwnedPlot(location);
|
Plot plot = area.getOwnedPlot(location);
|
||||||
@ -1559,7 +1567,9 @@ public class PlayerEvents extends PlotListener implements Listener {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
for (Block block1 : event.getBlocks()) {
|
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);
|
event.setCancelled(true);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user