PlayerInventory: Send updates to viewers automatically on setItemInHand()

This commit is contained in:
Dylan K. Taylor
2018-08-05 19:31:21 +01:00
parent c90e3e351d
commit ff6d590d0c
2 changed files with 6 additions and 3 deletions

View File

@@ -127,7 +127,12 @@ class PlayerInventory extends BaseInventory{
* @return bool
*/
public function setItemInHand(Item $item) : bool{
return $this->setItem($this->getHeldItemIndex(), $item);
if($this->setItem($this->getHeldItemIndex(), $item)){
$this->sendHeldItem($this->holder->getViewers());
return true;
}
return false;
}
/**