ItemCombinerScreen.java

net.minecraft.client.gui.screens.inventory.ItemCombinerScreen

信息

  • 全限定名:net.minecraft.client.gui.screens.inventory.ItemCombinerScreen
  • 类型:public abstract class
  • 包:net.minecraft.client.gui.screens.inventory
  • 源码路径:src/main/java/net/minecraft/client/gui/screens/inventory/ItemCombinerScreen.java
  • 起始行号:L16
  • 继承:AbstractContainerScreen
  • 实现:ContainerListener
  • 职责:

    TODO

字段/常量

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

      TODO

内部类/嵌套类型

构造器

public ItemCombinerScreen(T menu, Inventory inventory, Component title, Identifier menuResource) @ L19

  • 构造器名:ItemCombinerScreen
  • 源码定位:L19
  • 修饰符:public

参数:

  • menu: T
  • inventory: Inventory
  • title: Component
  • menuResource: Identifier

说明:

TODO

方法

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

protected void subInit() @ L24

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

参数:

说明:

TODO

protected void init() @ L27

  • 方法名:init
  • 源码定位:L27
  • 返回类型:void
  • 修饰符:protected

参数:

说明:

TODO

public void removed() @ L34

  • 方法名:removed
  • 源码定位:L34
  • 返回类型:void
  • 修饰符:public

参数:

说明:

TODO

public void extractBackground(GuiGraphicsExtractor graphics, int mouseX, int mouseY, float a) @ L40

  • 方法名:extractBackground
  • 源码定位:L40
  • 返回类型:void
  • 修饰符:public

参数:

  • graphics: GuiGraphicsExtractor
  • mouseX: int
  • mouseY: int
  • a: float

说明:

TODO

protected abstract void extractErrorIcon(GuiGraphicsExtractor graphics, int xo, int yo) @ L47

  • 方法名:extractErrorIcon
  • 源码定位:L47
  • 返回类型:void
  • 修饰符:protected abstract

参数:

  • graphics: GuiGraphicsExtractor
  • xo: int
  • yo: int

说明:

TODO

public void dataChanged(AbstractContainerMenu container, int id, int value) @ L49

  • 方法名:dataChanged
  • 源码定位:L49
  • 返回类型:void
  • 修饰符:public

参数:

  • container: AbstractContainerMenu
  • id: int
  • value: int

说明:

TODO

public void slotChanged(AbstractContainerMenu container, int slotIndex, ItemStack itemStack) @ L53

  • 方法名:slotChanged
  • 源码定位:L53
  • 返回类型:void
  • 修饰符:public

参数:

  • container: AbstractContainerMenu
  • slotIndex: int
  • itemStack: ItemStack

说明:

TODO

代码

@OnlyIn(Dist.CLIENT)
public abstract class ItemCombinerScreen<T extends ItemCombinerMenu> extends AbstractContainerScreen<T> implements ContainerListener {
    private final Identifier menuResource;
 
    public ItemCombinerScreen(T menu, Inventory inventory, Component title, Identifier menuResource) {
        super(menu, inventory, title);
        this.menuResource = menuResource;
    }
 
    protected void subInit() {
    }
 
    @Override
    protected void init() {
        super.init();
        this.subInit();
        this.menu.addSlotListener(this);
    }
 
    @Override
    public void removed() {
        super.removed();
        this.menu.removeSlotListener(this);
    }
 
    @Override
    public void extractBackground(GuiGraphicsExtractor graphics, int mouseX, int mouseY, float a) {
        super.extractBackground(graphics, mouseX, mouseY, a);
        graphics.blit(RenderPipelines.GUI_TEXTURED, this.menuResource, this.leftPos, this.topPos, 0.0F, 0.0F, this.imageWidth, this.imageHeight, 256, 256);
        this.extractErrorIcon(graphics, this.leftPos, this.topPos);
    }
 
    protected abstract void extractErrorIcon(final GuiGraphicsExtractor graphics, final int xo, final int yo);
 
    @Override
    public void dataChanged(AbstractContainerMenu container, int id, int value) {
    }
 
    @Override
    public void slotChanged(AbstractContainerMenu container, int slotIndex, ItemStack itemStack) {
    }
}

引用的其他类