diff --git a/patches/server/fix-horse-inventories.patch b/patches/server/fix-horse-inventories.patch index a239957aca..52d8b5d303 100644 --- a/patches/server/fix-horse-inventories.patch +++ b/patches/server/fix-horse-inventories.patch @@ -76,10 +76,15 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 + @Override + public ItemStack getItem(final int index) { + if (index == net.minecraft.world.inventory.HorseInventoryMenu.SLOT_BODY_ARMOR) { -+ final net.minecraft.world.item.ItemStack item = this.getArmorInventory().getItem(index); ++ final net.minecraft.world.item.ItemStack item = this.getArmorInventory().getItem(0); + return item.isEmpty() ? null : CraftItemStack.asCraftMirror(item); + } else { -+ final net.minecraft.world.item.ItemStack item = this.getMainInventory().getItem(index); ++ int shiftedIndex = index; ++ if (index > net.minecraft.world.inventory.HorseInventoryMenu.SLOT_BODY_ARMOR) { ++ shiftedIndex--; ++ } ++ ++ final net.minecraft.world.item.ItemStack item = this.getMainInventory().getItem(shiftedIndex); + return item.isEmpty() ? null : CraftItemStack.asCraftMirror(item); + } + } @@ -87,9 +92,13 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 + @Override + public void setItem(final int index, final ItemStack item) { + if (index == net.minecraft.world.inventory.HorseInventoryMenu.SLOT_BODY_ARMOR) { -+ this.getArmorInventory().setItem(index, CraftItemStack.asNMSCopy(item)); ++ this.getArmorInventory().setItem(0, CraftItemStack.asNMSCopy(item)); + } else { -+ this.getMainInventory().setItem(index, CraftItemStack.asNMSCopy(item)); ++ int shiftedIndex = index; ++ if (index > net.minecraft.world.inventory.HorseInventoryMenu.SLOT_BODY_ARMOR) { ++ shiftedIndex--; ++ } ++ this.getMainInventory().setItem(shiftedIndex, CraftItemStack.asNMSCopy(item)); + } + } + // Paper end - combine both horse inventories