Exemplo n.º 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();
     }
 }
Exemplo n.º 2
0
 public function __construct(FullChunk $chunk, Compound $nbt)
 {
     if (!isset($nbt->SkullType)) {
         $nbt->SkullType = new String("SkullType", 0);
     }
     parent::__construct($chunk, $nbt);
 }
Exemplo n.º 3
0
 public function __construct(FullChunk $chunk, Compound $nbt)
 {
     if (!isset($nbt->item)) {
         $nbt->item = new Short("item", 0);
     }
     if (!isset($nbt->data)) {
         $nbt->data = new Int("data", 0);
     }
     parent::__construct($chunk, $nbt);
 }
Exemplo n.º 4
0
 public function __construct(FullChunk $chunk, Compound $nbt)
 {
     parent::__construct($chunk, $nbt);
     $this->inventory = new ChestInventory($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));
     }
 }
Exemplo n.º 5
0
 public function __construct(FullChunk $chunk, Compound $nbt)
 {
     if (!isset($nbt->Text1)) {
         $nbt->Text1 = new String("Text1", "");
     }
     if (!isset($nbt->Text2)) {
         $nbt->Text2 = new String("Text2", "");
     }
     if (!isset($nbt->Text3)) {
         $nbt->Text3 = new String("Text3", "");
     }
     if (!isset($nbt->Text4)) {
         $nbt->Text4 = new String("Text4", "");
     }
     parent::__construct($chunk, $nbt);
 }