예제 #1
0
 public function __construct(FullChunk $chunk, CompoundTag $nbt)
 {
     parent::__construct($chunk, $nbt);
     $this->inventory = new HopperInventory($this);
     if (!isset($this->namedtag->Items) or !$this->namedtag->Items instanceof ListTag) {
         $this->namedtag->Items = new ListTag("Items", []);
         $this->namedtag->Items->setTagType(NBT::TAG_Compound);
     }
     for ($i = 0; $i < $this->getSize(); ++$i) {
         $this->inventory->setItem($i, $this->getItem($i));
     }
     $this->scheduleUpdate();
 }
예제 #2
0
 public function __construct(FullChunk $chunk, Compound $nbt)
 {
     parent::__construct($chunk, $nbt);
     $this->inventory = new HopperInventory($this);
     if (!isset($this->namedtag->Items) or !$this->namedtag->Items instanceof ListTag) {
         $this->namedtag->Items = new ListTag("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["TransferCooldown"] < 0) {
         $this->namedtag->BurnTime = new IntTag("TransferCooldown", 0);
     }
     if ($this->namedtag["TransferCooldown"] > 0) {
         $this->scheduleUpdate();
     }
 }