Fix region contain method

The region contain method was broken.
A lot of subsquent issues are caused by this bug.
E.g. in a selection the entities in the last blocks at the positive-axis border are not selected.

Max block gives the impression of an exclusive point; however it is inclusive!
A position that is anywhere between of a 1x1x1 region, would return false in the old implementation.

By simply adding a one this should solve the problem.

Greetings
This commit is contained in:
Michael 2016-09-13 09:26:23 +02:00 committed by GitHub
parent 34c31dc020
commit 5de4cfced2

View File

@ -336,9 +336,9 @@ public class CuboidRegion extends AbstractRegion implements FlatRegion {
Vector min = getMinimumPoint();
Vector max = getMaximumPoint();
return x >= min.getBlockX() && x <= max.getBlockX()
&& y >= min.getBlockY() && y <= max.getBlockY()
&& z >= min.getBlockZ() && z <= max.getBlockZ();
return x >= min.getBlockX() && x < max.getBlockX() + 1
&& y >= min.getBlockY() && y < max.getBlockY() + 1
&& z >= min.getBlockZ() && z < max.getBlockZ() + 1;
}
@Override