-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
ed9ff4c
commit 9de17ae
Showing
4 changed files
with
47 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
name: WorldsX | ||
version: 0.0.1 | ||
api: 4.0.0 | ||
main: blackjack200\worldsx\WorldsX | ||
author: Blackjack200 | ||
website: https://github.com/Blackjack200/WorldsX.git |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
<?php | ||
|
||
namespace blackjack200\worldsx; | ||
|
||
use blackjack200\worldsx\generator\VoidGenerator; | ||
use pocketmine\plugin\PluginBase; | ||
use pocketmine\world\generator\GeneratorManager; | ||
|
||
class WorldsX extends PluginBase { | ||
protected function onEnable() : void { | ||
GeneratorManager::getInstance()->addGenerator(VoidGenerator::class, "void", fn() => null); | ||
} | ||
|
||
protected function onDisable() : void { | ||
|
||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
<?php | ||
|
||
namespace blackjack200\worldsx\generator; | ||
|
||
use pocketmine\block\VanillaBlocks; | ||
use pocketmine\world\ChunkManager; | ||
use pocketmine\world\format\Chunk; | ||
use pocketmine\world\generator\Generator; | ||
|
||
class VoidGenerator extends Generator { | ||
public function generateChunk(ChunkManager $world, int $chunkX, int $chunkZ) : void { | ||
//We don't know world spawn position so use PM4 default one. | ||
$spawnChunkPos = 256 >> Chunk::COORD_BIT_SIZE; | ||
if ($chunkX === $spawnChunkPos && $chunkZ === $spawnChunkPos) { | ||
$world->getChunk($chunkX, $chunkZ)->setFullBlock(0, 64, 0, VanillaBlocks::BEDROCK()->getFullId()); | ||
} | ||
} | ||
|
||
public function populateChunk(ChunkManager $world, int $chunkX, int $chunkZ) : void { | ||
|
||
} | ||
} |