public interface BiomeArea
Some methods accept a pair of two ints, representing the x and z location
of a biome. Some other methods accept or return a Vector2i
. The
y position of this vector is equal to the z position of a biome in the
world.
Modifier and Type | Method and Description |
---|---|
boolean |
containsBiome(int x,
int z)
Returns true if the biome area contains a biome at the specified
position.
|
boolean |
containsBiome(com.flowpowered.math.vector.Vector2i position)
Returns true if the biome area contains a biome at the specified
position.
|
BiomeType |
getBiome(int x,
int z)
Gets the
BiomeType at the given location. |
BiomeType |
getBiome(com.flowpowered.math.vector.Vector2i position)
Get an object representing the biome at the given position.
|
MutableBiomeArea |
getBiomeCopy()
Returns a mutable copy of the biomes stored in this area.
|
MutableBiomeArea |
getBiomeCopy(StorageType type)
Returns a mutable copy of the biomes stored in this area.
|
com.flowpowered.math.vector.Vector2i |
getBiomeMax()
Gets the biome location with the highest x and y that is still a valid
position for
getBiome(Vector2i) . |
com.flowpowered.math.vector.Vector2i |
getBiomeMin()
Gets the biome location with the lowest x and y that is still a valid
position for
getBiome(Vector2i) . |
com.flowpowered.math.vector.Vector2i |
getBiomeSize()
Gets the size of the area.
|
BiomeArea |
getBiomeView(DiscreteTransform2 transform)
Returns a new area that is viewed through some transformation.
|
BiomeArea |
getBiomeView(com.flowpowered.math.vector.Vector2i newMin,
com.flowpowered.math.vector.Vector2i newMax)
Returns a new area that is the same or smaller than the current area.
|
ImmutableBiomeArea |
getImmutableBiomeCopy()
Returns an immutable copy of the biomes stored in this area.
|
BiomeArea |
getRelativeBiomeView()
Returns a new area that is translated so that
getBiomeMin() returns Vector2i.ZERO . |
UnmodifiableBiomeArea |
getUnmodifiableBiomeView()
Returns a new area that cannot be modified through this view.
|
com.flowpowered.math.vector.Vector2i getBiomeMin()
getBiome(Vector2i)
.com.flowpowered.math.vector.Vector2i getBiomeMax()
getBiome(Vector2i)
.com.flowpowered.math.vector.Vector2i getBiomeSize()
getBiomeMax()
-
getBiomeMin()
+ (1, 1)
.boolean containsBiome(com.flowpowered.math.vector.Vector2i position)
{getBiomeMin()
<=
position <= getBiomeMax()
position
- The position to checkboolean containsBiome(int x, int z)
{getBiomeMin()
<=
(x, z) <= getBiomeMax()
x
- The X coordinate to checkz
- The Z coordinate to checkBiomeType getBiome(com.flowpowered.math.vector.Vector2i position)
position
- The positionPositionOutOfBoundsException
- If the position is outside of the
bounds of the areaBiomeType getBiome(int x, int z)
BiomeType
at the given location.x
- The X positionz
- The Z positionPositionOutOfBoundsException
- If the position is outside of the
bounds of the areaBiomeArea getBiomeView(com.flowpowered.math.vector.Vector2i newMin, com.flowpowered.math.vector.Vector2i newMax)
newMin
- The new minimum coordinates in this areanewMax
- The new maximum coordinates in this areaPositionOutOfBoundsException
- If the new minimum and maximum
are outside the current areaBiomeArea getBiomeView(DiscreteTransform2 transform)
transform
- The transformation to be appliedBiomeArea getRelativeBiomeView()
getBiomeMin()
returns Vector2i.ZERO
.
This does not copy the biomes, it only provides a new view of the
storage.UnmodifiableBiomeArea getUnmodifiableBiomeView()
MutableBiomeArea getBiomeCopy()
StorageType.STANDARD
.MutableBiomeArea getBiomeCopy(StorageType type)
type
- The type of storage used by the new biomesImmutableBiomeArea getImmutableBiomeCopy()