mirror of
https://github.com/plexusorg/Plex-FAWE.git
synced 2024-12-23 01:37:37 +00:00
CuboidRegion contains use block position
Int casting would be better here than adding one to the max block
This commit is contained in:
parent
5de4cfced2
commit
6c65a8a989
@ -329,16 +329,16 @@ public class CuboidRegion extends AbstractRegion implements FlatRegion {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean contains(Vector position) {
|
public boolean contains(Vector position) {
|
||||||
double x = position.getX();
|
int x = position.getBlockX();
|
||||||
double y = position.getY();
|
int y = position.getBlockY();
|
||||||
double z = position.getZ();
|
int z = position.getBlockZ();
|
||||||
|
|
||||||
Vector min = getMinimumPoint();
|
Vector min = getMinimumPoint();
|
||||||
Vector max = getMaximumPoint();
|
Vector max = getMaximumPoint();
|
||||||
|
|
||||||
return x >= min.getBlockX() && x < max.getBlockX() + 1
|
return x >= min.getBlockX() && x <= max.getBlockX()
|
||||||
&& y >= min.getBlockY() && y < max.getBlockY() + 1
|
&& y >= min.getBlockY() && y <= max.getBlockY()
|
||||||
&& z >= min.getBlockZ() && z < max.getBlockZ() + 1;
|
&& z >= min.getBlockZ() && z <= max.getBlockZ();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
Loading…
Reference in New Issue
Block a user