Skip to content

Instantly share code, notes, and snippets.

Created March 31, 2017 19:56
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save anonymous/f408bccab0efc8fd77eacd0e833b7f90 to your computer and use it in GitHub Desktop.
Save anonymous/f408bccab0efc8fd77eacd0e833b7f90 to your computer and use it in GitHub Desktop.
package com.chocolatemod.specialblocks.container;
import com.chocolatemod.specialblocks.tileentity.TileEntityPress;
import net.minecraft.client.gui.inventory.GuiContainer;
import net.minecraft.client.renderer.GlStateManager;
import net.minecraft.inventory.IInventory;
import net.minecraft.util.ResourceLocation;
public class GuiTileEntityPress extends GuiContainer{
private IInventory playerInv;
private TileEntityPress te;
public GuiTileEntityPress(IInventory playerInv, TileEntityPress te) {
super(new ContainerTileEntityPress(playerInv, te));
this.playerInv = playerInv;
this.te = te;
this.xSize = 176;
this.ySize = 166;
}
@Override
protected void drawGuiContainerBackgroundLayer(float partialTicks, int mouseX, int mouseY) {
GlStateManager.color(1.0f, 1.0f, 1.0f, 1.0f);
this.mc.getTextureManager().bindTexture(new ResourceLocation("kjd:textures/gui/container/press.png"));
this.drawTexturedModalRect(this.guiLeft, this.guiTop, 0, 0, this.xSize, this.ySize);
}
@Override
protected void drawGuiContainerForegroundLayer(int mouseX, int mouseY) {
String s = this.te.getDisplayName().getUnformattedText();
this.fontRendererObj.drawString(s, 88 - this.fontRendererObj.getStringWidth(s) / 2, 6, 4210752); //#404040
this.fontRendererObj.drawString(this.playerInv.getDisplayName().getUnformattedText(), 8, 72, 4210752); //#404040
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment