DispenserScreen.java

net.minecraft.client.gui.screens.inventory.DispenserScreen

信息

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

    TODO

字段/常量

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

      TODO

内部类/嵌套类型

构造器

public DispenserScreen(DispenserMenu menu, Inventory inventory, Component title) @ L16

  • 构造器名:DispenserScreen
  • 源码定位:L16
  • 修饰符:public

参数:

  • menu: DispenserMenu
  • inventory: Inventory
  • title: Component

说明:

TODO

方法

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

protected void init() @ L20

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

参数:

说明:

TODO

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

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

参数:

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

说明:

TODO

代码

@OnlyIn(Dist.CLIENT)
public class DispenserScreen extends AbstractContainerScreen<DispenserMenu> {
    private static final Identifier CONTAINER_LOCATION = Identifier.withDefaultNamespace("textures/gui/container/dispenser.png");
 
    public DispenserScreen(DispenserMenu menu, Inventory inventory, Component title) {
        super(menu, inventory, title);
    }
 
    @Override
    protected void init() {
        super.init();
        this.titleLabelX = (this.imageWidth - this.font.width(this.title)) / 2;
    }
 
    @Override
    public void extractBackground(GuiGraphicsExtractor graphics, int mouseX, int mouseY, float a) {
        super.extractBackground(graphics, mouseX, mouseY, a);
        int xo = (this.width - this.imageWidth) / 2;
        int yo = (this.height - this.imageHeight) / 2;
        graphics.blit(RenderPipelines.GUI_TEXTURED, CONTAINER_LOCATION, xo, yo, 0.0F, 0.0F, this.imageWidth, this.imageHeight, 256, 256);
    }
}

引用的其他类