mrkirby153

Untitled

Sep 21st, 2013
99
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 1.86 KB | None | 0 0
  1. package mrkirby153.MscHouses.block.GUI;
  2.  
  3. import mrkirby153.MscHouses.block.Container.ContainerHouseGenerator;
  4. import mrkirby153.MscHouses.block.tileEntity.TileEntityHouseGen;
  5. import mrkirby153.MscHouses.lib.ResourceFile;
  6. import mrkirby153.MscHouses.lib.Strings;
  7. import net.minecraft.client.gui.inventory.GuiContainer;
  8. import net.minecraft.entity.player.InventoryPlayer;
  9. import net.minecraft.util.StatCollector;
  10.  
  11. import org.lwjgl.opengl.GL11;
  12.  
  13. import cpw.mods.fml.relauncher.Side;
  14. import cpw.mods.fml.relauncher.SideOnly;
  15. /**
  16.  *
  17.  * Msc Houses
  18.  *
  19.  * GuiBlockBase
  20.  *
  21.  * @author mrkirby153
  22.  * @license Lesser GNU Public License v3 (http://www.gnu.org/licenses/lgpl.html)
  23.  */
  24. @SideOnly(Side.CLIENT)
  25. public class GuiHouseGenerator extends GuiContainer{
  26.     public GuiHouseGenerator (InventoryPlayer inventoryPlayer,
  27.             TileEntityHouseGen tileEntity) {
  28.         //the container is instanciated and passed to the superclass for handling
  29.         super(new ContainerHouseGenerator(inventoryPlayer, tileEntity));
  30.     }
  31.  
  32.     @Override
  33.     protected void drawGuiContainerForegroundLayer(int param1, int param2) {
  34.         //draw text and stuff here
  35.         //the parameters for drawString are: string, x, y, color
  36.         fontRenderer.drawString(StatCollector.translateToLocal(Strings.RESOURCE_PREFIX+Strings.TILE_HOUSE_GEN), 8, 6, 4210752);
  37.         //draws "Inventory" or your regional equivalent
  38.         fontRenderer.drawString(StatCollector.translateToLocal("container.inventory"), 8, ySize - 96 + 2, 4210752);
  39.     }
  40.  
  41.     @Override
  42.     protected void drawGuiContainerBackgroundLayer(float par1, int par2,
  43.             int par3) {
  44.         //draw your Gui here, only thing you need to change is the path
  45.         GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
  46.         this.mc.getTextureManager().bindTexture(ResourceFile.houseGen_Img);
  47.        
  48.         int x = (width - xSize) / 2;
  49.         int y = (height - ySize) / 2;
  50.         this.drawTexturedModalRect(x, y, 0, 0, xSize, ySize);
  51.     }
  52.  
  53. }
Advertisement
Add Comment
Please, Sign In to add comment