HorseInventoryScreen.java

net.minecraft.client.gui.screens.inventory.HorseInventoryScreen

信息

  • 全限定名:net.minecraft.client.gui.screens.inventory.HorseInventoryScreen
  • 类型:public class
  • 包:net.minecraft.client.gui.screens.inventory
  • 源码路径:src/main/java/net/minecraft/client/gui/screens/inventory/HorseInventoryScreen.java
  • 起始行号:L15
  • 继承:AbstractMountInventoryScreen
  • 职责:

    TODO

字段/常量

  • SLOT_SPRITE

    • 类型: Identifier
    • 修饰符: private static final
    • 源码定位: L16
    • 说明:

      TODO

  • CHEST_SLOTS_SPRITE

    • 类型: Identifier
    • 修饰符: private static final
    • 源码定位: L17
    • 说明:

      TODO

  • HORSE_INVENTORY_LOCATION

    • 类型: Identifier
    • 修饰符: private static final
    • 源码定位: L18
    • 说明:

      TODO

内部类/嵌套类型

构造器

public HorseInventoryScreen(HorseInventoryMenu menu, Inventory inventory, AbstractHorse horse, int inventoryColumns) @ L20

  • 构造器名:HorseInventoryScreen
  • 源码定位:L20
  • 修饰符:public

参数:

  • menu: HorseInventoryMenu
  • inventory: Inventory
  • horse: AbstractHorse
  • inventoryColumns: int

说明:

TODO

方法

下面的方法块按源码顺序生成。

protected Identifier getBackgroundTextureLocation() @ L24

  • 方法名:getBackgroundTextureLocation
  • 源码定位:L24
  • 返回类型:Identifier
  • 修饰符:protected

参数:

说明:

TODO

protected Identifier getSlotSpriteLocation() @ L29

  • 方法名:getSlotSpriteLocation
  • 源码定位:L29
  • 返回类型:Identifier
  • 修饰符:protected

参数:

说明:

TODO

protected Identifier getChestSlotsSpriteLocation() @ L34

  • 方法名:getChestSlotsSpriteLocation
  • 源码定位:L34
  • 返回类型:Identifier
  • 修饰符:protected

参数:

说明:

TODO

protected boolean shouldRenderSaddleSlot() @ L39

  • 方法名:shouldRenderSaddleSlot
  • 源码定位:L39
  • 返回类型:boolean
  • 修饰符:protected

参数:

说明:

TODO

protected boolean shouldRenderArmorSlot() @ L44

  • 方法名:shouldRenderArmorSlot
  • 源码定位:L44
  • 返回类型:boolean
  • 修饰符:protected

参数:

说明:

TODO

代码

@OnlyIn(Dist.CLIENT)
public class HorseInventoryScreen extends AbstractMountInventoryScreen<HorseInventoryMenu> {
    private static final Identifier SLOT_SPRITE = Identifier.withDefaultNamespace("container/slot");
    private static final Identifier CHEST_SLOTS_SPRITE = Identifier.withDefaultNamespace("container/horse/chest_slots");
    private static final Identifier HORSE_INVENTORY_LOCATION = Identifier.withDefaultNamespace("textures/gui/container/horse.png");
 
    public HorseInventoryScreen(HorseInventoryMenu menu, Inventory inventory, AbstractHorse horse, int inventoryColumns) {
        super(menu, inventory, horse.getDisplayName(), inventoryColumns, horse);
    }
 
    @Override
    protected Identifier getBackgroundTextureLocation() {
        return HORSE_INVENTORY_LOCATION;
    }
 
    @Override
    protected Identifier getSlotSpriteLocation() {
        return SLOT_SPRITE;
    }
 
    @Override
    protected @Nullable Identifier getChestSlotsSpriteLocation() {
        return CHEST_SLOTS_SPRITE;
    }
 
    @Override
    protected boolean shouldRenderSaddleSlot() {
        return this.mount.canUseSlot(EquipmentSlot.SADDLE) && this.mount.is(EntityTypeTags.CAN_EQUIP_SADDLE);
    }
 
    @Override
    protected boolean shouldRenderArmorSlot() {
        return this.mount.canUseSlot(EquipmentSlot.BODY) && (this.mount.is(EntityTypeTags.CAN_WEAR_HORSE_ARMOR) || this.mount instanceof Llama);
    }
}

引用的其他类