mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-10-18 12:04:46 +00:00
Added BlockMetadataStore to Level and Block
This commit is contained in:
@@ -41,6 +41,7 @@ use pocketmine\level\generator\populator\Populator;
|
||||
use pocketmine\math\AxisAlignedBB;
|
||||
use pocketmine\math\Vector2;
|
||||
use pocketmine\math\Vector3;
|
||||
use pocketmine\metadata\BlockMetadataStore;
|
||||
use pocketmine\metadata\Metadatable;
|
||||
use pocketmine\metadata\MetadataValue;
|
||||
use pocketmine\nbt\tag\Byte;
|
||||
@@ -67,11 +68,6 @@ class Level implements ChunkManager, Metadatable{
|
||||
|
||||
private static $levelIdCounter = 1;
|
||||
|
||||
/** @var Generator */
|
||||
private $generator;
|
||||
/** @var Populator[] */
|
||||
private $populators;
|
||||
|
||||
|
||||
const BLOCK_UPDATE_NORMAL = 1;
|
||||
const BLOCK_UPDATE_RANDOM = 2;
|
||||
@@ -121,6 +117,9 @@ class Level implements ChunkManager, Metadatable{
|
||||
|
||||
private $autoSave = true;
|
||||
|
||||
/** @var BlockMetadataStore */
|
||||
private $blockMetadata;
|
||||
|
||||
/**
|
||||
* Returns the chunk unique hash/key
|
||||
*
|
||||
@@ -151,6 +150,7 @@ class Level implements ChunkManager, Metadatable{
|
||||
*/
|
||||
public function __construct(Server $server, $name, $path, $provider){
|
||||
$this->levelId = static::$levelIdCounter++;
|
||||
$this->blockMetadata = new BlockMetadataStore($this);
|
||||
$this->server = $server;
|
||||
if(is_subclass_of($provider, "pocketmine\\level\\format\\LevelProvider", true)){
|
||||
$this->provider = new $provider($this, $path);
|
||||
@@ -168,6 +168,13 @@ class Level implements ChunkManager, Metadatable{
|
||||
$this->nextSave = microtime(true) + 90;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return BlockMetadataStore
|
||||
*/
|
||||
public function getBlockMetadata(){
|
||||
return $this->blockMetadata;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return Server
|
||||
*/
|
||||
|
Reference in New Issue
Block a user