35 public function __construct(
int $seed,
string $preset){
36 parent::__construct($seed, $preset);
39 public function generateChunk(
ChunkManager $world,
int $chunkX,
int $chunkZ) :
void{
40 $chunk =
new Chunk([],
false);
42 $biomeArray =
new PalettedBlockArray(BiomeIds::PLAINS);
43 foreach($chunk->getSubChunks() as $y => $subChunk){
44 $chunk->setSubChunk($y,
new SubChunk(Block::EMPTY_STATE_ID, [], clone $biomeArray));
47 $stoneState = VanillaBlocks::STONE()->getStateId();
48 $cobbleState = VanillaBlocks::COBBLESTONE()->getStateId();
50 for($x = 0; $x < Chunk::EDGE_LENGTH; $x++){
51 for($z = 0; $z < Chunk::EDGE_LENGTH; $z++){
52 $worldX = ($chunkX * Chunk::EDGE_LENGTH) + $x;
53 $worldZ = ($chunkZ * Chunk::EDGE_LENGTH) + $z;
55 if($worldX >= -16 && $worldX <= 16 && $worldZ >= -16 && $worldZ <= 16){
56 $chunk->setBlockStateId($x, -64, $z, ($worldX === 0 && $worldZ === 0) ? $cobbleState : $stoneState);
60 $world->setChunk($chunkX, $chunkZ, $chunk);
63 public function populateChunk(
ChunkManager $world,
int $chunkX,
int $chunkZ) :
void{