mirror of
https://github.com/TotalFreedomMC/TF-PlotSquared.git
synced 2024-12-23 00:15:06 +00:00
Improve piston interaction with area border
This commit is contained in:
parent
4576cfd961
commit
cfd389883b
1 changed files with 12 additions and 2 deletions
|
@ -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 a new issue