mirror of
https://github.com/IntellectualSites/PlotSquared.git
synced 2024-11-25 22:56:45 +01:00
Also consider negative locations when cancelling liquid flow
This commit is contained in:
parent
c7de9379ad
commit
6be26e8047
@ -1434,9 +1434,27 @@ import java.util.regex.Pattern;
|
||||
event.setCancelled(true);
|
||||
} else if (event.getBlock().isLiquid()) {
|
||||
final org.bukkit.Location location = event.getBlock().getLocation();
|
||||
if (BukkitUtil.getPlot(location.clone().add(0, 0, 1)) != null ||
|
||||
BukkitUtil.getPlot(location.clone().add(1, 0, 0)) != null ||
|
||||
BukkitUtil.getPlot(location.clone().add(1, 0, 1)) != null) {
|
||||
|
||||
/*
|
||||
X = block location
|
||||
A-H = potential plot locations
|
||||
|
||||
Z
|
||||
^
|
||||
| A B C
|
||||
o D X E
|
||||
| F G H
|
||||
v
|
||||
<-----O-----> x
|
||||
*/
|
||||
if (BukkitUtil.getPlot(location.clone().add(-1, 0, 1) /* A */ ) != null ||
|
||||
BukkitUtil.getPlot(location.clone().add(1, 0, 0) /* B */ ) != null ||
|
||||
BukkitUtil.getPlot(location.clone().add(1, 0, 1) /* C */ ) != null ||
|
||||
BukkitUtil.getPlot(location.clone().add(-1, 0, 0) /* D */ ) != null ||
|
||||
BukkitUtil.getPlot(location.clone().add(1, 0, 0) /* E */ ) != null ||
|
||||
BukkitUtil.getPlot(location.clone().add(-1, 0, -1) /* F */ ) != null ||
|
||||
BukkitUtil.getPlot(location.clone().add(0, 0, -1) /* G */ ) != null ||
|
||||
BukkitUtil.getPlot(location.clone().add(1, 0, 1) /* H */ ) != null) {
|
||||
event.setCancelled(true);
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user