36 private const TAG_TRANSFER_COOLDOWN =
"TransferCooldown";
39 private int $transferCooldown = 0;
42 parent::__construct($world, $pos);
46 public function readSaveData(
CompoundTag $nbt) :
void{
47 $this->loadItems($nbt);
48 $this->loadName($nbt);
50 $this->transferCooldown = $nbt->getInt(self::TAG_TRANSFER_COOLDOWN, 0);
54 $this->saveItems($nbt);
55 $this->saveName($nbt);
57 $nbt->
setInt(self::TAG_TRANSFER_COOLDOWN, $this->transferCooldown);
60 public function close() : void{
62 $this->inventory->removeAllViewers();
68 public function getDefaultName() : string{
72 public function getInventory() : HopperInventory{
73 return $this->inventory;
76 public function getRealInventory() : HopperInventory{
77 return $this->inventory;