mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-06-12 14:35:35 +00:00
Always evacuate the crafting grid on close, no matter whether it's big or not
otherwise items will get deleted and people will cry
This commit is contained in:
parent
8dc3d019f6
commit
0f37bc35ba
@ -3738,12 +3738,17 @@ class Player extends Human implements CommandSender, ChunkLoader, IPlayer{
|
||||
}
|
||||
|
||||
public function resetCraftingGridType() : void{
|
||||
if($this->craftingGrid instanceof BigCraftingGrid){
|
||||
$drops = $this->inventory->addItem(...$this->craftingGrid->getContents());
|
||||
$contents = $this->craftingGrid->getContents();
|
||||
if(count($contents) > 0){
|
||||
$drops = $this->inventory->addItem(...$contents);
|
||||
foreach($drops as $drop){
|
||||
$this->dropItem($drop);
|
||||
}
|
||||
|
||||
$this->craftingGrid->clearAll();
|
||||
}
|
||||
|
||||
if($this->craftingGrid instanceof BigCraftingGrid){
|
||||
$this->craftingGrid = new CraftingGrid($this);
|
||||
$this->craftingType = 0;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user