mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-06-12 14:35:35 +00:00
Add vanilla-style crafting grid item evacuation server-side when closing the window in case something goes wrong
This commit is contained in:
parent
6b34c47c96
commit
d941bf8e74
@ -3736,7 +3736,11 @@ class Player extends Human implements CommandSender, ChunkLoader, IPlayer{
|
|||||||
|
|
||||||
public function resetCraftingGridType() : void{
|
public function resetCraftingGridType() : void{
|
||||||
if($this->craftingGrid instanceof BigCraftingGrid){
|
if($this->craftingGrid instanceof BigCraftingGrid){
|
||||||
//TODO: this needs to drop anything left in the crafting grid otherwise our items might get deleted
|
$drops = $this->inventory->addItem(...$this->craftingGrid->getContents());
|
||||||
|
foreach($drops as $drop){
|
||||||
|
$this->dropItem($drop);
|
||||||
|
}
|
||||||
|
|
||||||
$this->craftingGrid = new CraftingGrid($this);
|
$this->craftingGrid = new CraftingGrid($this);
|
||||||
$this->craftingType = 0;
|
$this->craftingType = 0;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user