mirror of
https://github.com/IntellectualSites/PlotSquared.git
synced 2024-11-21 12:46:46 +01:00
Check proper locations on PortalCreateEvent (#3834)
check proper locations on PortalCreateEvent
This commit is contained in:
parent
caef3a923b
commit
49b19e0eaf
@ -1756,11 +1756,11 @@ public class PlayerEventListener implements Listener {
|
|||||||
maxZ = Math.max(state.getZ(), maxZ);
|
maxZ = Math.max(state.getZ(), maxZ);
|
||||||
}
|
}
|
||||||
int y = event.getBlocks().get(0).getY(); // Don't need to worry about this too much
|
int y = event.getBlocks().get(0).getY(); // Don't need to worry about this too much
|
||||||
for (Location location : Set.of( // Use Set to lazily avoid duplicate locations
|
for (Location location : List.of( // We don't care about duplicate locations
|
||||||
Location.at(world, minX, y, maxX),
|
Location.at(world, minX, y, minZ),
|
||||||
Location.at(world, minZ, y, maxZ),
|
|
||||||
Location.at(world, minX, y, maxZ),
|
Location.at(world, minX, y, maxZ),
|
||||||
Location.at(world, minZ, y, maxX)
|
Location.at(world, maxX, y, minZ),
|
||||||
|
Location.at(world, maxX, y, maxZ)
|
||||||
)) {
|
)) {
|
||||||
PlotArea area = location.getPlotArea();
|
PlotArea area = location.getPlotArea();
|
||||||
if (area == null) {
|
if (area == null) {
|
||||||
|
Loading…
Reference in New Issue
Block a user