public abstract class ChunkGenerator
extends java.lang.Object
Modifier and Type | Class | Description |
---|---|---|
static interface |
ChunkGenerator.BiomeGrid |
Interface to biome section for chunk to be generated: initialized with
default values for world type and seed.
|
static interface |
ChunkGenerator.ChunkData |
Data for a Chunk.
|
Constructor | Description |
---|---|
ChunkGenerator() |
Modifier and Type | Method | Description |
---|---|---|
boolean |
canSpawn(World world,
int x,
int z) |
Tests if the specified location is valid for a natural spawn position
|
protected ChunkGenerator.ChunkData |
createChunkData(World world) |
Create a ChunkData for a world.
|
ChunkGenerator.ChunkData |
generateChunkData(World world,
java.util.Random random,
int x,
int z,
ChunkGenerator.BiomeGrid biome) |
Shapes the chunk for the given coordinates.
|
java.util.List<BlockPopulator> |
getDefaultPopulators(World world) |
Gets a list of default
BlockPopulator s to apply to a given
world |
Location |
getFixedSpawnLocation(World world,
java.util.Random random) |
Gets a fixed spawn location to use for a given world.
|
public ChunkGenerator.ChunkData generateChunkData(World world, java.util.Random random, int x, int z, ChunkGenerator.BiomeGrid biome)
Notes:
This method should never attempt to get the Chunk at the passed coordinates, as doing so may cause an infinite loop
This method should never modify a ChunkData after it has been returned.
This method must return a ChunkData returned by createChunkData(org.bukkit.World)
world
- The world this chunk will be used forrandom
- The random generator to usex
- The X-coordinate of the chunkz
- The Z-coordinate of the chunkbiome
- Proposed biome values for chunk - can be updated by
generatorprotected final ChunkGenerator.ChunkData createChunkData(World world)
world
- the world the ChunkData is forpublic boolean canSpawn(World world, int x, int z)
world
- The world we're testing onx
- X-coordinate of the block to testz
- Z-coordinate of the block to testpublic java.util.List<BlockPopulator> getDefaultPopulators(World world)
BlockPopulator
s to apply to a given
worldworld
- World to apply topublic Location getFixedSpawnLocation(World world, java.util.Random random)
A null value is returned if a world should not use a fixed spawn point, and will instead attempt to find one randomly.
world
- The world to locate a spawn point forrandom
- Random generator to use in the calculationCopyright © 2018. All rights reserved.