- //Setting to Flag.
- ((InventoryDecomposition)par1IInventory).setFlag(false);
-
- //variable of results.
- ItemStack[] results = null;
-
- //Just loop of amount of added recipe.
- for(int i1 = 0;i1 < ChemiCraftAPI.instance.getDecompositionMaterial().size();i1++){
- //Recipe the match?
- boolean match = true;
- //Reset the results.
- results = new ItemStack[ChemiCraftAPI.instance.getDecompositionResult().get(i1).length];
- //Recipe ID & Damage.
- //Material ID & Damage.
- int materialID = par1IInventory.getStackInSlot(16).itemID;
- int materialDamage = par1IInventory.getStackInSlot(16).getItemDamage();
- int recipeID = ChemiCraftAPI.instance.getDecompositionMaterial().get(i1).itemID;
- int recipeDamage = ChemiCraftAPI.instance.getDecompositionMaterial().get(i1).getItemDamage();
-
- //Check of null of the Material Slot.
- if(par1IInventory.getStackInSlot(16) == null){ this.clearResults(par1IInventory, 16); return new ItemStack[16];}
- //ID check.
- if(materialID != recipeID){ match = false;}
- //Damage check.
- if(materialDamage != recipeDamage){ match = false;}
-
- //if "match == true"
- if(match){
- //Just loop of recipe size of recipe index i1.
- for(int i = 0;i < ChemiCraftAPI.instance.getDecompositionResult().get(i1).length;i++){
- //Assignment to the results.
- results[i] = new ItemStack(
- ChemiCraftAPI.instance.getDecompositionResult().get(i1)[i].itemID,
- ChemiCraftAPI.instance.getDecompositionResult().get(i1)[i].stackSize,
- ChemiCraftAPI.instance.getDecompositionResult().get(i1)[i].getItemDamage()
- );
- }
- //return the results.
- return results;
- }
- }
- //return the null.