Skip to content

Commit 555ae93

Browse files
committed
VoidGenerator 0.0.1
1 parent 1d37c79 commit 555ae93

File tree

4 files changed

+47
-14
lines changed

4 files changed

+47
-14
lines changed

plugin.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: PluginTemplate
2-
version: 0.1.0
3-
main: NeiroNetwork\PluginTemplate\Main
1+
name: VoidGenerator
2+
version: 0.0.1
3+
main: NeiroNetwork\VoidGenerator\Main
44
api: 4.0.0

src/NeiroNetwork/PluginTemplate/Main.php

Lines changed: 0 additions & 11 deletions
This file was deleted.
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
<?php
2+
3+
declare(strict_types=1);
4+
5+
namespace NeiroNetwork\VoidGenerator;
6+
7+
use pocketmine\plugin\PluginBase;
8+
use pocketmine\world\generator\GeneratorManager;
9+
10+
class Main extends PluginBase{
11+
12+
protected function onLoad() : void{
13+
GeneratorManager::getInstance()->addGenerator(VoidGenerator::class, "void", fn() => null);
14+
}
15+
}
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
<?php
2+
3+
declare(strict_types=1);
4+
5+
namespace NeiroNetwork\VoidGenerator;
6+
7+
use pocketmine\data\bedrock\BiomeIds;
8+
use pocketmine\world\ChunkManager;
9+
use pocketmine\world\format\BiomeArray;
10+
use pocketmine\world\format\Chunk;
11+
use pocketmine\world\generator\Generator;
12+
13+
class VoidGenerator extends Generator{
14+
15+
private Chunk $chunk;
16+
17+
public function __construct(int $seed, string $preset){
18+
parent::__construct($seed, $preset);
19+
20+
$this->chunk = new Chunk([], BiomeArray::fill(BiomeIds::PLAINS), false);
21+
}
22+
23+
public function generateChunk(ChunkManager $world, int $chunkX, int $chunkZ) : void{
24+
$world->setChunk($chunkX, $chunkZ, clone $this->chunk);
25+
}
26+
27+
public function populateChunk(ChunkManager $world, int $chunkX, int $chunkZ) : void{
28+
}
29+
}

0 commit comments

Comments
 (0)