Package de.rasmusantons.cubiomes
Class Cubiomes
java.lang.Object
de.rasmusantons.cubiomes.Cubiomes
Biome Generation
-
Nested Class Summary
Nested Classes -
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidInitializes the generator for a given dimension and seed.booleancheckForBiomes(Range r, Dimension dim, long seed, BiomeFilter filter) Starts to generate the specified range and checks if the biomes meet the requirements of the biome filter.BiomeID[][][]Generates the biomes for a cuboidal scaled range given by 'r'.BiomeID[][]genBiomes2D(Range r) Same asgenBiomes(Range), except that the y-size needs to be 1.getBiomeAt(int scale, int x, int y, int z) Gets the biome for a specified scaled position.getStructurePos(StructureType structureType, long seed, int regX, int regZ) Finds the block position of the structure generation attempt in a given region.booleanisViableStructurePos(StructureType structType, int blockX, int blockZ) Performs a biome check near the specified block coordinates to determine whether a structure of the given type could spawn there.
-
Field Details
-
generator
-
-
Constructor Details
-
Cubiomes
-
Cubiomes
-
-
Method Details
-
applySeed
Initializes the generator for a given dimension and seed. -
getBiomeAt
Gets the biome for a specified scaled position. Note that the scale should be either 1 or 4, for block or biome coordinates respectively.Before calling,
applySeed(Dimension, long)should be used to set dimension and seed.- Returns:
BiomeID.noneupon failure
-
genBiomes
Generates the biomes for a cuboidal scaled range given by 'r'.- Returns:
- A 3-dimensional array of
BiomeIDs or null upon failure. The output can be indexed as output[y][z][x] where (x,y,z) is a relative position inside the range cuboid.
-
genBiomes2D
Same asgenBiomes(Range), except that the y-size needs to be 1.- Returns:
- A 2-dimensional array of
BiomeIDs or null upon failure. The output can be indexed as output[z][x] where (x,0,z) is a relative position inside the range cuboid. - Throws:
InvalidParameterException- if r.sy is not 1.
-
getStructurePos
Finds the block position of the structure generation attempt in a given region. You can useisViableStructurePos(StructureType, int, int)to test if the necessary biome requirements are met for the structure to actually generate at that position. Some structure types may fail to produce a valid position in the given region regardless of biomes, in which case the function returns null.- Parameters:
structureType- structure typeseed- world seed (only the lower 48-bits are relevant)regX- x coordinate of the region (the region size depends on type)regZ- z coordinate of the region (the region size depends on type)- Returns:
- the block position of the structure
-
isViableStructurePos
Performs a biome check near the specified block coordinates to determine whether a structure of the given type could spawn there. You can get the block positions usinggetStructurePos(StructureType, long, int, int).Before calling,
applySeed(Dimension, long)should be used to set dimension and seed. -
checkForBiomes
Starts to generate the specified range and checks if the biomes meet the requirements of the biome filter.The generator should be set up for the correct version, however the dimension and seed will be applied internally. This will modify the generator into a partially initialized state that is not valid to use outside this function without re-applying a seed.
-