TechReborn/src/main/java/techreborn/client/gui/GuiBlastFurnace.java

77 lines
2.7 KiB
Java
Raw Normal View History

package techreborn.client.gui;
2015-06-26 02:15:44 +02:00
import codechicken.lib.gui.GuiDraw;
import net.minecraft.client.gui.inventory.GuiContainer;
import net.minecraft.client.resources.I18n;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.util.ResourceLocation;
2015-04-29 14:34:08 +02:00
import net.minecraft.util.StatCollector;
import techreborn.client.container.ContainerBlastFurnace;
import techreborn.lib.ModInfo;
import techreborn.tiles.TileBlastFurnace;
public class GuiBlastFurnace extends GuiContainer {
2015-06-26 18:22:58 +02:00
private static final ResourceLocation texture = new ResourceLocation("techreborn", "textures/gui/industrial_blast_furnace.png");
2015-07-20 16:19:23 +02:00
TileBlastFurnace blastfurnace;
ContainerBlastFurnace containerBlastFurnace;
public GuiBlastFurnace(EntityPlayer player, TileBlastFurnace tileblastfurnace)
2015-04-24 15:20:09 +02:00
{
super(new ContainerBlastFurnace(tileblastfurnace, player));
this.xSize = 176;
this.ySize = 167;
blastfurnace = tileblastfurnace;
2015-07-20 16:19:23 +02:00
this.containerBlastFurnace = (ContainerBlastFurnace) this.inventorySlots;
2015-04-24 15:20:09 +02:00
}
@Override
public void initGui() {
int k = (this.width - this.xSize) / 2;
int l = (this.height - this.ySize) / 2;
super.initGui();
}
@Override
protected void drawGuiContainerBackgroundLayer(float p_146976_1_, int p_146976_2_, int p_146976_3_)
2015-04-24 15:20:09 +02:00
{
this.mc.getTextureManager().bindTexture(texture);
int k = (this.width - this.xSize) / 2;
int l = (this.height - this.ySize) / 2;
this.drawTexturedModalRect(k, l, 0, 0, this.xSize, this.ySize);
2015-06-26 02:15:44 +02:00
2015-07-20 16:19:23 +02:00
if(containerBlastFurnace.heat == 0)
2015-06-26 02:15:44 +02:00
{
GuiDraw.drawTooltipBox(k + 30, l + 50 + 12 - 0, 114, 10);
this.fontRendererObj.drawString(ModInfo.MISSING_MULTIBLOCK, k + 38, l + 52 + 12 - 0, -1);
2015-06-26 02:15:44 +02:00
}
2015-07-20 16:19:23 +02:00
int j = 0;
this.mc.getTextureManager().bindTexture(texture);
j = blastfurnace.getProgressScaled(24);
if(j > 0) {
this.drawTexturedModalRect(k + 64, l + 37, 176, 14, j + 1, 16);
}
j = blastfurnace.getEnergyScaled(12);
if(j > 0) {
this.drawTexturedModalRect(k + 9, l + 36 + 12 - j, 176, 12 - j, 14, j + 2);
}
2015-04-24 15:20:09 +02:00
}
2015-06-26 02:31:47 +02:00
protected void drawGuiContainerForegroundLayer(int p_146979_1_, int p_146979_2_)
2015-04-24 15:20:09 +02:00
{
super.drawGuiContainerForegroundLayer(p_146979_1_, p_146979_2_);
2015-05-10 22:39:19 +02:00
String name = StatCollector.translateToLocal("tile.techreborn.blastfurnace.name");
this.fontRendererObj.drawString(name, this.xSize / 2 - this.fontRendererObj.getStringWidth(name) / 2, 6, 4210752);
2015-07-20 16:19:23 +02:00
if(containerBlastFurnace.heat != 0){
this.fontRendererObj.drawString("Current Heat: " + containerBlastFurnace.heat, 40, 60, 4210752);
}
2015-06-26 02:31:47 +02:00
this.fontRendererObj.drawString(I18n.format("container.inventory", new Object[0]), 8, this.ySize - 96 + 2, 4210752);
2015-04-24 15:20:09 +02:00
}
}