Fix off-by-one in area calculation.

Even the volume calculation had it correct.
Also fix code style in contains.
This commit is contained in:
Wizjany 2018-01-21 00:31:47 -05:00 committed by GitHub
parent 0f72811bfc
commit 3a332fd87d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -139,8 +139,8 @@ public RegionType getType() {
Area toArea() {
int x = getMinimumPoint().getBlockX();
int z = getMinimumPoint().getBlockZ();
int width = getMaximumPoint().getBlockX() - x;
int height = getMaximumPoint().getBlockZ() - z;
int width = getMaximumPoint().getBlockX() - x + 1;
int height = getMaximumPoint().getBlockZ() - z + 1;
return new Area(new Rectangle(x, z, width, height));
}