public class Boundary extends Object
This may be compared to vanilla Minecraft's world border.
Modifier and Type | Field and Description |
---|---|
static Boundary |
INFINITE
Represents a
Boundary which extends infinitely along all
dimensions. |
Constructor and Description |
---|
Boundary(Location3D corner1,
Location3D corner2)
Constructs a new
Boundary from the given locations. |
Boundary(Location3D corner1,
Location3D corner2,
boolean ignoreDifferentWorlds)
Deprecated.
As of Flint 1.1, the sanity check is performed regardless of
the boolean flag, rendering it obsolete
|
Modifier and Type | Method and Description |
---|---|
boolean |
contains(Location3D location)
Returns whether this
Boundary contains the given location
(inclusively). |
Location3D |
getLowerBound()
Gets the boundary lowest on all three axes.
|
Location3D |
getUpperBound()
Gets the boundary highest on all three axes.
|
public Boundary(Location3D corner1, Location3D corner2) throws IllegalArgumentException
Boundary
from the given locations. These
locations should represent complimentary corners of a cuboid which will
be contained by the new Boundary
.corner1
- The first corner of the Boundary
corner2
- The second corner of the Boundary
IllegalArgumentException
- If one or both location parameters are
null
, or if the worlds containing the locations do not
match and ignoreDifferentWorlds
is false
@Deprecated public Boundary(Location3D corner1, Location3D corner2, boolean ignoreDifferentWorlds) throws IllegalArgumentException
Boundary
from the given locations. These
locations should represent complimentary corners of a cuboid which will
be contained by the new Boundary
.corner1
- The first corner of the Boundary
corner2
- The second corner of the Boundary
ignoreDifferentWorlds
- Whether to skip a sanity check of whether
the two locations are within the same worldIllegalArgumentException
- If one or both location parameters are
null
, or if the worlds containing the locations do not
match and ignoreDifferentWorlds
is false
public Location3D getLowerBound()
public Location3D getUpperBound()
public boolean contains(Location3D location)
Boundary
contains the given location
(inclusively).
This will always return false if both this Boundary
and the
provided location contain a world, but the worlds do not match.
location
- The Location3D
to check against this
Boundary
Boundary
contains the given location
(inclusively)