add solderer, processors, silicon, quartz enriched iron
This commit is contained in:
@@ -0,0 +1,12 @@
|
||||
package storagecraft.tile.solderer;
|
||||
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
public interface ISoldererRecipe
|
||||
{
|
||||
public ItemStack getRow(int row);
|
||||
|
||||
public ItemStack getResult();
|
||||
|
||||
public int getDuration();
|
||||
}
|
||||
@@ -0,0 +1,41 @@
|
||||
package storagecraft.tile.solderer;
|
||||
|
||||
import net.minecraft.init.Blocks;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import storagecraft.StorageCraftBlocks;
|
||||
import storagecraft.StorageCraftItems;
|
||||
import storagecraft.item.ItemProcessor;
|
||||
|
||||
public class SoldererRecipeCraftingGrid implements ISoldererRecipe
|
||||
{
|
||||
@Override
|
||||
public ItemStack getRow(int row)
|
||||
{
|
||||
if (row == 0)
|
||||
{
|
||||
return new ItemStack(StorageCraftItems.PROCESSOR, 1, ItemProcessor.TYPE_ADVANCED);
|
||||
}
|
||||
else if (row == 1)
|
||||
{
|
||||
return new ItemStack(StorageCraftBlocks.GRID, 1, 0);
|
||||
}
|
||||
else if (row == 2)
|
||||
{
|
||||
return new ItemStack(Blocks.crafting_table);
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack getResult()
|
||||
{
|
||||
return new ItemStack(StorageCraftBlocks.GRID, 1, 1);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getDuration()
|
||||
{
|
||||
return 500;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,41 @@
|
||||
package storagecraft.tile.solderer;
|
||||
|
||||
import net.minecraft.init.Blocks;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import storagecraft.StorageCraftBlocks;
|
||||
import storagecraft.StorageCraftItems;
|
||||
import storagecraft.item.ItemProcessor;
|
||||
|
||||
public class SoldererRecipeDrive implements ISoldererRecipe
|
||||
{
|
||||
@Override
|
||||
public ItemStack getRow(int row)
|
||||
{
|
||||
if (row == 0)
|
||||
{
|
||||
return new ItemStack(StorageCraftItems.PROCESSOR, 1, ItemProcessor.TYPE_ADVANCED);
|
||||
}
|
||||
else if (row == 1)
|
||||
{
|
||||
return new ItemStack(StorageCraftBlocks.MACHINE_CASING);
|
||||
}
|
||||
else if (row == 2)
|
||||
{
|
||||
return new ItemStack(Blocks.chest);
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack getResult()
|
||||
{
|
||||
return new ItemStack(StorageCraftBlocks.DRIVE);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getDuration()
|
||||
{
|
||||
return 400;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,49 @@
|
||||
package storagecraft.tile.solderer;
|
||||
|
||||
import net.minecraft.init.Items;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import storagecraft.StorageCraftItems;
|
||||
import storagecraft.item.ItemProcessor;
|
||||
|
||||
public class SoldererRecipePrintedProcessor implements ISoldererRecipe
|
||||
{
|
||||
private int type;
|
||||
|
||||
public SoldererRecipePrintedProcessor(int type)
|
||||
{
|
||||
this.type = type;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack getRow(int row)
|
||||
{
|
||||
if (row == 1)
|
||||
{
|
||||
switch (type)
|
||||
{
|
||||
case ItemProcessor.TYPE_PRINTED_BASIC:
|
||||
return new ItemStack(Items.iron_ingot);
|
||||
case ItemProcessor.TYPE_PRINTED_IMPROVED:
|
||||
return new ItemStack(Items.gold_ingot);
|
||||
case ItemProcessor.TYPE_PRINTED_ADVANCED:
|
||||
return new ItemStack(Items.diamond);
|
||||
case ItemProcessor.TYPE_PRINTED_SILICON:
|
||||
return new ItemStack(StorageCraftItems.SILICON);
|
||||
}
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack getResult()
|
||||
{
|
||||
return new ItemStack(StorageCraftItems.PROCESSOR, 1, type);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getDuration()
|
||||
{
|
||||
return 100;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,55 @@
|
||||
package storagecraft.tile.solderer;
|
||||
|
||||
import net.minecraft.init.Items;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import storagecraft.StorageCraftItems;
|
||||
import storagecraft.item.ItemProcessor;
|
||||
|
||||
public class SoldererRecipeProcessor implements ISoldererRecipe
|
||||
{
|
||||
private int type;
|
||||
|
||||
public SoldererRecipeProcessor(int type)
|
||||
{
|
||||
this.type = type;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack getRow(int row)
|
||||
{
|
||||
if (row == 0)
|
||||
{
|
||||
switch (type)
|
||||
{
|
||||
case ItemProcessor.TYPE_BASIC:
|
||||
return new ItemStack(StorageCraftItems.PROCESSOR, 1, ItemProcessor.TYPE_PRINTED_BASIC);
|
||||
case ItemProcessor.TYPE_IMPROVED:
|
||||
return new ItemStack(StorageCraftItems.PROCESSOR, 1, ItemProcessor.TYPE_PRINTED_IMPROVED);
|
||||
case ItemProcessor.TYPE_ADVANCED:
|
||||
return new ItemStack(StorageCraftItems.PROCESSOR, 1, ItemProcessor.TYPE_PRINTED_ADVANCED);
|
||||
}
|
||||
}
|
||||
else if (row == 1)
|
||||
{
|
||||
return new ItemStack(Items.redstone);
|
||||
}
|
||||
else if (row == 2)
|
||||
{
|
||||
return new ItemStack(StorageCraftItems.PROCESSOR, 1, ItemProcessor.TYPE_PRINTED_SILICON);
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack getResult()
|
||||
{
|
||||
return new ItemStack(StorageCraftItems.PROCESSOR, 1, type);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getDuration()
|
||||
{
|
||||
return 200;
|
||||
}
|
||||
}
|
||||
@@ -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