GuiCrafting .java

net.minecraft.client.gui.inventory.GuiCrafting (class, 46 lines): members: craftingTableGuiTextures, drawGuiContainerBackgroundLayer. imports: I18n.

net.minecraft.client.gui.inventoryclass46 linesclientextends GuiContainer1.7 KB

API Surface (2)

void drawGuiContainerForegroundLayer(int mouseX, int mouseY)
void drawGuiContainerBackgroundLayer(float partialTicks, int mouseX, int mouseY)

Fields & Constants (1)

craftingTableGuiTextures

String literals (3)

"textures/gui/container/crafting_table.png"
"container.crafting"
"container.inventory"

Full Source

GuiCrafting.java46 lines · MCP 1.8.9 · verbatimOriginal ↗
1
package net.minecraft.client.gui.inventory;
2
3
import net.minecraft.client.renderer.GlStateManager;
4
import net.minecraft.client.resources.I18n;
5
import net.minecraft.entity.player.InventoryPlayer;
6
import net.minecraft.inventory.ContainerWorkbench;
7
import net.minecraft.util.BlockPos;
8
import net.minecraft.util.ResourceLocation;
9
import net.minecraft.world.World;
10
11
public class GuiCrafting extends GuiContainer
12
{
13
    private static final ResourceLocation craftingTableGuiTextures = new ResourceLocation("textures/gui/container/crafting_table.png");
14
15
    public GuiCrafting(InventoryPlayer playerInv, World worldIn)
16
    {
17
        this(playerInv, worldIn, BlockPos.ORIGIN);
18
    }
19
20
    public GuiCrafting(InventoryPlayer playerInv, World worldIn, BlockPos blockPosition)
21
    {
22
        super(new ContainerWorkbench(playerInv, worldIn, blockPosition));
23
    }
24
25
    /**
26
     * Draw the foreground layer for the GuiContainer (everything in front of the items). Args : mouseX, mouseY
27
     */
28
    protected void drawGuiContainerForegroundLayer(int mouseX, int mouseY)
29
    {
30
        this.fontRendererObj.drawString(I18n.format("container.crafting", new Object[0]), 28, 6, 4210752);
31
        this.fontRendererObj.drawString(I18n.format("container.inventory", new Object[0]), 8, this.ySize - 96 + 2, 4210752);
32
    }
33
34
    /**
35
     * Args : renderPartialTicks, mouseX, mouseY
36
     */
37
    protected void drawGuiContainerBackgroundLayer(float partialTicks, int mouseX, int mouseY)
38
    {
39
        GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);
40
        this.mc.getTextureManager().bindTexture(craftingTableGuiTextures);
41
        int i = (this.width - this.xSize) / 2;
42
        int j = (this.height - this.ySize) / 2;
43
        this.drawTexturedModalRect(i, j, 0, 0, this.xSize, this.ySize);
44
    }
45
}
46

Deobfuscated MCP 1.8.9 source of GuiCrafting from Marcelektro/MavenMCP-1.8.9 (net/minecraft/client/gui/inventory/GuiCrafting.java), stored verbatim.