Also fix AbstractHorse getSize and isEmpty

This commit is contained in:
Nassim Jahnke
2025-04-12 19:14:13 +02:00
parent 8eede4bb8a
commit 93b6829e83

View File

@ -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
} }