Skip to content

Commit

Permalink
Fixes #92
Browse files Browse the repository at this point in the history
A world check was not being done in the overlap check.
  • Loading branch information
tastybento committed Dec 30, 2022
1 parent 1f0b579 commit 1975df2
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,9 @@ public boolean isAboveGreenhouse(Location location) {
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);

}
Expand Down

0 comments on commit 1975df2

Please sign in to comment.