mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-07-05 17:41:46 +00:00
Player: fixed removeWindow() causing all other inventories to be unopenable
This commit is contained in:
parent
255ff63fda
commit
4bf338f783
@ -3124,10 +3124,22 @@ class Player extends Human implements CommandSender, ChunkLoader, IPlayer{
|
|||||||
$this->removeWindow($this->windowIndex[$packet->windowId]);
|
$this->removeWindow($this->windowIndex[$packet->windowId]);
|
||||||
$this->closingWindowId = null;
|
$this->closingWindowId = null;
|
||||||
//removeWindow handles sending the appropriate
|
//removeWindow handles sending the appropriate
|
||||||
return true;
|
}else{
|
||||||
|
/*
|
||||||
|
* TODO: HACK!
|
||||||
|
* If we told the client to remove a window on our own (e.g. a plugin called removeWindow()), our
|
||||||
|
* first ContainerClose tricks the client into behaving as if it itself asked for the window to be closed.
|
||||||
|
* This means that it will send us a ContainerClose of its own, which we must respond to the same way as if
|
||||||
|
* the client closed the window by itself.
|
||||||
|
* If we don't, the client will not be able to open any new windows.
|
||||||
|
*/
|
||||||
|
$pk = new ContainerClosePacket();
|
||||||
|
$pk->windowId = $packet->windowId;
|
||||||
|
$pk->server = false;
|
||||||
|
$this->sendDataPacket($pk);
|
||||||
}
|
}
|
||||||
|
|
||||||
return false;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function handleAdventureSettings(AdventureSettingsPacket $packet) : bool{
|
public function handleAdventureSettings(AdventureSettingsPacket $packet) : bool{
|
||||||
|
Loading…
x
Reference in New Issue
Block a user