Advertisement
TechMage66

renderResearchInfoPage

May 15th, 2016
121
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.92 KB | None | 0 0
  1. @Override
  2. public void renderResearchInfoPage(int guiLeft, int guiTop, int xSize, int ySize)
  3. {
  4.     super.renderResearchInfoPage(guiLeft, guiTop, xSize, ySize);
  5.  
  6.     RenderItem renderItem = Minecraft.getMinecraft().getRenderItem();
  7.  
  8.     int xPos;
  9.     int yPos;
  10.  
  11.     GlStateManager.enableLighting();
  12.  
  13.     for (IRecipe recipe : recipes)
  14.     {
  15.         if (recipe instanceof ShapedRecipes)
  16.         {
  17.             ShapedRecipes shaped = (ShapedRecipes)recipe;
  18.  
  19.             for (int x = 0; x < shaped.recipeWidth; x ++)
  20.             {
  21.                 for (int y = 0; y < shaped.recipeHeight; y ++)
  22.                 {
  23.                     xPos = guiLeft + 10 + x * 20;
  24.                     yPos = guiTop + 10 + y * 20;
  25.  
  26.                     renderItem.renderItemAndEffectIntoGUI(shaped.recipeItems[y * shaped.recipeWidth + x], xPos, yPos);
  27.                 }
  28.             }
  29.         }
  30.     }
  31.  
  32.     GlStateManager.disableLighting();
  33. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement