Mrhand3

Panel

Jan 30th, 2014
68
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.20 KB | None | 0 0
  1. package Mrhand3.SOARYN.InventoryReg.gui;
  2. import java.lang.ref.WeakReference;
  3. import java.util.List;
  4.  
  5. import net.minecraft.client.Minecraft;
  6. import net.minecraft.inventory.Container;
  7. import net.minecraft.inventory.Slot;
  8.  
  9. import org.lwjgl.opengl.GL11;
  10.  
  11. public class Panel extends Box
  12. {
  13. private WeakReference<Container> container;
  14.  
  15. public Panel(int x, int y, int width, int height, Container container)
  16. {
  17. super(x, y, width, height, 0, 5, 0xFFFFFF);
  18. this.container = new WeakReference<Container>(container);
  19. }
  20.  
  21. @SuppressWarnings("unchecked")
  22. @Override
  23. public void render(Minecraft minecraft, int x, int y, int mouseX, int mouseY)
  24. {
  25. super.render(minecraft, x, y, mouseX, mouseY);
  26.  
  27. if (Base.IS_OVERLAY_PASS != isOverlay())
  28. {
  29. return;
  30. }
  31.  
  32. GL11.glColor4f(1, 1, 1, 1);
  33. bindComponentsSheet();
  34.  
  35. if (container != null && container.get() != null)
  36. {
  37. for (Slot slot : (List<Slot>)container.get().inventorySlots)
  38. {
  39. drawTexturedModalRect(slot.xDisplayPosition - 1, slot.yDisplayPosition - 1, 0, 20, 18, 18);
  40. }
  41. }
  42. }
  43. }
Advertisement
Add Comment
Please, Sign In to add comment