public function saveNBT() { $this->namedtag->Items = new Enum("Items", []); $this->namedtag->Items->setTagType(NBT::TAG_Compound); for ($index = 0; $index < $this->getSize(); ++$index) { $this->setItem($index, $this->inventory->getItem($index)); } }
public function getItem($index) { return $index < $this->left->getSize() ? $this->left->getItem($index) : $this->right->getItem($index - $this->right->getSize()); }