Also fix AbstractHorse getSize and isEmpty
This commit is contained in:
@ -50,12 +50,12 @@ public class CraftInventoryAbstractHorse extends CraftInventory implements Abstr
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int getSize() {
|
public int getSize() {
|
||||||
return this.getMainInventory().getContainerSize() + this.getArmorInventory().getContainerSize();
|
return this.getMainInventory().getContainerSize() + this.getArmorInventory().getContainerSize() + this.getSaddleInventory().getContainerSize();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean isEmpty() {
|
public boolean isEmpty() {
|
||||||
return this.getMainInventory().isEmpty() && this.getArmorInventory().isEmpty();
|
return this.getMainInventory().isEmpty() && this.getArmorInventory().isEmpty() && this.getSaddleInventory().isEmpty();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@ -116,8 +116,10 @@ public class CraftInventoryAbstractHorse extends CraftInventory implements Abstr
|
|||||||
if (index > HorseInventoryMenu.SLOT_BODY_ARMOR) {
|
if (index > HorseInventoryMenu.SLOT_BODY_ARMOR) {
|
||||||
shiftedIndex--;
|
shiftedIndex--;
|
||||||
}
|
}
|
||||||
|
if (index > HorseInventoryMenu.SLOT_SADDLE) {
|
||||||
|
shiftedIndex--;
|
||||||
|
}
|
||||||
this.getMainInventory().setItem(shiftedIndex, CraftItemStack.asNMSCopy(item));
|
this.getMainInventory().setItem(shiftedIndex, CraftItemStack.asNMSCopy(item));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// Paper end - combine both horse inventories
|
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user