gt22

Untitled

May 19th, 2016
140
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 2.15 KB | None | 0 0
  1. package DummyCore.Client;
  2.  
  3. import java.util.ArrayList;
  4. import java.util.List;
  5.  
  6. import org.lwjgl.opengl.GL11;
  7.  
  8. import net.minecraft.client.Minecraft;
  9. import net.minecraft.client.gui.inventory.GuiContainer;
  10. import net.minecraft.inventory.Container;
  11. import net.minecraft.inventory.Slot;
  12. import net.minecraft.tileentity.TileEntity;
  13. import net.minecraft.util.ResourceLocation;
  14.  
  15. public class GuiCommon extends GuiContainer{
  16.    
  17.     public List<GuiElement> elementList = new ArrayList<GuiElement>();
  18.     public TileEntity genericTile;
  19.     public ResourceLocation guiGenLocation = new ResourceLocation("textures/gui/container/dispenser.png");
  20.     public ResourceLocation slotLocation = new ResourceLocation("textures/gui/container/dispenser.png");
  21.  
  22.     public GuiCommon(Container c) {
  23.         super(c);
  24.     }
  25.    
  26.     public GuiCommon(Container c, TileEntity tile) {
  27.         this(c);
  28.         genericTile = tile;
  29.     }
  30.  
  31.     @Override
  32.     protected void drawGuiContainerBackgroundLayer(float f1,int i1, int i2) {
  33.         GL11.glColor3f(1, 1, 1);
  34.         int k = (this.width - this.xSize) / 2;
  35.         int l = (this.height - this.ySize) / 2;
  36.         this.mc.renderEngine.bindTexture(guiGenLocation);
  37.         this.drawTexturedModalRect(k, l, 0, 0, this.xSize, this.ySize);
  38.         this.drawTexturedModalRect(k+60, l+16, 6, 6, 28, 54);
  39.         this.drawTexturedModalRect(k+88, l+16, 6, 6, 28, 54);
  40.         for(int i = 0; i < this.inventorySlots.inventorySlots.size(); ++i)
  41.         {
  42.             Slot slt = (Slot) this.inventorySlots.inventorySlots.get(i);
  43.             renderSlot(slt);
  44.             GL11.glColor3f(1, 1, 1);
  45.         }
  46.         for(int i = 0; i < this.elementList.size(); ++i)
  47.         {
  48.             GuiElement element = elementList.get(i);
  49.             Minecraft.getMinecraft().renderEngine.bindTexture(element.getElementTexture());
  50.             element.draw(k+element.getX(),l+element.getY());
  51.             GL11.glColor3f(1, 1, 1);
  52.         }
  53.         GL11.glColor3f(1, 1, 1);
  54.     }
  55.    
  56.     public void renderSlot(Slot slt)
  57.     {
  58.         GL11.glColor3f(1, 1, 1);
  59.         int k = (this.width - this.xSize) / 2;
  60.         int l = (this.height - this.ySize) / 2;
  61.         this.mc.renderEngine.bindTexture(slotLocation);
  62.         this.drawTexturedModalRect(k+slt.xDisplayPosition-1, l+slt.yDisplayPosition-1, 7, 83, 18, 18);
  63.     }
  64.    
  65.    
  66.  
  67. }
Advertisement
Add Comment
Please, Sign In to add comment