mirror of
https://github.com/GTNewHorizons/EnderIO.git
synced 2026-10-26 14:24:40 +00:00
Fixed use of ore dictionary in recipes.
This commit is contained in:
1 parent
da9476a363
commit
3de9211b39
2 files changed
+38
-45
No files matched your search
@@ -173,30 +173,29 @@ public class EnderIO {
|
||||
itemMJReader = ItemMJReader.create();
|
||||
|
||||
MaterialRecipes.registerOresInDictionary();
|
||||
MachineRecipes.registerOresInDictionary();
|
||||
}
|
||||
|
||||
@EventHandler
|
||||
public void load(FMLInitializationEvent event) {
|
||||
|
||||
|
||||
instance = this;
|
||||
|
||||
|
||||
NetworkRegistry.instance().registerGuiHandler(this, guiHandler);
|
||||
MinecraftForge.EVENT_BUS.register(this);
|
||||
|
||||
|
||||
PacketHandler.instance.addPacketProcessor(new RedstoneModePacketProcessor());
|
||||
|
||||
|
||||
proxy.load();
|
||||
}
|
||||
|
||||
@EventHandler
|
||||
public void postInit(FMLPostInitializationEvent event) {
|
||||
|
||||
EnderfaceRecipes.addRecipes();
|
||||
MaterialRecipes.addRecipes();
|
||||
ConduitRecipes.addRecipes();
|
||||
MachineRecipes.addRecipes();
|
||||
|
||||
|
||||
proxy.load();
|
||||
}
|
||||
|
||||
@EventHandler
|
||||
public void postInit(FMLPostInitializationEvent event) {
|
||||
|
||||
CrusherRecipeManager.getInstance().loadRecipesFromConfig();
|
||||
MaterialRecipes.addOreDictionaryRecipes();
|
||||
MachineRecipes.addOreDictionaryRecipes();
|
||||
|
||||
@@ -16,28 +16,22 @@ import java.util.ArrayList;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.item.crafting.FurnaceRecipes;
|
||||
import net.minecraft.item.crafting.IRecipe;
|
||||
import net.minecraftforge.oredict.OreDictionary;
|
||||
import net.minecraftforge.oredict.ShapedOreRecipe;
|
||||
import cpw.mods.fml.common.registry.GameRegistry;
|
||||
import crazypants.enderio.ModObject;
|
||||
import crazypants.enderio.material.Alloy;
|
||||
import crazypants.enderio.material.MachinePart;
|
||||
import crazypants.enderio.material.PowderIngot;
|
||||
import crazypants.enderio.power.Capacitors;
|
||||
|
||||
|
||||
public class MachineRecipes {
|
||||
|
||||
public static void registerOresInDictionary() {
|
||||
OreDictionary.registerOre("ingotCopper", new ItemStack(ModObject.itemPowderIngot.actualId, 1, PowderIngot.INGOT_COPPER.ordinal()));
|
||||
}
|
||||
|
||||
public static void addRecipes() {
|
||||
ItemStack industialBinder = new ItemStack(itemIndustrialBinder.actualId, 1, 0);
|
||||
ItemStack capacitor = new ItemStack(itemBasicCapacitor.actualId, 1, 0);
|
||||
ItemStack stirlingGen = new ItemStack(blockStirlingGenerator.actualId, 1, 0);
|
||||
ItemStack basicGear = new ItemStack(ModObject.itemMachinePart.actualId, 1, MachinePart.BASIC_GEAR.ordinal());
|
||||
|
||||
ItemStack basicGear = new ItemStack(ModObject.itemMachinePart.actualId, 1, MachinePart.BASIC_GEAR.ordinal());
|
||||
|
||||
ItemStack painter = new ItemStack(blockPainter.actualId, 1, 0);
|
||||
ItemStack red = new ItemStack(Item.dyePowder, 1, 1);
|
||||
ItemStack green = new ItemStack(Item.dyePowder, 1, 2);
|
||||
@@ -51,8 +45,7 @@ public class MachineRecipes {
|
||||
|
||||
ItemStack alloySmelter = new ItemStack(blockAlloySmelter.actualId, 1, 0);
|
||||
GameRegistry.addShapedRecipe(alloySmelter, "bbb", "CfC", "bcb", 'b', industialBinder, 'f', Block.furnaceIdle, 'c', capacitor, 'C', Item.cauldron);
|
||||
|
||||
|
||||
|
||||
ItemStack solarPanel = new ItemStack(blockSolarPanel.actualId, 1, 0);
|
||||
ItemStack activatedIron = new ItemStack(ModObject.itemAlloy.actualId, 1, Alloy.ACTIVATED_IRON.ordinal());
|
||||
ItemStack activatedGold = new ItemStack(ModObject.itemAlloy.actualId, 1, Alloy.ACTIVATED_GOLD.ordinal());
|
||||
@@ -64,31 +57,32 @@ public class MachineRecipes {
|
||||
ItemStack electricLight = new ItemStack(blockElectricLight.actualId, 1, 0);
|
||||
ItemStack glowstone = new ItemStack(Item.glowstone);
|
||||
GameRegistry.addShapedRecipe(electricLight, "bqb", "bgb", "bcb", 'q', fusedQuartz, 'g', glowstone, 'b', industialBinder, 'c', capacitor);
|
||||
|
||||
|
||||
ItemStack activtedCapacitor = new ItemStack(itemBasicCapacitor.actualId, 1, Capacitors.ACTIVATED_CAPACITOR.ordinal());
|
||||
ItemStack capacitorBank = new ItemStack(blockCapacitorBank.actualId,1,0);
|
||||
GameRegistry.addShapedRecipe(capacitorBank , "bab", "aca", "bab", 'a', activtedCapacitor,'b', industialBinder, 'c', capacitor);
|
||||
|
||||
ItemStack capacitorBank = new ItemStack(blockCapacitorBank.actualId, 1, 0);
|
||||
GameRegistry.addShapedRecipe(capacitorBank, "bab", "aca", "bab", 'a', activtedCapacitor, 'b', industialBinder, 'c', capacitor);
|
||||
|
||||
ItemStack enderCapacitor = new ItemStack(itemBasicCapacitor.actualId, 1, Capacitors.ENDER_CAPACITOR.ordinal());
|
||||
ItemStack tesseract = new ItemStack(ModObject.blockHyperCube.actualId, 1, 0);
|
||||
ItemStack obsidian = new ItemStack(Block.obsidian);
|
||||
ItemStack obsidian = new ItemStack(Block.obsidian);
|
||||
ItemStack enderPearl = new ItemStack(Item.enderPearl);
|
||||
GameRegistry.addShapedRecipe(tesseract, "oeo", "e e", "oco", 'o', obsidian,'e', enderPearl, 'c', enderCapacitor);
|
||||
|
||||
}
|
||||
//To-do: Sort this class
|
||||
public static void addOreDictionaryRecipes() {
|
||||
ItemStack capacitor = new ItemStack(itemBasicCapacitor.actualId, 1, 0);
|
||||
ItemStack crusher = new ItemStack(blockCrusher.actualId, 1, 0);
|
||||
ItemStack machineChassi = new ItemStack(ModObject.itemMachinePart.actualId, 1, MachinePart.MACHINE_CHASSI.ordinal());
|
||||
int ingotCopper = OreDictionary.getOreID("ingotCopper");
|
||||
|
||||
if(!OreDictionary.getOres("ingotCopper").isEmpty()) {
|
||||
GameRegistry.addShapedRecipe(crusher, "frf", "cmc", "cpc", 'c', ingotCopper, 'm', machineChassi, 'f', Item.flint, 'p', Block.pistonBase, 'r', capacitor);
|
||||
}
|
||||
else {
|
||||
GameRegistry.addShapedRecipe(crusher, "frf", "imi", "ipi", 'i', Item.ingotIron, 'm', machineChassi, 'f', Item.flint, 'p', Block.pistonBase, 'r', capacitor);
|
||||
GameRegistry.addShapedRecipe(tesseract, "oeo", "e e", "oco", 'o', obsidian, 'e', enderPearl, 'c', enderCapacitor);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
public static void addOreDictionaryRecipes() {
|
||||
ItemStack capacitor = new ItemStack(itemBasicCapacitor.actualId, 1, 0);
|
||||
ItemStack crusher = new ItemStack(blockCrusher.actualId, 1, 0);
|
||||
ItemStack machineChassi = new ItemStack(ModObject.itemMachinePart.actualId, 1, MachinePart.MACHINE_CHASSI.ordinal());
|
||||
|
||||
ArrayList<ItemStack> copperIngots = OreDictionary.getOres("ingotCopper");
|
||||
if(copperIngots != null && !copperIngots.isEmpty()) {
|
||||
GameRegistry.addRecipe(new ShapedOreRecipe(crusher, "frf", "cmc", "cpc", 'c', "ingotCopper", 'm', machineChassi, 'f', Item.flint, 'p', Block.pistonBase,
|
||||
'r', capacitor));
|
||||
} else {
|
||||
GameRegistry
|
||||
.addShapedRecipe(crusher, "frf", "imi", "ipi", 'i', Item.ingotIron, 'm', machineChassi, 'f', Item.flint, 'p', Block.pistonBase, 'r', capacitor);
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user