mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-07-11 04:17:48 +00:00
Fixed crash when chests are closed with viewers
This commit is contained in:
parent
705e4da789
commit
cc2555bb88
@ -58,6 +58,19 @@ class Chest extends Spawnable implements InventoryHolder, Container{
|
|||||||
$this->checkPairing();
|
$this->checkPairing();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function close(){
|
||||||
|
if($this->closed === false){
|
||||||
|
foreach($this->getInventory()->getViewers() as $player){
|
||||||
|
$this->getInventory()->close($player);
|
||||||
|
}
|
||||||
|
|
||||||
|
foreach($this->getRealInventory()->getViewers() as $player){
|
||||||
|
$this->getRealInventory()->close($player);
|
||||||
|
}
|
||||||
|
parent::close();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public function saveNBT(){
|
public function saveNBT(){
|
||||||
$this->namedtag->Items = new Enum("Items", []);
|
$this->namedtag->Items = new Enum("Items", []);
|
||||||
$this->namedtag->Items->setTagType(NBT::TAG_Compound);
|
$this->namedtag->Items->setTagType(NBT::TAG_Compound);
|
||||||
|
@ -67,6 +67,15 @@ class Furnace extends Tile implements InventoryHolder, Container{
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function close(){
|
||||||
|
if($this->closed === false){
|
||||||
|
foreach($this->getInventory()->getViewers() as $player){
|
||||||
|
$this->getInventory()->close($player);
|
||||||
|
}
|
||||||
|
parent::close();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public function saveNBT(){
|
public function saveNBT(){
|
||||||
$this->namedtag->Items = new Enum("Inventory", []);
|
$this->namedtag->Items = new Enum("Inventory", []);
|
||||||
$this->namedtag->Items->setTagType(NBT::TAG_Compound);
|
$this->namedtag->Items->setTagType(NBT::TAG_Compound);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user