Tile: make ContainerTrait and NameableTrait non-dependent on context-retained NBT

This commit is contained in:
Dylan K. Taylor
2018-06-03 16:32:05 +01:00
parent 7b7917939a
commit b1cb63ebd6
6 changed files with 53 additions and 30 deletions

View File

@ -23,9 +23,22 @@ declare(strict_types=1);
namespace pocketmine\tile;
use pocketmine\level\Level;
use pocketmine\nbt\tag\CompoundTag;
class EnchantTable extends Spawnable implements Nameable{
use NameableTrait;
public function __construct(Level $level, CompoundTag $nbt){
$this->loadName($nbt);
parent::__construct($level, $nbt);
}
public function saveNBT() : void{
parent::saveNBT();
$this->saveName($this->namedtag);
}
/**
* @return string
*/