--- a/net/minecraft/world/inventory/HorseInventoryMenu.java
+++ b/net/minecraft/world/inventory/HorseInventoryMenu.java
@@ -1,6 +1,8 @@
 package net.minecraft.world.inventory;
 
+import net.minecraft.resources.ResourceLocation;
 import net.minecraft.world.Container;
+import net.minecraft.world.entity.Entity;
 import net.minecraft.world.entity.EquipmentSlot;
 import net.minecraft.world.entity.animal.horse.AbstractHorse;
 import net.minecraft.world.entity.player.Inventory;
@@ -8,22 +10,45 @@
 import net.minecraft.world.item.ItemStack;
 import net.minecraft.world.item.Items;
 
+// CraftBukkit start
+import org.bukkit.craftbukkit.inventory.CraftInventoryView;
+import org.bukkit.inventory.InventoryView;
+// CraftBukkit end
+
 public class HorseInventoryMenu extends AbstractContainerMenu {
+
     private final Container horseContainer;
     private final Container armorContainer;
     private final AbstractHorse horse;
     public static final int SLOT_BODY_ARMOR = 1;
     private static final int SLOT_HORSE_INVENTORY_START = 2;
 
-    public HorseInventoryMenu(int syncId, Inventory playerInventory, Container inventory, AbstractHorse entity, int slotColumnCount) {
-        super(null, syncId);
+    // CraftBukkit start
+    org.bukkit.craftbukkit.inventory.CraftInventoryView bukkitEntity;
+    Inventory player;
+
+    @Override
+    public InventoryView getBukkitView() {
+        if (this.bukkitEntity != null) {
+            return this.bukkitEntity;
+        }
+
+        return this.bukkitEntity = new CraftInventoryView(this.player.player.getBukkitEntity(), this.horseContainer.getOwner().getInventory(), this);
+    }
+
+    public HorseInventoryMenu(int syncId, Inventory playerInventory, Container inventory, final AbstractHorse entity, int slotColumnCount) {
+        super((MenuType) null, syncId);
+        this.player = playerInventory;
+        // CraftBukkit end
         this.horseContainer = inventory;
         this.armorContainer = entity.getBodyArmorAccess();
         this.horse = entity;
-        int i = 3;
+        boolean flag = true;
+
         inventory.startOpen(playerInventory.player);
-        int j = -18;
-        this.addSlot(new Slot(inventory, 0, 8, 18) {
+        boolean flag1 = true;
+
+        this.addSlot(new Slot(inventory, 0, 8, 18) { // CraftBukkit - decompile error
             @Override
             public boolean mayPlace(ItemStack stack) {
                 return stack.is(Items.SADDLE) && !this.hasItem() && entity.isSaddleable();
@@ -34,7 +59,7 @@
                 return entity.isSaddleable();
             }
         });
-        this.addSlot(new ArmorSlot(this.armorContainer, entity, EquipmentSlot.BODY, 0, 8, 36, null) {
+        this.addSlot(new ArmorSlot(this.armorContainer, entity, EquipmentSlot.BODY, 0, 8, 36, (ResourceLocation) null) { // CraftBukkit - decompile error
             @Override
             public boolean mayPlace(ItemStack stack) {
                 return entity.isBodyArmorItem(stack);
@@ -45,80 +70,84 @@
                 return entity.canUseSlot(EquipmentSlot.BODY);
             }
         });
+        int k;
+        int l;
+
         if (slotColumnCount > 0) {
-            for (int k = 0; k < 3; k++) {
-                for (int l = 0; l < slotColumnCount; l++) {
+            for (k = 0; k < 3; ++k) {
+                for (l = 0; l < slotColumnCount; ++l) {
                     this.addSlot(new Slot(inventory, 1 + l + k * slotColumnCount, 80 + l * 18, 18 + k * 18));
                 }
             }
         }
 
-        for (int m = 0; m < 3; m++) {
-            for (int n = 0; n < 9; n++) {
-                this.addSlot(new Slot(playerInventory, n + m * 9 + 9, 8 + n * 18, 102 + m * 18 + -18));
+        for (k = 0; k < 3; ++k) {
+            for (l = 0; l < 9; ++l) {
+                this.addSlot(new Slot(playerInventory, l + k * 9 + 9, 8 + l * 18, 102 + k * 18 + -18));
             }
         }
 
-        for (int o = 0; o < 9; o++) {
-            this.addSlot(new Slot(playerInventory, o, 8 + o * 18, 142));
+        for (k = 0; k < 9; ++k) {
+            this.addSlot(new Slot(playerInventory, k, 8 + k * 18, 142));
         }
+
     }
 
     @Override
     public boolean stillValid(Player player) {
-        return !this.horse.hasInventoryChanged(this.horseContainer)
-            && this.horseContainer.stillValid(player)
-            && this.armorContainer.stillValid(player)
-            && this.horse.isAlive()
-            && player.canInteractWithEntity(this.horse, 4.0);
+        return !this.horse.hasInventoryChanged(this.horseContainer) && this.horseContainer.stillValid(player) && this.armorContainer.stillValid(player) && this.horse.isAlive() && player.canInteractWithEntity((Entity) this.horse, 4.0D);
     }
 
     @Override
     public ItemStack quickMoveStack(Player player, int slot) {
-        ItemStack itemStack = ItemStack.EMPTY;
-        Slot slot2 = this.slots.get(slot);
-        if (slot2 != null && slot2.hasItem()) {
-            ItemStack itemStack2 = slot2.getItem();
-            itemStack = itemStack2.copy();
-            int i = this.horseContainer.getContainerSize() + 1;
-            if (slot < i) {
-                if (!this.moveItemStackTo(itemStack2, i, this.slots.size(), true)) {
+        ItemStack itemstack = ItemStack.EMPTY;
+        Slot slot1 = (Slot) this.slots.get(slot);
+
+        if (slot1 != null && slot1.hasItem()) {
+            ItemStack itemstack1 = slot1.getItem();
+
+            itemstack = itemstack1.copy();
+            int j = this.horseContainer.getContainerSize() + 1;
+
+            if (slot < j) {
+                if (!this.moveItemStackTo(itemstack1, j, this.slots.size(), true)) {
                     return ItemStack.EMPTY;
                 }
-            } else if (this.getSlot(1).mayPlace(itemStack2) && !this.getSlot(1).hasItem()) {
-                if (!this.moveItemStackTo(itemStack2, 1, 2, false)) {
+            } else if (this.getSlot(1).mayPlace(itemstack1) && !this.getSlot(1).hasItem()) {
+                if (!this.moveItemStackTo(itemstack1, 1, 2, false)) {
                     return ItemStack.EMPTY;
                 }
-            } else if (this.getSlot(0).mayPlace(itemStack2)) {
-                if (!this.moveItemStackTo(itemStack2, 0, 1, false)) {
+            } else if (this.getSlot(0).mayPlace(itemstack1)) {
+                if (!this.moveItemStackTo(itemstack1, 0, 1, false)) {
                     return ItemStack.EMPTY;
                 }
-            } else if (i <= 1 || !this.moveItemStackTo(itemStack2, 2, i, false)) {
-                int k = i + 27;
-                int m = k + 9;
-                if (slot >= k && slot < m) {
-                    if (!this.moveItemStackTo(itemStack2, i, k, false)) {
+            } else if (j <= 1 || !this.moveItemStackTo(itemstack1, 2, j, false)) {
+                int k = j + 27;
+                int l = k + 9;
+
+                if (slot >= k && slot < l) {
+                    if (!this.moveItemStackTo(itemstack1, j, k, false)) {
                         return ItemStack.EMPTY;
                     }
-                } else if (slot >= i && slot < k) {
-                    if (!this.moveItemStackTo(itemStack2, k, m, false)) {
+                } else if (slot >= j && slot < k) {
+                    if (!this.moveItemStackTo(itemstack1, k, l, false)) {
                         return ItemStack.EMPTY;
                     }
-                } else if (!this.moveItemStackTo(itemStack2, k, k, false)) {
+                } else if (!this.moveItemStackTo(itemstack1, k, k, false)) {
                     return ItemStack.EMPTY;
                 }
 
                 return ItemStack.EMPTY;
             }
 
-            if (itemStack2.isEmpty()) {
-                slot2.setByPlayer(ItemStack.EMPTY);
+            if (itemstack1.isEmpty()) {
+                slot1.setByPlayer(ItemStack.EMPTY);
             } else {
-                slot2.setChanged();
+                slot1.setChanged();
             }
         }
 
-        return itemStack;
+        return itemstack;
     }
 
     @Override
