Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package com.crilleslo.gui;
- import org.lwjgl.opengl.GL11;
- import com.crilleslo.container.ContainerWindmill;
- import com.crilleslo.tileentity.TileEntityWindmill;
- import com.sun.imageio.plugins.common.I18N;
- import net.minecraft.client.Minecraft;
- import net.minecraft.client.gui.GuiButton;
- import net.minecraft.client.gui.GuiScreen;
- import net.minecraft.client.gui.GuiTextField;
- import net.minecraft.client.gui.inventory.GuiContainer;
- import net.minecraft.entity.player.EntityPlayer;
- import net.minecraft.entity.player.InventoryPlayer;
- import net.minecraft.inventory.Container;
- import net.minecraft.util.ResourceLocation;
- public class GuiWindmill extends GuiContainer {
- ResourceLocation texture = new ResourceLocation("factorycraft", "textures/gui/windmillGui.png");
- private TileEntityWindmill tileEntity = null;
- public GuiWindmill(InventoryPlayer inventoryPlayer, TileEntityWindmill tileEntity) {
- super(new ContainerWindmill(inventoryPlayer, tileEntity));
- this.tileEntity = tileEntity;
- }
- protected void drawGuiContainerForegroundLayer(int p_146979_1_, int p_146979_2_) {
- fontRendererObj.drawString("Windmill", 70, 6, 4210752);
- fontRendererObj.drawString("Inventory", 8, this.ySize - 96 + 2, 4210752);
- }
- public boolean doesGuiPauseGame() {
- return false;
- }
- protected void drawGuiContainerBackgroundLayer(float p_146976_1_, int p_146976_2_, int p_146976_3_) {
- GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
- Minecraft.getMinecraft().getTextureManager().bindTexture(texture);
- int x = (width - xSize) / 2;
- int y = (height - ySize) / 2;
- this.drawTexturedModalRect(x, y, 0, 0, xSize, ySize);
- if(tileEntity.isActive()) {
- this.drawTexturedModalRect(x + 9, y + 9, 176, 0, 16, 16);
- }
- int progress = tileEntity.getEnergyStoredScaled(62);
- this.drawTexturedModalRect(x + 97, y + 77, 197, 77, -21, -progress);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment