Advertisement
Guest User

Untitled

a guest
Aug 26th, 2016
77
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 2.11 KB | None | 0 0
  1. package melonslise.runicinscription.client.gui;
  2.  
  3. import org.lwjgl.opengl.GL11;
  4.  
  5. import melonslise.runicinscription.RunicInscription;
  6. import melonslise.runicinscription.common.container.ContainerRuneInscription;
  7. import net.minecraft.client.Minecraft;
  8. import net.minecraft.client.gui.inventory.GuiContainer;
  9. import net.minecraft.entity.player.InventoryPlayer;
  10. import net.minecraft.inventory.Container;
  11. import net.minecraft.util.ResourceLocation;
  12. import net.minecraft.world.World;
  13.  
  14. public class GUIRuneInscription extends GuiContainer
  15. {
  16.     private ResourceLocation texture = new ResourceLocation(RunicInscription.ID + ":" + "textures/gui/RuneInscription.png");
  17.     private ResourceLocation slot = new ResourceLocation(RunicInscription.ID + ":" + "textures/gui/CarvingGridSlot.png");
  18.     private ResourceLocation slotCarved = new ResourceLocation(RunicInscription.ID + ":" + "textures/gui/CarvingGridSlotCarved.png");
  19.    
  20.     private boolean[][] grid = new boolean[5][7];
  21.    
  22.     public GUIRuneInscription(InventoryPlayer inventoryPlayer, World world, int x, int y, int z)
  23.     {
  24.         super(new ContainerRuneInscription(inventoryPlayer, world, x, y, z));
  25.        
  26.         this.xSize = 176;
  27.         this.ySize = 206;
  28.     }
  29.    
  30.     public void renderCarvingGrid()
  31.     {
  32.         for(int i = 0; i < 7; ++i)
  33.         {
  34.             for(int k = 0; k < 5; ++k)
  35.             {
  36.                 GL11.glColor4f(1F, 1F, 1F, 1F);
  37.                
  38.                 if (grid[k][i] == false)
  39.                 {
  40.                     mc.getTextureManager().bindTexture(slot);
  41.                 }
  42.                 else if (grid[k][i] == true)
  43.                 {
  44.                     mc.getTextureManager().bindTexture(slotCarved);
  45.                 }
  46.                
  47.                 drawTexturedModalRect(guiLeft + 43 + k * 16, guiTop + 6 + i * 16, 0, 0, 16, 16);
  48.             }
  49.         }
  50.     }
  51.    
  52.     public void mouseClicked()
  53.     {
  54.        
  55.     }
  56.    
  57.     public void onGuiClosed()
  58.     {
  59.         super.onGuiClosed();
  60.     }
  61.  
  62.     protected void drawGuiContainerForegroundLayer(int i, int j)
  63.     {
  64.         //Draw text
  65.     }
  66.    
  67.     @Override
  68.     protected void drawGuiContainerBackgroundLayer(float f1, int i1, int i2)
  69.     {
  70.         GL11.glColor4f(1F, 1F, 1F, 1F);
  71.        
  72.         Minecraft.getMinecraft().getTextureManager().bindTexture(texture);
  73.        
  74.         drawTexturedModalRect(guiLeft, guiTop, 0, 0, xSize, ySize);
  75.        
  76.         renderCarvingGrid();
  77.     }
  78. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement