mojira.dev
MC-270530

Horses, donkeys, mules, llamas and camels all use the same inventory texture file

The bug

Horses, donkeys, mules, llamas and camels all use the file textures/gui/container/horse.png. Not only is this intuitive by name terms, it's also inconsistent with:

  • furnaces, blast furnaces and smokers, which all use different texture files despite appearing identical

  • shulker boxes, which have an identical looking inventory to single chests/trapped chests, ender chests, barrels and minecarts with chests, but are handled by a dedicated texture file

How to fix

Introduce new, dedicated files for each of these entities.

Further notes

Fixing this should also make fixing MC-265033 easier - for the type of entity in question, the saddle/carpet/armor slot could be made part of the inventory texture itself rather than an external sprite, and the slot outline could be split into its own file as to behave correctly when items are in the slot.

Linked issues

MC-271334 The twelve rods of a blaze cannot be independently retextured Resolved MC-271983 The right/left ears, front legs, and back legs of a polar bear cannot be independently retextured Resolved MC-145334 Chests, and trapped chests, and copper chests use the same texture between December 24 and 26 Open MC-265343 Absorption heart containers reuse the normal heart container textures, cannot be customized independently Open MC-265345 Withered absorption hearts reuse the withered normal heart texture file and cannot be retextured independently Open

Comments 1

Can confirm with code analysis of 24w14a.

The resource location of the inventory:

. . .
private static final ResourceLocation HORSE_INVENTORY_LOCATION = new ResourceLocation("textures/gui/container/horse.png");
. . .

The code which controls how the 'horse' GUI should behave depending on which entity is being ridden:

protected void renderBg(GuiGraphics var1, float var2, int var3, int var4) {
      int var5 = (this.width - this.imageWidth) / 2;
      int var6 = (this.height - this.imageHeight) / 2;
      var1.blit(HORSE_INVENTORY_LOCATION, var5, var6, 0, 0, this.imageWidth, this.imageHeight);
      AbstractHorse var8 = this.horse;
      if (var8 instanceof AbstractChestedHorse) {
         AbstractChestedHorse var7 = (AbstractChestedHorse)var8;
         if (var7.hasChest()) {
            var1.blitSprite(CHEST_SLOTS_SPRITE, 90, 54, 0, 0, var5 + 79, var6 + 17, var7.getInventoryColumns() * 18, 54);
         }
      }

      if (this.horse.isSaddleable()) {
         var1.blitSprite(SADDLE_SLOT_SPRITE, var5 + 7, var6 + 35 - 18, 18, 18);
      }

      if (this.horse.canWearBodyArmor()) {
         if (this.horse instanceof Llama) {
            var1.blitSprite(LLAMA_ARMOR_SLOT_SPRITE, var5 + 7, var6 + 35, 18, 18);
         } else {
            var1.blitSprite(ARMOR_SLOT_SPRITE, var5 + 7, var6 + 35, 18, 18);
         }
      }

      InventoryScreen.renderEntityInInventoryFollowsMouse(var1, var5 + 26, var6 + 18, var5 + 78, var6 + 70, 17, 0.25F, this.xMouse, this.yMouse, this.horse);
   }

muzikbike

(Unassigned)

Community Consensus

Textures and models

1.20.4, 24w14a

Retrieved