Added UE integration for recipes

This commit is contained in:
Calclavia 2013-08-12 19:05:59 +08:00
parent 507f4cc06f
commit 53054f6c5e
5 changed files with 25 additions and 16 deletions

6
.gitmodules vendored
View file

@ -1,3 +1,3 @@
[submodule "Universal-Electricity"]
path = Universal-Electricity
url = https://github.com/Universal-Electricity/Universal-Electricity
[submodule "Modding-Library"]
path = Modding-Library
url = git@bitbucket.org:calclavia/modding-library.git

1
Modding-Library Submodule

@ -0,0 +1 @@
Subproject commit 48d87abf9bb204dffec63ebedaeffce0c998e29f

@ -1 +0,0 @@
Subproject commit 3538b31ba452890fa742b472df2fb9d1555a61cd

View file

@ -13,6 +13,8 @@ import net.minecraftforge.oredict.ShapedOreRecipe;
import org.modstats.ModstatInfo;
import org.modstats.Modstats;
import basiccomponents.api.BasicRegistry;
import calclavia.lib.UniversalRecipes;
import resonantinduction.battery.BlockBattery;
import resonantinduction.battery.ItemCapacitor;
import resonantinduction.battery.TileEntityBattery;
@ -100,7 +102,7 @@ public class ResonantInduction
* Settings
*/
public static final Configuration CONFIGURATION = new Configuration(new File(Loader.instance().getConfigDir(), NAME + ".cfg"));
public static float POWER_PER_COAL = 5;
public static float FURNACE_WATTAGE = 4;
public static boolean SOUND_FXS = true;
/** Block ID by Jyzarc */
@ -144,7 +146,7 @@ public class ResonantInduction
CONFIGURATION.load();
// Config
POWER_PER_COAL = (float) CONFIGURATION.get(Configuration.CATEGORY_GENERAL, "Coal Wattage", POWER_PER_COAL).getDouble(POWER_PER_COAL);
FURNACE_WATTAGE = (float) CONFIGURATION.get(Configuration.CATEGORY_GENERAL, "Furnace Wattage", FURNACE_WATTAGE).getDouble(FURNACE_WATTAGE);
SOUND_FXS = CONFIGURATION.get(Configuration.CATEGORY_GENERAL, "Tesla Sound FXs", SOUND_FXS).getBoolean(SOUND_FXS);
MAX_CONTRACTOR_DISTANCE = CONFIGURATION.get(Configuration.CATEGORY_GENERAL, "Max EM Contractor Path", MAX_CONTRACTOR_DISTANCE).getInt(MAX_CONTRACTOR_DISTANCE);
@ -187,6 +189,11 @@ public class ResonantInduction
ResonantInduction.proxy.registerRenderers();
TabRI.ITEMSTACK = new ItemStack(blockBattery);
// Basic Components
BasicRegistry.register("itemIngotSteel");
BasicRegistry.register("itemPlateSteel");
BasicRegistry.register("itemIngotBronze");
}
@EventHandler
@ -214,26 +221,28 @@ public class ResonantInduction
ItemStack emptyCapacitor = new ItemStack(itemCapacitor);
((IItemElectric) itemCapacitor).setElectricity(emptyCapacitor, 0);
final ItemStack defaultWire = new ItemStack(blockWire, 1, EnumWire.IRON.ordinal());
/** Capacitor **/
GameRegistry.addRecipe(new ShapedOreRecipe(emptyCapacitor, "RRR", "RIR", "RRR", 'R', Item.redstone, 'I', Item.ingotIron));
GameRegistry.addRecipe(new ShapedOreRecipe(emptyCapacitor, "RRR", "RIR", "RRR", 'R', Item.redstone, 'I', UniversalRecipes.PRIMARY_METAL));
/** Linker **/
GameRegistry.addRecipe(new ShapedOreRecipe(itemLinker, " E ", "GCG", " E ", 'E', Item.eyeOfEnder, 'C', emptyCapacitor, 'G', Item.ingotGold));
GameRegistry.addRecipe(new ShapedOreRecipe(itemLinker, " E ", "GCG", " E ", 'E', Item.eyeOfEnder, 'C', emptyCapacitor, 'G', UniversalRecipes.SECONDARY_METAL));
/** Quantum Entangler **/
GameRegistry.addRecipe(new ShapedOreRecipe(itemQuantumEntangler, "EEE", "ILI", "EEE", 'E', Item.eyeOfEnder, 'L', itemLinker, 'I', Item.ingotIron));
GameRegistry.addRecipe(new ShapedOreRecipe(itemQuantumEntangler, "EEE", "ILI", "EEE", 'E', Item.eyeOfEnder, 'L', itemLinker, 'I', UniversalRecipes.PRIMARY_METAL));
/** Tesla - by Jyzarc */
GameRegistry.addRecipe(new ShapedOreRecipe(blockTesla, "EEE", " C ", " I ", 'E', Item.eyeOfEnder, 'C', emptyCapacitor, 'I', Block.blockIron));
GameRegistry.addRecipe(new ShapedOreRecipe(blockTesla, "WEW", " C ", " I ", 'W', defaultWire, 'E', Item.eyeOfEnder, 'C', emptyCapacitor, 'I', UniversalRecipes.PRIMARY_PLATE));
/** Multimeter */
GameRegistry.addRecipe(new ShapedOreRecipe(blockMultimeter, "RRR", "ICI", "III", 'R', Item.redstone, 'C', emptyCapacitor, 'I', Item.ingotIron));
GameRegistry.addRecipe(new ShapedOreRecipe(blockMultimeter, "WWW", "ICI", 'W', defaultWire, 'C', emptyCapacitor, 'I', UniversalRecipes.PRIMARY_METAL));
/** Multimeter */
GameRegistry.addRecipe(new ShapedOreRecipe(blockBattery, "III", "IRI", "III", 'R', Block.blockRedstone, 'I', Item.ingotIron));
GameRegistry.addRecipe(new ShapedOreRecipe(blockBattery, "III", "IRI", "III", 'R', Block.blockRedstone, 'I', UniversalRecipes.PRIMARY_METAL));
/** EM Contractor */
GameRegistry.addRecipe(new ShapedOreRecipe(blockEMContractor, " I ", "GCG", "WWW", 'W', Block.wood, 'C', emptyCapacitor, 'G', Item.ingotGold, 'I', Item.ingotIron));
GameRegistry.addRecipe(new ShapedOreRecipe(blockEMContractor, " I ", "GCG", "WWW", 'W', UniversalRecipes.PRIMARY_METAL, 'C', emptyCapacitor, 'G', UniversalRecipes.SECONDARY_METAL, 'I', UniversalRecipes.PRIMARY_METAL));
/** Wires **/
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(blockWire, 1, EnumWire.COPPER.ordinal()), "MMM", 'M', "ingotCopper"));

