mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-04-22 00:33:59 +00:00
Convert Populator into an interface
This commit is contained in:
parent
c7f78bec15
commit
938e430b0f
@ -32,7 +32,7 @@ use pocketmine\world\ChunkManager;
|
||||
use function count;
|
||||
use function min;
|
||||
|
||||
class GroundCover extends Populator{
|
||||
class GroundCover implements Populator{
|
||||
|
||||
public function populate(ChunkManager $world, int $chunkX, int $chunkZ, Random $random) : void{
|
||||
$chunk = $world->getChunk($chunkX, $chunkZ);
|
||||
|
@ -28,7 +28,7 @@ use pocketmine\world\ChunkManager;
|
||||
use pocketmine\world\generator\object\Ore as ObjectOre;
|
||||
use pocketmine\world\generator\object\OreType;
|
||||
|
||||
class Ore extends Populator{
|
||||
class Ore implements Populator{
|
||||
/** @var OreType[] */
|
||||
private $oreTypes = [];
|
||||
|
||||
|
@ -24,12 +24,13 @@ declare(strict_types=1);
|
||||
/**
|
||||
* All the Object populator classes
|
||||
*/
|
||||
|
||||
namespace pocketmine\world\generator\populator;
|
||||
|
||||
use pocketmine\utils\Random;
|
||||
use pocketmine\world\ChunkManager;
|
||||
|
||||
abstract class Populator{
|
||||
interface Populator{
|
||||
|
||||
abstract public function populate(ChunkManager $world, int $chunkX, int $chunkZ, Random $random) : void;
|
||||
public function populate(ChunkManager $world, int $chunkX, int $chunkZ, Random $random) : void;
|
||||
}
|
||||
|
@ -28,7 +28,7 @@ use pocketmine\block\VanillaBlocks;
|
||||
use pocketmine\utils\Random;
|
||||
use pocketmine\world\ChunkManager;
|
||||
|
||||
class TallGrass extends Populator{
|
||||
class TallGrass implements Populator{
|
||||
/** @var int */
|
||||
private $randomAmount = 1;
|
||||
/** @var int */
|
||||
|
@ -29,7 +29,7 @@ use pocketmine\utils\Random;
|
||||
use pocketmine\world\ChunkManager;
|
||||
use pocketmine\world\generator\object\TreeFactory;
|
||||
|
||||
class Tree extends Populator{
|
||||
class Tree implements Populator{
|
||||
/** @var int */
|
||||
private $randomAmount = 1;
|
||||
/** @var int */
|
||||
|
Loading…
x
Reference in New Issue
Block a user