A world check was not being done in the overlap check.
This commit is contained in:
tastybento 2022-12-29 19:33:59 -08:00
parent 1f0b579d5a
commit 1975df2732
1 changed files with 3 additions and 1 deletions

View File

@ -107,7 +107,9 @@ public class GreenhouseMap {
private boolean isOverlapping(Greenhouse greenhouse) {
return greenhouse.getLocation() != null && addon.getIslands().getIslandAt(greenhouse.getLocation()).map(i -> {
greenhouses.putIfAbsent(i, new ArrayList<>());
return greenhouses.get(i).stream().anyMatch(g -> g.getBoundingBox().overlaps(greenhouse.getBoundingBox()));
return greenhouses.get(i).stream().anyMatch(g ->
g.getLocation().getWorld().equals(greenhouse.getLocation().getWorld()) &&
g.getBoundingBox().overlaps(greenhouse.getBoundingBox()));
}).orElse(false);
}