mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-05-13 01:09:44 +00:00
Hopper: add more boilerplate code to fix inventory leak
This commit is contained in:
parent
7a05c46ff6
commit
56a4e8c032
@ -60,6 +60,15 @@ class Hopper extends Spawnable implements Container, Nameable{
|
|||||||
$nbt->setInt(self::TAG_TRANSFER_COOLDOWN, $this->transferCooldown);
|
$nbt->setInt(self::TAG_TRANSFER_COOLDOWN, $this->transferCooldown);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function close() : void{
|
||||||
|
if(!$this->closed){
|
||||||
|
$this->inventory->removeAllViewers(true);
|
||||||
|
$this->inventory = null;
|
||||||
|
|
||||||
|
parent::close();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public function getDefaultName() : string{
|
public function getDefaultName() : string{
|
||||||
return "Hopper";
|
return "Hopper";
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user