Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package firstetestmod;
- import net.minecraft.client.Minecraft;
- import net.minecraft.client.gui.inventory.GuiContainer;
- import net.minecraft.client.resources.I18n;
- import net.minecraft.entity.player.InventoryPlayer;
- import net.minecraft.util.ResourceLocation;
- import org.lwjgl.opengl.GL11;
- public class GuiCombinerMachine extends GuiContainer
- {
- public static final ResourceLocation texture = new ResourceLocation("test:textures/gui/container/CombinerMachine.png");
- public TileEntityCombinerMachine tileCombinerMachine;
- public GuiCombinerMachine(InventoryPlayer invPlayer, TileEntityCombinerMachine entity) {
- super(new ContainerCombinerMachine(invPlayer, entity));
- Minecraft mc = Minecraft.getMinecraft();
- this.tileCombinerMachine = entity;
- this.xSize = 176;
- this.ySize = 165;
- }
- public void drawGuiContainerForegroundLayer(int par1, int par2){
- String s = this.tileCombinerMachine.isInventoryName() ? this.tileCombinerMachine.getInventoryName() : I18n.format(this.tileCombinerMachine.getInventoryName());
- this.fontRendererObj.drawString(s, this.xSize / 2 - this.fontRendererObj.getStringWidth(s) / 2, 6, 4210752);
- this.fontRendererObj.drawString(I18n.format("container.inventory"), 8, this.ySize - 96 + 5, 4210752);
- }
- public void drawGuiContainerBackgroundLayer(float f, int j, int i)
- {
- GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
- this.mc.getTextureManager().bindTexture(texture);
- this.drawTexturedModalRect(guiLeft, guiTop, 0, 0, this.xSize, this.ySize);
- int i1;
- if(this.tileCombinerMachine.hasPower())
- {
- i1 = this.tileCombinerMachine.getPowerRemainingScaled(45);
- this.drawTexturedModalRect(guiLeft + 8, guiTop + 53 - i1, 176, 62 - i1, 16, i1);
- }
- i1 = this.tileCombinerMachine.getCookProgressScaled(24);
- this.drawTexturedModalRect(guiLeft + 79, guiTop + 34, 176, 0, i1 + 1, 16);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement