@ParametersAreNonnullByDefault
@MethodsReturnNonnullByDefault
public interface ICubeGenerator
| Modifier and Type | Interface and Description |
|---|---|
static class |
ICubeGenerator.GeneratorReadyState |
| Modifier and Type | Field and Description |
|---|---|
static Box |
NO_REQUIREMENT |
static Box |
RECOMMENDED_FULL_POPULATOR_REQUIREMENT |
static Box |
RECOMMENDED_GENERATE_POPULATOR_REQUIREMENT |
| Modifier and Type | Method and Description |
|---|---|
void |
generateColumn(net.minecraft.world.chunk.Chunk column)
Generate column-global information such as biome data
|
CubePrimer |
generateCube(int cubeX,
int cubeY,
int cubeZ)
Deprecated.
generators are advised to implement
generateCube(int, int, int, CubePrimer) |
default CubePrimer |
generateCube(int cubeX,
int cubeY,
int cubeZ,
CubePrimer primer)
Generate a new cube
|
net.minecraft.util.math.BlockPos |
getClosestStructure(java.lang.String name,
net.minecraft.util.math.BlockPos pos,
boolean findUnexplored)
Gets the closest structure with name
name. |
Box |
getFullPopulationRequirements(ICube cube)
Get the bounding box defining a range of cubes whose population contributes to
cube being fully
populated. |
Box |
getPopulationPregenerationRequirements(ICube cube)
Get the Box will all the cubes that populating this cube will affect this cube.
|
java.util.List<net.minecraft.world.biome.Biome.SpawnListEntry> |
getPossibleCreatures(net.minecraft.entity.EnumCreatureType type,
net.minecraft.util.math.BlockPos pos)
Retrieve a list of creature classes eligible for spawning at the specified location.
|
default ICubeGenerator.GeneratorReadyState |
pollAsyncColumnGenerator(int chunkX,
int chunkZ)
Checks whether the generator is ready to generate a given column.
|
default ICubeGenerator.GeneratorReadyState |
pollAsyncCubeGenerator(int cubeX,
int cubeY,
int cubeZ)
Checks whether the generator is ready to generate a given cube.
|
default ICubeGenerator.GeneratorReadyState |
pollAsyncCubePopulator(int cubeX,
int cubeY,
int cubeZ)
Checks whether the generator is ready to generate a given column.
|
void |
populate(ICube cube)
Populate a cube with multi-block structures that can cross cube boundaries such as trees and ore veins.
|
void |
recreateStructures(net.minecraft.world.chunk.Chunk column)
Called to reload structures that apply to
column. |
void |
recreateStructures(ICube cube)
Called to reload structures that apply to
cube. |
default boolean |
supportsConcurrentColumnGeneration() |
default boolean |
supportsConcurrentCubeGeneration() |
default java.util.Optional<net.minecraft.world.chunk.Chunk> |
tryGenerateColumn(net.minecraft.world.World world,
int columnX,
int columnZ,
net.minecraft.world.chunk.ChunkPrimer primer,
boolean forceGenerate) |
default java.util.Optional<CubePrimer> |
tryGenerateCube(int cubeX,
int cubeY,
int cubeZ,
CubePrimer primer,
boolean forceGenerate) |
static final Box RECOMMENDED_FULL_POPULATOR_REQUIREMENT
static final Box RECOMMENDED_GENERATE_POPULATOR_REQUIREMENT
static final Box NO_REQUIREMENT
@Deprecated CubePrimer generateCube(int cubeX, int cubeY, int cubeZ)
generateCube(int, int, int, CubePrimer)cubeX - the cube's X coordinatecubeY - the cube's Y coordinatecubeZ - the cube's Z coordinatedefault CubePrimer generateCube(int cubeX, int cubeY, int cubeZ, CubePrimer primer)
cubeX - the cube's X coordinatecubeY - the cube's Y coordinatecubeZ - the cube's Z coordinateprimer - a CubePrimer which may be used for generating the new cube. Note that generators are allowed to return an
arbitrary CubePrimer, this parameter is simply a hint to help reduce allocations. However, if a different
primer is to be returned, the given primer's state must remain unmodified.void generateColumn(net.minecraft.world.chunk.Chunk column)
column - the target columnvoid populate(ICube cube)
getFullPopulationRequirements(ICube) would does include cube.
Note: Unlike vanilla this method will NEVER cause recursive generation, thus the area that it populates is not as strict.
Generation should still be restricted as the player might see something generate in a chunk they have already been sentcube - the cube to populatedefault java.util.Optional<CubePrimer> tryGenerateCube(int cubeX, int cubeY, int cubeZ, CubePrimer primer, boolean forceGenerate)
default java.util.Optional<net.minecraft.world.chunk.Chunk> tryGenerateColumn(net.minecraft.world.World world,
int columnX,
int columnZ,
net.minecraft.world.chunk.ChunkPrimer primer,
boolean forceGenerate)
default boolean supportsConcurrentCubeGeneration()
default boolean supportsConcurrentColumnGeneration()
default ICubeGenerator.GeneratorReadyState pollAsyncCubeGenerator(int cubeX, int cubeY, int cubeZ)
cubeX - X coordinate of the cubecubeY - Y coordinate of the cubecubeZ - Z coordinate of the cubedefault ICubeGenerator.GeneratorReadyState pollAsyncColumnGenerator(int chunkX, int chunkZ)
chunkX - X coordinate of the columnchunkZ - Z coordinate of the columndefault ICubeGenerator.GeneratorReadyState pollAsyncCubePopulator(int cubeX, int cubeY, int cubeZ)
cubeX - X coordinate of the cubecubeY - Y coordinate of the cubecubeZ - Z coordinate of the cubeBox getFullPopulationRequirements(ICube cube)
cube being fully
populated. The requested cubes will all be generated and populated when the cube that they affect needs to be fully populated.
Consider the following example: A call to some implementation of
populate(ICube) populates a 16x16x16 block area in a 2x2x2 area of cubes around the center.
Shown: Which cubes affect the current cube (marked with dots), and their corresponding areas of population. +----------+----------+ . . The chunk provided as a parameter | | . . . . .| . . to this method (getFullPopulationRequirements). | | . . . . .| | #####|#####. . .| x x The chunk provided as a parameter | #####|#####. . .| x x to populate() +----------+----------+ | x x #####|##### | ### The area being populated by 'x' | x x #####|##### | ### | x x x x x| | | x x x x x| | +----------+----------+ +----------+----------+ . . The chunk provided as a parameter | | . . . . .| . . to this method (getFullPopulationRequirements). | | . . . . .| | | . . #####| x x The chunk provided as a parameter | | . . #####| x x to populate() +----------+----------+ | | x x #####| ### The area being populated by 'x' | | x x #####| ### | | x x x x x| | | x x x x x| +----------+----------+ +----------+----------+ . . The chunk provided as a parameter | x x #####|#####. . .| . . to this method (getFullPopulationRequirements). | x x #####|#####. . .| | x x x x x| . . . . .| x x The chunk provided as a parameter | x x x x x| . . . . .| x x to populate() +----------+----------+ | | | ### The area being populated by 'x' | | | ### | | | | | | +----------+----------+This method would return
{(-1,-1,-1), (0, 0, 0)}, indicating that populate calls to all cubes in
that area write to this cube.cube - The target cubecubeBox getPopulationPregenerationRequirements(ICube cube)
cube - The target cubevoid recreateStructures(ICube cube)
cube. Mostly used to prepare calls to
getPossibleCreatures(EnumCreatureType, BlockPos) cube - The cube being loadedfor the 2D-equivalent of this methodvoid recreateStructures(net.minecraft.world.chunk.Chunk column)
column. Mostly used to prepare calls to
getPossibleCreatures(EnumCreatureType, BlockPos) column - The column being loadedfor the 3D-equivalent of this methodjava.util.List<net.minecraft.world.biome.Biome.SpawnListEntry> getPossibleCreatures(net.minecraft.entity.EnumCreatureType type,
net.minecraft.util.math.BlockPos pos)
type - the creature type that we are interested in spawningpos - the position we want to spawn creatures at@Nullable
net.minecraft.util.math.BlockPos getClosestStructure(java.lang.String name,
net.minecraft.util.math.BlockPos pos,
boolean findUnexplored)
name. This is primarily used when an eye of ender is trying to find
a stronghold.name - the name of the structurepos - find the structure closest to this positionfindUnexplored - true if should also find not yet generated structuresnull if none could be found