Inventory: Split up armor and player inventory (#1957)

* Inventory: Split up PlayerInventory and armour handling
* Fixed other players don't see armour changes. This bug also exists on master.
This commit is contained in:
Dylan K. Taylor
2018-01-23 20:01:26 +00:00
committed by GitHub
parent 0bf5ab76fb
commit 6543d96910
8 changed files with 198 additions and 235 deletions

View File

@ -159,12 +159,6 @@ class NetworkInventoryAction{
public function createInventoryAction(Player $player){
switch($this->sourceType){
case self::SOURCE_CONTAINER:
if($this->windowId === ContainerIds::ARMOR){
//TODO: HACK!
$this->inventorySlot += 36;
$this->windowId = ContainerIds::INVENTORY;
}
$window = $player->getWindow($this->windowId);
if($window !== null){
return new SlotChangeAction($window, $this->inventorySlot, $this->oldItem, $this->newItem);