Induction Cell & Induction Provider recipes

This commit is contained in:
Aidan C. Brady 2015-03-04 20:35:52 -05:00
parent 6f0cf3a166
commit bb718de14b
5 changed files with 87 additions and 7 deletions

View file

@ -9,14 +9,13 @@ import mekanism.api.gas.IGasItem;
import mekanism.common.base.IEnergyCube;
import mekanism.common.base.IFactory;
import mekanism.common.block.BlockMachine.MachineType;
import mekanism.common.item.ItemBlockBasic;
import mekanism.common.recipe.MekanismRecipe;
import mekanism.common.util.MekanismUtils;
import net.minecraft.item.ItemStack;
import net.minecraft.item.crafting.CraftingManager;
import net.minecraft.item.crafting.IRecipe;
import net.minecraftforge.oredict.OreDictionary;
import codechicken.nei.PositionedStack;
import codechicken.nei.recipe.ShapedRecipeHandler;
@ -140,6 +139,13 @@ public class MekanismRecipeHandler extends ShapedRecipeHandler
return false;
}
}
else if(target.getItem() instanceof ItemBlockBasic && input.getItem() instanceof ItemBlockBasic)
{
if(((ItemBlockBasic)target.getItem()).getTier(target) != ((ItemBlockBasic)input.getItem()).getTier(input))
{
return false;
}
}
else if(target.getItem() instanceof IFactory && input.getItem() instanceof IFactory)
{
if(isFactory(target) && isFactory(input))

View file

@ -31,6 +31,8 @@ import mekanism.common.EnergyNetwork.EnergyTransferEvent;
import mekanism.common.FluidNetwork.FluidTransferEvent;
import mekanism.common.Tier.EnergyCubeTier;
import mekanism.common.Tier.FactoryTier;
import mekanism.common.Tier.InductionCellTier;
import mekanism.common.Tier.InductionProviderTier;
import mekanism.common.base.IFactory.RecipeType;
import mekanism.common.base.IModule;
import mekanism.common.content.boiler.BoilerManager;
@ -470,6 +472,34 @@ public class Mekanism
"ATA", "dEd", "ATA", Character.valueOf('A'), "alloyUltimate", Character.valueOf('d'), "gemDiamond", Character.valueOf('T'), MekanismItems.EnergyTablet.getUnchargedItem(), Character.valueOf('E'), MekanismUtils.getEnergyCube(EnergyCubeTier.ELITE)
}));
//Induction Cell recipes
CraftingManager.getInstance().getRecipeList().add(new MekanismRecipe(MekanismUtils.getInductionCell(InductionCellTier.BASIC), new Object[] {
"TTT", "TET", "TTT", Character.valueOf('T'), MekanismItems.EnergyTablet.getUnchargedItem(), Character.valueOf('E'), MekanismUtils.getEnergyCube(EnergyCubeTier.BASIC)
}));
CraftingManager.getInstance().getRecipeList().add(new MekanismRecipe(MekanismUtils.getInductionCell(InductionCellTier.ADVANCED), new Object[] {
"TCT", "CEC", "TCT", Character.valueOf('T'), MekanismItems.EnergyTablet.getUnchargedItem(), Character.valueOf('E'), MekanismUtils.getEnergyCube(EnergyCubeTier.ADVANCED), Character.valueOf('C'), MekanismUtils.getInductionCell(InductionCellTier.BASIC)
}));
CraftingManager.getInstance().getRecipeList().add(new MekanismRecipe(MekanismUtils.getInductionCell(InductionCellTier.ELITE), new Object[] {
"TCT", "CEC", "TCT", Character.valueOf('T'), MekanismItems.EnergyTablet.getUnchargedItem(), Character.valueOf('E'), MekanismUtils.getEnergyCube(EnergyCubeTier.ELITE), Character.valueOf('C'), MekanismUtils.getInductionCell(InductionCellTier.ADVANCED)
}));
CraftingManager.getInstance().getRecipeList().add(new MekanismRecipe(MekanismUtils.getInductionCell(InductionCellTier.ULTIMATE), new Object[] {
"TCT", "CEC", "TCT", Character.valueOf('T'), MekanismItems.EnergyTablet.getUnchargedItem(), Character.valueOf('E'), MekanismUtils.getEnergyCube(EnergyCubeTier.ULTIMATE), Character.valueOf('C'), MekanismUtils.getInductionCell(InductionCellTier.ELITE)
}));
//Induction Provider recipes
CraftingManager.getInstance().getRecipeList().add(new MekanismRecipe(MekanismUtils.getInductionProvider(InductionProviderTier.BASIC), new Object[] {
"CCC", "CEC", "CCC", Character.valueOf('C'), "circuitBasic", Character.valueOf('E'), MekanismUtils.getEnergyCube(EnergyCubeTier.BASIC)
}));
CraftingManager.getInstance().getRecipeList().add(new MekanismRecipe(MekanismUtils.getInductionProvider(InductionProviderTier.ADVANCED), new Object[] {
"CPC", "PEP", "CPC", Character.valueOf('C'), "circuitAdvanced", Character.valueOf('E'), MekanismUtils.getEnergyCube(EnergyCubeTier.ADVANCED), Character.valueOf('P'), MekanismUtils.getInductionProvider(InductionProviderTier.BASIC)
}));
CraftingManager.getInstance().getRecipeList().add(new MekanismRecipe(MekanismUtils.getInductionProvider(InductionProviderTier.ELITE), new Object[] {
"CPC", "PEP", "CPC", Character.valueOf('C'), "circuitElite", Character.valueOf('E'), MekanismUtils.getEnergyCube(EnergyCubeTier.ELITE), Character.valueOf('P'), MekanismUtils.getInductionProvider(InductionProviderTier.ADVANCED)
}));
CraftingManager.getInstance().getRecipeList().add(new MekanismRecipe(MekanismUtils.getInductionProvider(InductionProviderTier.ULTIMATE), new Object[] {
"CPC", "PEP", "CPC", Character.valueOf('C'), "circuitUltimate", Character.valueOf('E'), MekanismUtils.getEnergyCube(EnergyCubeTier.ULTIMATE), Character.valueOf('P'), MekanismUtils.getInductionProvider(InductionProviderTier.ELITE)
}));
//Circuit recipes
CraftingManager.getInstance().getRecipeList().add(new MekanismRecipe(new ItemStack(MekanismItems.ControlCircuit, 1, 1), new Object[] {
"ECE", Character.valueOf('C'), new ItemStack(MekanismItems.ControlCircuit, 1, 0), Character.valueOf('E'), "alloyAdvanced"

View file

@ -11,6 +11,7 @@ import mekanism.api.energy.IStrictEnergyStorage;
import mekanism.common.Mekanism;
import mekanism.common.MekanismBlocks;
import mekanism.common.Tier.BaseTier;
import mekanism.common.Tier.EnergyCubeTier;
import mekanism.common.Tier.InductionCellTier;
import mekanism.common.Tier.InductionProviderTier;
import mekanism.common.inventory.InventoryBin;
@ -67,6 +68,20 @@ public class ItemBlockBasic extends ItemBlock implements IEnergizedItem
setHasSubtypes(true);
}
public ItemStack getUnchargedCell(InductionCellTier tier)
{
ItemStack stack = new ItemStack(MekanismBlocks.BasicBlock2, 1, 3);
setTier(stack, tier.getBaseTier());
return stack;
}
public ItemStack getUnchargedProvider(InductionProviderTier tier)
{
ItemStack stack = new ItemStack(MekanismBlocks.BasicBlock2, 1, 4);
setTier(stack, tier.getBaseTier());
return stack;
}
public BaseTier getTier(ItemStack itemstack)
{
if(itemstack.stackTagCompound == null)
@ -132,7 +147,7 @@ public class ItemBlockBasic extends ItemBlock implements IEnergizedItem
}
}
if(getMaxEnergy(itemstack) > 0 && itemstack.stackTagCompound != null)
if(getMaxEnergy(itemstack) > 0)
{
list.add(EnumColor.BRIGHT_GREEN + MekanismUtils.localize("tooltip.storedEnergy") + ": " + EnumColor.GREY + MekanismUtils.getEnergyDisplay(getEnergy(itemstack)));
}

View file

@ -11,7 +11,7 @@ import mekanism.common.Upgrade;
import mekanism.common.base.IEnergyCube;
import mekanism.common.base.IFactory;
import mekanism.common.block.BlockMachine.MachineType;
import mekanism.common.item.ItemBlockBasic;
import net.minecraft.block.Block;
import net.minecraft.inventory.InventoryCrafting;
import net.minecraft.item.Item;
@ -375,6 +375,13 @@ public class MekanismRecipe implements IRecipe
return false;
}
}
else if(target.getItem() instanceof ItemBlockBasic && input.getItem() instanceof ItemBlockBasic)
{
if(((ItemBlockBasic)target.getItem()).getTier(target) != ((ItemBlockBasic)input.getItem()).getTier(input))
{
return false;
}
}
else if(target.getItem() instanceof IFactory && input.getItem() instanceof IFactory)
{
if(isFactory(target) && isFactory(input))

View file

@ -32,6 +32,8 @@ import mekanism.common.OreDictCache;
import mekanism.common.Teleporter;
import mekanism.common.Tier.EnergyCubeTier;
import mekanism.common.Tier.FactoryTier;
import mekanism.common.Tier.InductionCellTier;
import mekanism.common.Tier.InductionProviderTier;
import mekanism.common.Upgrade;
import mekanism.common.Version;
import mekanism.common.base.IActiveState;
@ -42,6 +44,7 @@ import mekanism.common.base.IModule;
import mekanism.common.base.IRedstoneControl;
import mekanism.common.base.IUpgradeTile;
import mekanism.common.inventory.container.ContainerElectricChest;
import mekanism.common.item.ItemBlockBasic;
import mekanism.common.item.ItemBlockEnergyCube;
import mekanism.common.item.ItemBlockGasTank;
import mekanism.common.network.PacketElectricChest.ElectricChestMessage;
@ -372,12 +375,31 @@ public final class MekanismUtils
/**
* Retrieves an empty Energy Cube with a defined tier.
* @param tier - tier to add to the Energy Cube
* @return empty energy cube with defined tier
* @return empty Energy Cube with defined tier
*/
public static ItemStack getEnergyCube(EnergyCubeTier tier)
{
ItemStack itemstack = ((ItemBlockEnergyCube)new ItemStack(MekanismBlocks.EnergyCube).getItem()).getUnchargedItem(tier);
return itemstack;
return ((ItemBlockEnergyCube)new ItemStack(MekanismBlocks.EnergyCube).getItem()).getUnchargedItem(tier);
}
/**
* Retrieves an empty Induction Cell with a defined tier.
* @param tier - tier to add to the Induction Cell
* @return empty Induction Cell with defined tier
*/
public static ItemStack getInductionCell(InductionCellTier tier)
{
return ((ItemBlockBasic)new ItemStack(MekanismBlocks.BasicBlock2, 1, 3).getItem()).getUnchargedCell(tier);
}
/**
* Retrieves an Induction Provider with a defined tier.
* @param tier - tier to add to the Induction Provider
* @return Induction Provider with defined tier
*/
public static ItemStack getInductionProvider(InductionProviderTier tier)
{
return ((ItemBlockBasic)new ItemStack(MekanismBlocks.BasicBlock2, 1, 4).getItem()).getUnchargedProvider(tier);
}
/**