View file

@ -268,7 +268,7 @@ public class TileEntityTesla extends TileEntityUniversalElectrical implements IT
}
else
{
this.transfer(ResonantInduction.POWER_PER_COAL / 20, true);
this.transfer(ResonantInduction.FURNACE_WATTAGE / 20, true);
}
if (doBlockStateUpdate != furnaceTile.furnaceBurnTime > 0)
@ -276,7 +276,7 @@ public class TileEntityTesla extends TileEntityUniversalElectrical implements IT
BlockFurnace.updateFurnaceBlockState(furnaceTile.furnaceBurnTime > 0, furnaceTile.worldObj, furnaceTile.xCoord, furnaceTile.yCoord, furnaceTile.zCoord);
}
}
else if (this.getEnergyStored() > ResonantInduction.POWER_PER_COAL / 20 && furnaceTile.getStackInSlot(1) == null && FurnaceRecipes.smelting().getSmeltingResult(furnaceTile.getStackInSlot(0)) != null)
else if (this.getEnergyStored() > ResonantInduction.FURNACE_WATTAGE / 20 && furnaceTile.getStackInSlot(1) == null && FurnaceRecipes.smelting().getSmeltingResult(furnaceTile.getStackInSlot(0)) != null)
{
/**
* Inject power to furnace.
@ -284,7 +284,7 @@ public class TileEntityTesla extends TileEntityUniversalElectrical implements IT
boolean doBlockStateUpdate = furnaceTile.furnaceBurnTime > 0;
furnaceTile.furnaceBurnTime += 2;
this.transfer(-ResonantInduction.POWER_PER_COAL / 20, true);
this.transfer(-ResonantInduction.FURNACE_WATTAGE / 20, true);
if (doBlockStateUpdate != furnaceTile.furnaceBurnTime > 0)
{