work on moving inventory network functionality to network layer

This commit is contained in:
Dylan K. Taylor
2019-06-25 13:28:01 +01:00
parent 9f09dc3dd7
commit d15284e638
21 changed files with 277 additions and 265 deletions

View File

@@ -137,12 +137,12 @@ class PlayerInventory extends BaseInventory{
if(!is_array($target)){
$target->sendDataPacket($pk);
if($target === $this->getHolder()){
$target->getNetworkSession()->syncInventorySlot($this, $this->getHeldItemIndex());
$target->getNetworkSession()->getInvManager()->syncSlot($this, $this->getHeldItemIndex());
}
}else{
$this->getHolder()->getWorld()->getServer()->broadcastPacket($target, $pk);
if(in_array($this->getHolder(), $target, true)){
$target->getNetworkSession()->syncInventorySlot($this, $this->getHeldItemIndex());
$target->getNetworkSession()->getInvManager()->syncSlot($this, $this->getHeldItemIndex());
}
}
}