mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-09-06 09:56:06 +00:00
Player: Window system now only allows 1 window at a time
This commit is contained in:
@ -753,14 +753,14 @@ class NetworkSession{
|
||||
|
||||
public function syncInventorySlot(Inventory $inventory, int $slot) : void{
|
||||
$windowId = $this->player->getWindowId($inventory);
|
||||
if($windowId !== ContainerIds::NONE){
|
||||
if($windowId !== null){
|
||||
$this->sendDataPacket(InventorySlotPacket::create($windowId, $slot, $inventory->getItem($slot)));
|
||||
}
|
||||
}
|
||||
|
||||
public function syncInventoryContents(Inventory $inventory) : void{
|
||||
$windowId = $this->player->getWindowId($inventory);
|
||||
if($windowId !== ContainerIds::NONE){
|
||||
if($windowId !== null){
|
||||
$this->sendDataPacket(InventoryContentPacket::create($windowId, $inventory->getContents(true)));
|
||||
}
|
||||
}
|
||||
@ -773,7 +773,7 @@ class NetworkSession{
|
||||
|
||||
public function syncInventoryData(Inventory $inventory, int $propertyId, int $value) : void{
|
||||
$windowId = $this->player->getWindowId($inventory);
|
||||
if($windowId !== ContainerIds::NONE){
|
||||
if($windowId !== null){
|
||||
$this->sendDataPacket(ContainerSetDataPacket::create($windowId, $propertyId, $value));
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user