| 1 | package net.minecraft.client.gui.inventory;
|
| 2 |
|
| 3 | import net.minecraft.client.renderer.GlStateManager;
|
| 4 | import net.minecraft.entity.player.InventoryPlayer;
|
| 5 | import net.minecraft.inventory.ContainerBrewingStand;
|
| 6 | import net.minecraft.inventory.IInventory;
|
| 7 | import net.minecraft.util.ResourceLocation;
|
| 8 |
|
| 9 | public class GuiBrewingStand extends GuiContainer
|
| 10 | {
|
| 11 | private static final ResourceLocation brewingStandGuiTextures = new ResourceLocation("textures/gui/container/brewing_stand.png");
|
| 12 |
|
| 13 | /** The player inventory bound to this GUI. */
|
| 14 | private final InventoryPlayer playerInventory;
|
| 15 | private IInventory tileBrewingStand;
|
| 16 |
|
| 17 | public GuiBrewingStand(InventoryPlayer playerInv, IInventory p_i45506_2_)
|
| 18 | {
|
| 19 | super(new ContainerBrewingStand(playerInv, p_i45506_2_));
|
| 20 | this.playerInventory = playerInv;
|
| 21 | this.tileBrewingStand = p_i45506_2_;
|
| 22 | }
|
| 23 |
|
| 24 | /**
|
| 25 | * Draw the foreground layer for the GuiContainer (everything in front of the items). Args : mouseX, mouseY
|
| 26 | */
|
| 27 | protected void drawGuiContainerForegroundLayer(int mouseX, int mouseY)
|
| 28 | {
|
| 29 | String s = this.tileBrewingStand.getDisplayName().getUnformattedText();
|
| 30 | this.fontRendererObj.drawString(s, this.xSize / 2 - this.fontRendererObj.getStringWidth(s) / 2, 6, 4210752);
|
| 31 | this.fontRendererObj.drawString(this.playerInventory.getDisplayName().getUnformattedText(), 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(brewingStandGuiTextures);
|
| 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 | int k = this.tileBrewingStand.getField(0);
|
| 45 |
|
| 46 | if (k > 0)
|
| 47 | {
|
| 48 | int l = (int)(28.0F * (1.0F - (float)k / 400.0F));
|
| 49 |
|
| 50 | if (l > 0)
|
| 51 | {
|
| 52 | this.drawTexturedModalRect(i + 97, j + 16, 176, 0, 9, l);
|
| 53 | }
|
| 54 |
|
| 55 | int i1 = k / 2 % 7;
|
| 56 |
|
| 57 | switch (i1)
|
| 58 | {
|
| 59 | case 0:
|
| 60 | l = 29;
|
| 61 | break;
|
| 62 |
|
| 63 | case 1:
|
| 64 | l = 24;
|
| 65 | break;
|
| 66 |
|
| 67 | case 2:
|
| 68 | l = 20;
|
| 69 | break;
|
| 70 |
|
| 71 | case 3:
|
| 72 | l = 16;
|
| 73 | break;
|
| 74 |
|
| 75 | case 4:
|
| 76 | l = 11;
|
| 77 | break;
|
| 78 |
|
| 79 | case 5:
|
| 80 | l = 6;
|
| 81 | break;
|
| 82 |
|
| 83 | case 6:
|
| 84 | l = 0;
|
| 85 | }
|
| 86 |
|
| 87 | if (l > 0)
|
| 88 | {
|
| 89 | this.drawTexturedModalRect(i + 65, j + 14 + 29 - l, 185, 29 - l, 12, l);
|
| 90 | }
|
| 91 | }
|
| 92 | }
|
| 93 | }
|
| 94 |
|