Skip to content

Commit

Permalink
init commit
Browse files Browse the repository at this point in the history
  • Loading branch information
Blackjack200 committed Jan 30, 2022
1 parent ed9ff4c commit 9de17ae
Show file tree
Hide file tree
Showing 4 changed files with 47 additions and 0 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,5 @@ composer.phar
# Commit your application's lock file https://getcomposer.org/doc/01-basic-usage.md#commit-your-composer-lock-file-to-version-control
# You may choose to ignore a library lock file http://getcomposer.org/doc/02-libraries.md#lock-file
# composer.lock
.idea
.DS_Store
6 changes: 6 additions & 0 deletions plugin.yml
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
17 changes: 17 additions & 0 deletions src/blackjack200/worldsx/WorldsX.php
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 {

}
}
22 changes: 22 additions & 0 deletions src/blackjack200/worldsx/generator/VoidGenerator.php
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 {

}
}

0 comments on commit 9de17ae

Please sign in to comment.