Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package net.codepixl.BitsAndBobs.GUI;
- import net.codepixl.BitsAndBobs.TileEntity.Container3DPrinter;
- import net.codepixl.BitsAndBobs.TileEntity.TileEntity3DPrinter;
- import net.minecraft.client.Minecraft;
- import net.minecraft.client.gui.FontRenderer;
- import net.minecraft.client.gui.inventory.GuiContainer;
- import net.minecraft.entity.player.InventoryPlayer;
- import net.minecraft.util.ResourceLocation;
- public class Gui3DPrinter extends GuiContainer{
- public ResourceLocation tex = new ResourceLocation("bitsandbobs:textures/gui/3DPrinter.png");
- public TileEntity3DPrinter p;
- public Gui3DPrinter(InventoryPlayer i, TileEntity3DPrinter p) {
- super(new Container3DPrinter(i,p));
- this.p = p;
- this.xSize = 176;
- this.ySize = 166;
- }
- @Override
- public void drawGuiContainerForegroundLayer(int l, int k){
- drawCenteredString(this.fontRendererObj, "3D Printer", width / 2, (this.height - this.ySize)/2 + 10, 4210752);
- }
- @Override
- public void drawGuiContainerBackgroundLayer(float f, int i, int j){
- this.drawDefaultBackground();
- Minecraft.getMinecraft().getTextureManager().bindTexture(tex);
- this.drawTexturedModalRect(guiLeft, guiTop, 0, 0, xSize, ySize);
- int k = (this.width - this.xSize) / 2;
- int l = (this.height - this.ySize) / 2;
- if (this.p.isBurning())
- {
- int i1 = this.p.getBurnTimeRemainingScaled(13);
- this.drawTexturedModalRect(k + 56, l + 36 + 12 - i1, 176, 12 - i1, 14, i1 + 1);
- i1 = this.p.getCookProgressScaled(24);
- this.drawTexturedModalRect(k + 79, l + 34, 176, 14, i1 + 1, 16);
- }
- }
- @Override
- public void drawCenteredString(FontRenderer p_73732_1_, String p_73732_2_, int p_73732_3_, int p_73732_4_, int p_73732_5_)
- {
- p_73732_1_.drawString(p_73732_2_, p_73732_3_ - p_73732_1_.getStringWidth(p_73732_2_) / 2, p_73732_4_, p_73732_5_);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement