Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package firstetestmod;
- import org.lwjgl.opengl.GL11;
- 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;
- public class GuiMatterMachine extends GuiContainer{
- public static final ResourceLocation texture = new ResourceLocation("test:textures/gui/container/MatterMachine.png");
- public TileEntityMatterMachine MatterMachine;
- public GuiMatterMachine(InventoryPlayer invPlayer, TileEntityMatterMachine entity) {
- super(new ContainerMatterMachine(invPlayer, entity));
- this.MatterMachine = entity;
- this.xSize = 176;
- this.ySize = 165;
- }
- public void drawGuiContainerForegroundLayer(int par1, int par2){
- String s = this.MatterMachine.isInvNameLocalized() ? this.MatterMachine.getInvName() : I18n.format(this.MatterMachine.getInvName());
- 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(1F, 1F, 1F, 1F);
- Minecraft.getMinecraft().getTextureManager().
- bindTexture(texture);
- drawTexturedModalRect(guiLeft, guiTop, 0, 0, xSize, ySize);
- int i1;
- if(this.MatterMachine.hasPower()){
- i1 = this.MatterMachine.getPowerRemainingScaled(47);
- this.drawTexturedModalRect(guiLeft + 8, guiTop + 53 - i1, 176, 64 - i1, 17, i1);
- }
- i1 = this.MatterMachine.getCookProgressScaled(24);
- this.drawTexturedModalRect(guiLeft + 79, guiTop + 34, 176, 0, i1 + 1, 16);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement