AbstractFurnaceScreen.java

net.minecraft.client.gui.screens.inventory.AbstractFurnaceScreen

信息

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

    TODO

字段/常量

  • texture

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

      TODO

  • litProgressSprite

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

      TODO

  • burnProgressSprite

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

      TODO

内部类/嵌套类型

构造器

public AbstractFurnaceScreen(T menu, Inventory inventory, Component title, Component recipeFilterName, Identifier texture, Identifier litProgressSprite, Identifier burnProgressSprite, List<RecipeBookComponent.TabInfo> tabInfos) @ L23

  • 构造器名:AbstractFurnaceScreen
  • 源码定位:L23
  • 修饰符:public

参数:

  • menu: T
  • inventory: Inventory
  • title: Component
  • recipeFilterName: Component
  • texture: Identifier
  • litProgressSprite: Identifier
  • burnProgressSprite: Identifier
  • tabInfos: List<RecipeBookComponent.TabInfo>

说明:

TODO

方法

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

public void init() @ L39

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

参数:

说明:

TODO

protected ScreenPosition getRecipeBookButtonPosition() @ L45

  • 方法名:getRecipeBookButtonPosition
  • 源码定位:L45
  • 返回类型:ScreenPosition
  • 修饰符:protected

参数:

说明:

TODO

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

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

参数:

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

说明:

TODO

代码

@OnlyIn(Dist.CLIENT)
public abstract class AbstractFurnaceScreen<T extends AbstractFurnaceMenu> extends AbstractRecipeBookScreen<T> {
    private final Identifier texture;
    private final Identifier litProgressSprite;
    private final Identifier burnProgressSprite;
 
    public AbstractFurnaceScreen(
        T menu,
        Inventory inventory,
        Component title,
        Component recipeFilterName,
        Identifier texture,
        Identifier litProgressSprite,
        Identifier burnProgressSprite,
        List<RecipeBookComponent.TabInfo> tabInfos
    ) {
        super(menu, new FurnaceRecipeBookComponent(menu, recipeFilterName, tabInfos), inventory, title);
        this.texture = texture;
        this.litProgressSprite = litProgressSprite;
        this.burnProgressSprite = burnProgressSprite;
    }
 
    @Override
    public void init() {
        super.init();
        this.titleLabelX = (this.imageWidth - this.font.width(this.title)) / 2;
    }
 
    @Override
    protected ScreenPosition getRecipeBookButtonPosition() {
        return new ScreenPosition(this.leftPos + 20, this.height / 2 - 49);
    }
 
    @Override
    public void extractBackground(GuiGraphicsExtractor graphics, int mouseX, int mouseY, float a) {
        super.extractBackground(graphics, mouseX, mouseY, a);
        int xo = this.leftPos;
        int yo = this.topPos;
        graphics.blit(RenderPipelines.GUI_TEXTURED, this.texture, xo, yo, 0.0F, 0.0F, this.imageWidth, this.imageHeight, 256, 256);
        if (this.menu.isLit()) {
            int litSpriteHeight = 14;
            int litProgressHeight = Mth.ceil(this.menu.getLitProgress() * 13.0F) + 1;
            graphics.blitSprite(
                RenderPipelines.GUI_TEXTURED,
                this.litProgressSprite,
                14,
                14,
                0,
                14 - litProgressHeight,
                xo + 56,
                yo + 36 + 14 - litProgressHeight,
                14,
                litProgressHeight
            );
        }
 
        int burnSpriteWidth = 24;
        int burnProgressWidth = Mth.ceil(this.menu.getBurnProgress() * 24.0F);
        graphics.blitSprite(RenderPipelines.GUI_TEXTURED, this.burnProgressSprite, 24, 16, 0, 0, xo + 79, yo + 34, burnProgressWidth, 16);
    }
}

引用的其他类