mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-09-05 17:36:12 +00:00
New generic in-memory chunk format, fixed 0.17.0.1 chunk loading
Terrible performance, needs profiling. TODO: fix this.
This commit is contained in:
@ -26,7 +26,6 @@ namespace pocketmine\tile;
|
||||
|
||||
use pocketmine\event\Timings;
|
||||
use pocketmine\level\format\Chunk;
|
||||
use pocketmine\level\format\FullChunk;
|
||||
use pocketmine\level\Level;
|
||||
use pocketmine\level\Position;
|
||||
use pocketmine\nbt\tag\CompoundTag;
|
||||
@ -68,13 +67,13 @@ abstract class Tile extends Position{
|
||||
|
||||
/**
|
||||
* @param string $type
|
||||
* @param FullChunk $chunk
|
||||
* @param Chunk $chunk
|
||||
* @param CompoundTag $nbt
|
||||
* @param $args
|
||||
*
|
||||
* @return Tile
|
||||
*/
|
||||
public static function createTile($type, FullChunk $chunk, CompoundTag $nbt, ...$args){
|
||||
public static function createTile($type, Chunk $chunk, CompoundTag $nbt, ...$args){
|
||||
if(isset(self::$knownTiles[$type])){
|
||||
$class = self::$knownTiles[$type];
|
||||
return new $class($chunk, $nbt, ...$args);
|
||||
@ -108,7 +107,7 @@ abstract class Tile extends Position{
|
||||
return self::$shortNames[static::class];
|
||||
}
|
||||
|
||||
public function __construct(FullChunk $chunk, CompoundTag $nbt){
|
||||
public function __construct(Chunk $chunk, CompoundTag $nbt){
|
||||
assert($chunk !== null and $chunk->getProvider() !== null);
|
||||
|
||||
$this->timings = Timings::getTileEntityTimings($this);
|
||||
@ -163,7 +162,7 @@ abstract class Tile extends Position{
|
||||
if(!$this->closed){
|
||||
$this->closed = true;
|
||||
unset($this->level->updateTiles[$this->id]);
|
||||
if($this->chunk instanceof FullChunk){
|
||||
if($this->chunk instanceof Chunk){
|
||||
$this->chunk->removeTile($this);
|
||||
}
|
||||
if(($level = $this->getLevel()) instanceof Level){
|
||||
|
Reference in New Issue
Block a user