mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-09-06 17:59:48 +00:00
Force-close the crafting window only when doing crafting transactions
otherwise the client will crash when using right-click on the recipe book
This commit is contained in:
@ -50,20 +50,6 @@ class CraftingGrid extends BaseInventory{
|
||||
}
|
||||
|
||||
public function sendContents($target) : void{
|
||||
if(!is_array($target)){
|
||||
$target = [$target];
|
||||
}
|
||||
|
||||
/*
|
||||
* TODO: HACK!
|
||||
* we can't resend the contents of this window, so we force the client to close it instead.
|
||||
* So people don't whine about messy desync issues when someone cancels CraftItemEvent, or when a crafting
|
||||
* transaction goes wrong.
|
||||
*/
|
||||
$pk = new ContainerClosePacket();
|
||||
$pk->windowId = ContainerIds::NONE;
|
||||
foreach($target as $player){
|
||||
$player->dataPacket($pk);
|
||||
}
|
||||
//no way to do this
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user