Inventory: Fix hotbar spaz

This commit is contained in:
Dylan K. Taylor
2016-09-06 11:23:49 +01:00
parent df4c3ec4a6
commit 765bd5ced7
2 changed files with 5 additions and 7 deletions

View File

@ -68,11 +68,11 @@ class PlayerInventory extends BaseInventory{
return $this->itemInHandIndex;
}
public function setHeldItemIndex($index){
public function setHeldItemIndex($index, $send = true){
if($index >= 0 and $index < $this->getHotbarSize()){
$this->itemInHandIndex = $index;
if($this->getHolder() instanceof Player){
if($this->getHolder() instanceof Player and $send){
$this->sendHeldItem($this->getHolder());
}