Blocks under the walls were classed as walls.

Fixes https://github.com/BentoBoxWorld/Greenhouses/issues/77
This commit is contained in:
tastybento 2021-04-08 17:13:32 -07:00
parent 80c985ad7d
commit 7154877f14
1 changed files with 7 additions and 6 deletions

View File

@ -256,11 +256,12 @@ public class Greenhouse implements DataObject {
* @return true if wall or roof block
*/
public boolean isRoofOrWallBlock(Location l) {
return ((l.getBlockY() == getCeilingHeight() - 1)
|| l.getBlockX() == (int)getBoundingBox().getMinX()
|| l.getBlockX() == (int)getBoundingBox().getMaxX() - 1
|| l.getBlockZ() == (int)getBoundingBox().getMinZ()
|| l.getBlockZ() == (int)getBoundingBox().getMaxZ() - 1
);
return (l.getBlockY() > this.getFloorHeight()
&& ((l.getBlockY() == getCeilingHeight() - 1)
|| l.getBlockX() == (int)getBoundingBox().getMinX()
|| l.getBlockX() == (int)getBoundingBox().getMaxX() - 1
|| l.getBlockZ() == (int)getBoundingBox().getMinZ()
|| l.getBlockZ() == (int)getBoundingBox().getMaxZ() - 1
));
}
}