HorseInventoryScreen .java

net.minecraft.client.gui.screens.inventory.HorseInventoryScreen (class, 49 lines): members: HORSE_INVENTORY_LOCATION, CHEST_SLOTS_SPRITE, SLOT_SPRITE.

net.minecraft.client.gui.screens.inventoryclass49 linesclientextends AbstractMountInventoryScreen<HorseInventoryMenu>1.8 KB

API Surface (4)

Identifier getBackgroundTextureLocation()
Identifier getSlotSpriteLocation()
boolean shouldRenderSaddleSlot()
boolean shouldRenderArmorSlot()

Fields & Constants (3)

SLOT_SPRITE
CHEST_SLOTS_SPRITE
HORSE_INVENTORY_LOCATION

String literals (3)

"container/slot"
"container/horse/chest_slots"
"textures/gui/container/horse.png"

Full Source

HorseInventoryScreen.java49 lines · Minecraft 26.3 · verbatim
1
package net.minecraft.client.gui.screens.inventory;
2
3
import net.fabricmc.api.EnvType;
4
import net.fabricmc.api.Environment;
5
import net.minecraft.resources.Identifier;
6
import net.minecraft.tags.EntityTypeTags;
7
import net.minecraft.world.entity.EquipmentSlot;
8
import net.minecraft.world.entity.animal.equine.AbstractHorse;
9
import net.minecraft.world.entity.animal.equine.Llama;
10
import net.minecraft.world.entity.player.Inventory;
11
import net.minecraft.world.inventory.HorseInventoryMenu;
12
import org.jspecify.annotations.Nullable;
13
14
@Environment(EnvType.CLIENT)
15
public class HorseInventoryScreen extends AbstractMountInventoryScreen<HorseInventoryMenu> {
16
	private static final Identifier SLOT_SPRITE = Identifier.withDefaultNamespace("container/slot");
17
	private static final Identifier CHEST_SLOTS_SPRITE = Identifier.withDefaultNamespace("container/horse/chest_slots");
18
	private static final Identifier HORSE_INVENTORY_LOCATION = Identifier.withDefaultNamespace("textures/gui/container/horse.png");
19
20
	public HorseInventoryScreen(final HorseInventoryMenu menu, final Inventory inventory, final AbstractHorse horse, final int inventoryColumns) {
21
		super(menu, inventory, horse.getDisplayName(), inventoryColumns, horse);
22
	}
23
24
	@Override
25
	protected Identifier getBackgroundTextureLocation() {
26
		return HORSE_INVENTORY_LOCATION;
27
	}
28
29
	@Override
30
	protected Identifier getSlotSpriteLocation() {
31
		return SLOT_SPRITE;
32
	}
33
34
	@Override
35
	protected @Nullable Identifier getChestSlotsSpriteLocation() {
36
		return CHEST_SLOTS_SPRITE;
37
	}
38
39
	@Override
40
	protected boolean shouldRenderSaddleSlot() {
41
		return this.mount.canUseSlot(EquipmentSlot.SADDLE) && this.mount.is(EntityTypeTags.CAN_EQUIP_SADDLE);
42
	}
43
44
	@Override
45
	protected boolean shouldRenderArmorSlot() {
46
		return this.mount.canUseSlot(EquipmentSlot.BODY) && (this.mount.is(EntityTypeTags.CAN_WEAR_HORSE_ARMOR) || this.mount instanceof Llama);
47
	}
48
}
49

Decompiled Minecraft 26.3 source of HorseInventoryScreen (net/minecraft/client/gui/screens/inventory/HorseInventoryScreen.java) with Mojang official mappings, stored verbatim on the site.