Пример #1
0
 public function __construct(FullChunk $chunk, Compound $nbt)
 {
     parent::__construct($chunk, $nbt);
     $this->inventory = new FurnaceInventory($this);
     if (!isset($this->namedtag->Items) or !$this->namedtag->Items instanceof Enum) {
         $this->namedtag->Items = new Enum("Items", []);
         $this->namedtag->Items->setTagType(NBT::TAG_Compound);
     }
     for ($i = 0; $i < $this->getSize(); ++$i) {
         $this->inventory->setItem($i, $this->getItem($i));
     }
     if (!isset($this->namedtag->BurnTime) or $this->namedtag["BurnTime"] < 0) {
         $this->namedtag->BurnTime = new Short("BurnTime", 0);
     }
     if (!isset($this->namedtag->CookTime) or $this->namedtag["CookTime"] < 0 or $this->namedtag["BurnTime"] === 0 and $this->namedtag["CookTime"] > 0) {
         $this->namedtag->CookTime = new Short("CookTime", 0);
     }
     if (!isset($this->namedtag->MaxTime)) {
         $this->namedtag->MaxTime = new Short("BurnTime", $this->namedtag["BurnTime"]);
         $this->namedtag->BurnTicks = new Short("BurnTicks", 0);
     }
     if ($this->namedtag["BurnTime"] > 0) {
         $this->scheduleUpdate();
     }
 }