Fix W10 throws away held item on inventory close

This issue will however still crop up if there are actual items in the crafting grid instead of air.
This commit is contained in:
Dylan K. Taylor 2016-11-27 12:01:09 +00:00
parent 5f5f71cfbe
commit 3b3abab3ad

View File

@ -2504,6 +2504,12 @@ class Player extends Human implements CommandSender, InventoryHolder, ChunkLoade
if($this->spawned === false or $this->blocked === true or !$this->isAlive()){
break;
}
if($packet->item->getId() === Item::AIR){
// Windows 10 Edition drops the contents of the crafting grid on container close - including air.
break;
}
$item = $this->inventory->getItemInHand();
$ev = new PlayerDropItemEvent($this, $item);
$this->server->getPluginManager()->callEvent($ev);