Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package com.looke81.biowarfare.gui;
- import java.awt.List;
- import java.util.ArrayList;
- import net.minecraft.client.gui.inventory.GuiContainer;
- import net.minecraft.client.renderer.Tessellator;
- import net.minecraft.client.renderer.WorldRenderer;
- import net.minecraft.entity.player.InventoryPlayer;
- import net.minecraft.util.ResourceLocation;
- import net.minecraft.util.StatCollector;
- import org.lwjgl.opengl.GL11;
- import com.looke81.biowarfare.Reference;
- import com.looke81.biowarfare.container.ContainerMicrobeExtractor;
- import com.looke81.biowarfare.tileentity.TileEntityMicrobeExtractor;
- public class GuiMicrobeExtractor extends GuiContainer {
- private TileEntityMicrobeExtractor tile;
- private ResourceLocation background = new ResourceLocation(Reference.MOD_ID + ":textures/gui/electriccrusher.png");
- public static final ResourceLocation bground = new ResourceLocation(Reference.MOD_ID + ":" + "textures/gui/GuiMicrobeExtractor.png");
- public GuiMicrobeExtractor(InventoryPlayer inventory, TileEntityMicrobeExtractor tileEntity) {
- super(new ContainerMicrobeExtractor(inventory, tileEntity));
- this.tile = tileEntity;
- }
- @Override
- protected void drawGuiContainerForegroundLayer(int par1, int par2) {
- fontRendererObj.drawString("MicrobeExtractor", (((ySize + 10) - fontRendererObj.getStringWidth("MicrobeExtractor")) / 2), 6, 4210752);
- fontRendererObj.drawString(StatCollector.translateToLocal("container.inventory"), 5, ySize - 96 + 2, 4210752);
- }
- @Override
- protected void drawGuiContainerBackgroundLayer(float partialTicks, int mouseX, int mouseY) {
- int x = (width - xSize) / 2;
- int y = (height - ySize) / 2;
- tile = (TileEntityMicrobeExtractor) mc.theWorld.getTileEntity(tile.getPos());
- GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
- this.mc.getTextureManager().bindTexture(background);
- drawTexturedModalRect(x, y, 0, 0, xSize, ySize);
- //RF Energy bar
- int heightRF = tile.getEnergyStored(null) * 52 / tile.getMaxEnergyStored(null);
- Tessellator tessellator = Tessellator.getInstance();
- WorldRenderer worldrenderer = tessellator.getWorldRenderer();
- worldrenderer.startDrawingQuads();
- worldrenderer.addVertexWithUV(x + 18, y + 68, 0, 0.6875F, 0.26953125F);
- worldrenderer.addVertexWithUV(x + 34, y + 68, 0, 0.75F, 0.26953125F);
- worldrenderer.addVertexWithUV(x + 34, y + 68 - heightRF, 0, 0.75F, (float) (69 - heightRF) / 256);
- worldrenderer.addVertexWithUV(x + 18, y + 68 - heightRF, 0, 0.6875F, (float) (69 - heightRF) / 256);
- tessellator.draw();
- //Progress Arrow
- int arrow = tile.currentProcessTime != 0 ? tile.currentProcessTime * 24 : 0;
- this.drawTexturedModalRect(x + 81, y + 34, 176, 0, arrow + 1, 16);
- }
- @Override
- public void drawScreen(int mouseX, int mouseY, float par3) {
- super.drawScreen(mouseX, mouseY, par3);
- int x = (this.width - this.xSize) / 2;
- int y = (this.height - this.ySize) / 2;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement