public abstract class BlockPopulator extends Object
For example, generating glowstone inside the nether or generating dungeons full of treasure
Constructor and Description |
---|
BlockPopulator() |
Modifier and Type | Method and Description |
---|---|
void |
populate(WorldInfo worldInfo,
Random random,
int x,
int z,
LimitedRegion limitedRegion)
Populates an area of blocks at or around the given chunk.
|
void |
populate(World world,
Random random,
Chunk source)
Deprecated.
|
@Deprecated public void populate(@NotNull World world, @NotNull Random random, @NotNull Chunk source)
populate(WorldInfo, Random, int, int, LimitedRegion)
The chunks on each side of the specified chunk must already exist; that is, there must be one north, east, south and west of the specified chunk. The "corner" chunks may not exist, in which scenario the populator should record any changes required for those chunks and perform the changes when they are ready.
world
- The world to generate inrandom
- The random generator to usesource
- The chunk to generate forpublic void populate(@NotNull WorldInfo worldInfo, @NotNull Random random, int x, int z, @NotNull LimitedRegion limitedRegion)
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 LimitedRegion
at a later
point of time.
This method must be completely thread safe and able to handle multiple concurrent callers.
No physics are applied, whether or not it is set to true in
BlockState.update(boolean, boolean)
Only use the BlockState
returned by
LimitedRegion
,
never use methods from a World
to modify the chunk.
worldInfo
- The world info of the world to generate inrandom
- The random generator to usex
- The X-coordinate of the chunkz
- The Z-coordinate of the chunklimitedRegion
- The chunk region to populateCopyright © 2022. All rights reserved.