add solderer, processors, silicon, quartz enriched iron
This commit is contained in:
@@ -0,0 +1,47 @@
|
||||
package storagecraft.tile.solderer;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import net.minecraft.inventory.IInventory;
|
||||
import storagecraft.util.InventoryUtils;
|
||||
|
||||
public class SoldererRegistry
|
||||
{
|
||||
public static List<ISoldererRecipe> recipes = new ArrayList<ISoldererRecipe>();
|
||||
|
||||
public static void addRecipe(ISoldererRecipe recipe)
|
||||
{
|
||||
recipes.add(recipe);
|
||||
}
|
||||
|
||||
public static ISoldererRecipe getRecipe(IInventory inventory)
|
||||
{
|
||||
for (ISoldererRecipe recipe : recipes)
|
||||
{
|
||||
boolean ok = true;
|
||||
|
||||
for (int i = 0; i < 3; ++i)
|
||||
{
|
||||
if (!InventoryUtils.compareStackNoQuantity(recipe.getRow(i), inventory.getStackInSlot(i)))
|
||||
{
|
||||
ok = false;
|
||||
}
|
||||
|
||||
if (inventory.getStackInSlot(i) != null && recipe.getRow(i) != null)
|
||||
{
|
||||
if (inventory.getStackInSlot(i).stackSize < recipe.getRow(i).stackSize)
|
||||
{
|
||||
ok = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (ok)
|
||||
{
|
||||
return recipe;
|
||||
}
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user