content: package net.minecraft.client.gui.inventory;
  
  import net.minecraft.client.Minecraft;
  import net.minecraft.client.renderer.GlStateManager;
  import net.minecraft.entity.passive.EntityHorse;
  import net.minecraft.inventory.ContainerHorseInventory;
  import net.minecraft.inventory.IInventory;
  import net.minecraft.util.ResourceLocation;
  
  public class GuiScreenHorseInventory extends GuiContainer {
      private static final ResourceLocation horseGuiTextures = new ResourceLocation("textures/gui/container/horse.png");
      private final IInventory playerInventory;
      private final IInventory horseInventory;
      private final EntityHorse horseEntity;
      private float mousePosx;
      private float mousePosY;
  
      public GuiScreenHorseInventory(IInventory playerInv, IInventory horseInv, EntityHorse horse) {
          super(new ContainerHorseInventory(playerInv, horseInv, horse, Minecraft.getMinecraft().thePlayer));
          this.playerInventory = playerInv;
          this.horseInventory = horseInv;
          this.horseEntity = horse;
          this.allowUserInput = false;
      }
  
      protected void drawGuiContainerForegroundLayer(int mouseX, int mouseY) {
          this.fontRendererObj.drawString(this.horseInventory.getDisplayName().getUnformattedText(), 8, 6, 4210752);
          this.fontRendererObj.drawString(this.playerInventory.getDisplayName().getUnformattedText(), 8, this.ySize - 96 + 2, 4210752);
      }
  
      protected void drawGuiContainerBackgroundLayer(float partialTicks, int mouseX, int mouseY) {
          GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);
          this.mc.getTextureManager().bindTexture(horseGuiTextures);
          int i = (this.width - this.xSize) / 2;
          int j = (this.height - this.ySize) / 2;
          this.drawTexturedModalRect(i, j, 0, 0, this.xSize, this.ySize);
  
          if (this.horseEntity.isChested()) {
              this.drawTexturedModalRect(i + 79, j + 17, 0, this.ySize, 90, 54);
          }
  
          if (this.horseEntity.canWearArmor()) {
              this.drawTexturedModalRect(i + 7, j + 35, 0, this.ySize + 54, 18, 18);
          }
  
          GuiInventory.drawEntityOnScreen(i + 51, j + 60, 17, (float) (i + 51) - this.mousePosx, (float) (j + 75 - 50) - this.mousePosY, this.horseEntity);
      }
  
      public void drawScreen(int mouseX, int mouseY, float partialTicks) {
          this.mousePosx = (float) mouseX;
          this.mousePosY = (float) mouseY;
          super.drawScreen(mouseX, mouseY, partialTicks);
      }
  }
  