Make Tile constructors non-dependent on NBT

This commit is contained in:
Dylan K. Taylor
2018-11-30 17:05:36 +00:00
parent a2253e9e7d
commit 16006f9175
4 changed files with 18 additions and 26 deletions

View File

@ -33,7 +33,6 @@ use pocketmine\inventory\InventoryEventProcessor;
use pocketmine\inventory\InventoryHolder;
use pocketmine\item\Item;
use pocketmine\item\ItemFactory;
use pocketmine\level\Level;
use pocketmine\nbt\tag\CompoundTag;
use pocketmine\network\mcpe\protocol\ContainerSetDataPacket;
@ -56,13 +55,6 @@ class Furnace extends Spawnable implements InventoryHolder, Container, Nameable{
/** @var int */
private $maxTime;
public function __construct(Level $level, CompoundTag $nbt){
parent::__construct($level, $nbt);
if($this->burnTime > 0){
$this->scheduleUpdate();
}
}
protected function readSaveData(CompoundTag $nbt) : void{
$this->burnTime = max(0, $nbt->getShort(self::TAG_BURN_TIME, 0, true));