File tree Expand file tree Collapse file tree 4 files changed +47
-14
lines changed
Expand file tree Collapse file tree 4 files changed +47
-14
lines changed Original file line number Diff line number Diff line change 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
44api : 4.0.0
Load Diff This file was deleted.
Original file line number Diff line number Diff line change 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+ }
Original file line number Diff line number Diff line change 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+ }
You can’t perform that action at this time.
0 commit comments