gt22

Untitled

Jul 28th, 2016
160
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 1.37 KB | None | 0 0
  1. private void processItem()
  2.     {
  3.         if(shards)
  4.         {
  5.             ItemStack input, output;
  6.             input = getStackInSlot(0);
  7.             if(input == null)
  8.             {
  9.                 reqvis = null;
  10.                 return;
  11.             }
  12.             ElementalizerRecepie recepie = ElementalizerApi.getRecepie(input);
  13.             if(recepie != null)
  14.             {
  15.                
  16.                    
  17.                 output = recepie.output;
  18.                 if(reqvis == null)
  19.                 {
  20.                     reqvis = recepie.cost;
  21.                 }
  22.                
  23.                 TileShardHolder[] holders = Elementalizer.getHolders(worldObj, xCoord, yCoord, zCoord);
  24.                 for(int i = 0; i < reqvis.length; i++)
  25.                 {
  26.                     if(shards && holders[i] != null)
  27.                     {
  28.                         int shardmeta = holders[i].getStackInSlot(0).getItemDamage();
  29.                         if(reqvis[shardmeta] > 0)
  30.                         reqvis[shardmeta] -= holders[i].drawVis(AdvThaumApi.aspects[shardmeta], reqvis[i]);
  31.                     }
  32.                     else
  33.                     {
  34.                         reqvis = null;
  35.                         return;
  36.                     }
  37.                 }
  38.                 System.out.println("Aer: " + reqvis[0]);
  39.                 System.out.println("Ignis: " + reqvis[1]);
  40.                 System.out.println("Aqua: " + reqvis[2]);
  41.                 System.out.println("Terra: " + reqvis[3]);
  42.                 boolean empty = true;
  43.                 for(int i = 0; i < 4; i++)
  44.                 {
  45.                     if(reqvis[i] > 0)
  46.                     {
  47.                         empty = false;
  48.                     }
  49.                 }
  50.                 if(empty)
  51.                 {
  52.                     reqvis = null;
  53.                     setInventorySlotContents(0, null);
  54.                     setInventorySlotContents(1, output);
  55.                 }
  56.             }
  57.             else
  58.             {
  59.                 reqvis = null;
  60.             }
  61.         }
  62.         else
  63.         {
  64.             reqvis = null;
  65.         }
  66.     }
Advertisement
Add Comment
Please, Sign In to add comment