Fixes some recipes not using the ore dict correctly.

(cherry picked from commit 3ee81c2)
This commit is contained in:
modmuss50 2017-03-09 20:35:07 +00:00
parent 1656b4b4a0
commit 76332ee946
No known key found for this signature in database
GPG key ID: 203A5ED4D3E48BEA
4 changed files with 60 additions and 26 deletions

View file

@ -38,6 +38,8 @@ import ic2.core.ref.TeBlock;
import net.minecraft.item.ItemStack;
import net.minecraftforge.oredict.OreDictionary;
import techreborn.Core;
import techreborn.api.recipe.machines.ExtractorRecipe;
import techreborn.items.ItemParts;
/**
* Created by modmuss50 on 16/07/2016.

View file

@ -279,7 +279,7 @@ public class ModRecipes {
new ItemStack(ModItems.LAPOTRONIC_ORB), 'C', new ItemStack(ModItems.ENERGY_CRYSTAL));
CraftingHelper.addShapedOreRecipe(new ItemStack(ModBlocks.INTERDIMENSIONAL_SU), "PAP", "ACA", "PAP", 'P',
ItemPlates.getPlateByName("iridium"), 'C', new ItemStack(Blocks.ENDER_CHEST), 'A',
"plateIridium", 'C', new ItemStack(Blocks.ENDER_CHEST), 'A',
new ItemStack(ModBlocks.ADJUSTABLE_SU));
CraftingHelper.addShapedOreRecipe(new ItemStack(ModBlocks.FUSION_CONTROL_COMPUTER), "CCC", "PTP", "CCC", 'P',
@ -342,7 +342,7 @@ public class ModRecipes {
CraftingHelper
.addShapedOreRecipe(ItemParts.getPartByName("CoolantSix"), "TCT", "TPT", "TCT", 'T', "ingotTin", 'C',
ItemParts.getPartByName("CoolantTriple"), 'P', ItemPlates.getPlateByName("copper"));
ItemParts.getPartByName("CoolantTriple"), 'P', "plateCopper");
CraftingHelper
.addShapedOreRecipe(ItemParts.getPartByName("NaKCoolantSimple"), "TST", "PCP", "TST", 'T', "ingotTin",
@ -368,7 +368,7 @@ public class ModRecipes {
CraftingHelper
.addShapedOreRecipe(new ItemStack(ModItems.NANOSABER), "DC ", "DC ", "GLG",
'L', new ItemStack(ModItems.LAPOTRONIC_CRYSTAL), 'C', ItemPlates.getPlateByName("carbon"), 'D', "plateDiamond",
'L', new ItemStack(ModItems.LAPOTRONIC_CRYSTAL), 'C', "plateCarbon", 'D', "plateDiamond",
'G', ItemDustsSmall.getSmallDustByName("glowstone"));
CraftingHelper.addShapedOreRecipe(ItemParts.getPartByName("diamondGrindingHead", 2), "TST", "SBS", "TST", 'T',
@ -825,7 +825,7 @@ public class ModRecipes {
CraftingHelper
.addShapedOreRecipe(new ItemStack(ModBlocks.ROLLING_MACHINE), "PCP", "MBM", "PCP", 'P', Blocks.PISTON,
'C', "circuitAdvanced", 'M', IC2Duplicates.COMPRESSOR.getStackBasedOnConfig(), 'B',
BlockMachineFrame.getFrameByName("machine", 1));
"machineBlockBasic");
// CraftingHelper.addShapedOreRecipe(new
// ItemStack(ModBlocks.electricCraftingTable),
@ -942,7 +942,7 @@ public class ModRecipes {
if (ConfigTechReborn.ExpensiveSolar && !IC2Duplicates.deduplicate())
CraftingHelper
.addShapedOreRecipe(IC2Duplicates.SOLAR_PANEL.getStackBasedOnConfig(), "PPP", "SZS", "CGC", 'P',
"paneGlass", 'S', ItemPlates.getPlateByName("lazurite"), 'Z',
"paneGlass", 'S', "platelazurite", 'Z',
"plateCarbon", 'G',
IC2Duplicates.GENERATOR.getStackBasedOnConfig(), 'C',
"circuitBasic");

View file

@ -50,9 +50,9 @@ public class CraftingTableRecipes extends RecipeMethods {
public static void init() {
registerCompressionRecipes();
registerMixedMetalIngotRecipes();
registerShapeless(BlockStorage2.getStorageBlockByName("iridium_reinforced_stone", 1), getStack(Blocks.STONE), getMaterial("iridium", Type.INGOT));
registerShapeless(BlockStorage2.getStorageBlockByName("iridium_reinforced_tungstensteel", 1), BlockStorage2.getStorageBlockByName("tungstensteel", 1), getMaterial("iridium", Type.INGOT));
registerShapeless(BlockStorage2.getStorageBlockByName("iridium_reinforced_tungstensteel", 1), BlockStorage2.getStorageBlockByName("iridium_reinforced_stone", 1), getMaterial("tungstensteel", Type.INGOT));
registerShapeless(BlockStorage2.getStorageBlockByName("iridium_reinforced_stone", 1), getStack(Blocks.STONE), getMaterialObject("iridium", Type.INGOT));
registerShapeless(BlockStorage2.getStorageBlockByName("iridium_reinforced_tungstensteel", 1), BlockStorage2.getStorageBlockByName("tungstensteel", 1), getMaterialObject("iridium", Type.INGOT));
registerShapeless(BlockStorage2.getStorageBlockByName("iridium_reinforced_tungstensteel", 1), BlockStorage2.getStorageBlockByName("iridium_reinforced_stone", 1), getMaterialObject("tungstensteel", Type.INGOT));
registerShapeless(getStack(ModBlocks.RUBBER_PLANKS, 4), getStack(ModBlocks.RUBBER_LOG));
@ -88,13 +88,13 @@ public class CraftingTableRecipes extends RecipeMethods {
registerShaped(getMaterial("insulatedcopper", 6, Type.CABLE), "RRR", "CCC", "RRR", 'R', "itemRubber", 'C', "ingotCopper");
registerShaped(getMaterial("insulatedcopper", 6, Type.CABLE), "RCR", "RCR", "RCR", 'R', "itemRubber", 'C', "ingotCopper");
registerShapeless(getMaterial("insulatedcopper", Type.CABLE), "itemRubber", getMaterial("copper", Type.CABLE));
registerShapeless(getMaterial("insulatedcopper", Type.CABLE), "itemRubber", getMaterialObject("copper", Type.CABLE));
registerShaped(getMaterial("insulatedgold", 4, Type.CABLE), "RRR", "RGR", "RRR", 'R', "itemRubber", 'G', "ingotGold");
registerShapeless(getMaterial("insulatedgold", Type.CABLE), "itemRubber", "itemRubber", getMaterial("gold", Type.CABLE));
registerShapeless(getMaterial("insulatedgold", Type.CABLE), "itemRubber", "itemRubber", getMaterialObject("gold", Type.CABLE));
registerShaped(getMaterial("insulatedhv", 4, Type.CABLE), "RRR", "RIR", "RRR", 'R', "itemRubber", 'I', "ingotRefinedIron");
registerShapeless(getMaterial("insulatedhv", Type.CABLE), "itemRubber", "itemRubber", getMaterial("hv", Type.CABLE));
registerShapeless(getMaterial("insulatedhv", Type.CABLE), "itemRubber", "itemRubber", getMaterialObject("hv", Type.CABLE));
registerShaped(getMaterial("glassfiber", 4, Type.CABLE), "GGG", "RDR", "GGG", 'R', "dustRedstone", 'D', "gemDiamond", 'G', "blockGlass");
registerShaped(getMaterial("glassfiber", 4, Type.CABLE), "GGG", "RDR", "GGG", 'R', "dustRedstone", 'D', "dustDiamond", 'G', "blockGlass");
@ -110,9 +110,9 @@ public class CraftingTableRecipes extends RecipeMethods {
}
if (!IC2Duplicates.deduplicate()) {
registerShapeless(getMaterial("carbon_fiber", Type.PART), getMaterial("coal", Type.DUST), getMaterial("coal", Type.DUST), getMaterial("coal", Type.DUST), getMaterial("coal", Type.DUST));
registerShapeless(getMaterial("carbon_fiber", Type.PART), getMaterial("carbon", Type.CELL), getMaterial("carbon", Type.CELL), getMaterial("carbon", Type.CELL), getMaterial("carbon", Type.CELL), getMaterial("carbon", Type.CELL), getMaterial("carbon", Type.CELL), getMaterial("carbon", Type.CELL), getMaterial("carbon", Type.CELL), getMaterial("carbon", Type.CELL));
registerShapeless(getMaterial("carbon_mesh", Type.PART), getMaterial("carbon_fiber", Type.PART), getMaterial("carbon_fiber", Type.PART));
registerShapeless(getMaterial("carbon_fiber", Type.PART), "dustCoal", "dustCoal", "dustCoal", "dustCoal");
registerShapeless(getMaterial("carbon_fiber", Type.PART), getMaterialObject("carbon", Type.CELL), getMaterialObject("carbon", Type.CELL), getMaterialObject("carbon", Type.CELL), getMaterialObject("carbon", Type.CELL), getMaterialObject("carbon", Type.CELL), getMaterialObject("carbon", Type.CELL), getMaterialObject("carbon", Type.CELL), getMaterialObject("carbon", Type.CELL), getMaterialObject("carbon", Type.CELL));
registerShapeless(getMaterial("carbon_mesh", Type.PART), getMaterialObject("carbon_fiber", Type.PART), getMaterialObject("carbon_fiber", Type.PART));
}
registerShaped(getMaterial("computer_monitor", Type.PART), "ADA", "DGD", "ADA", 'D', "dye", 'A', "ingotAluminum", 'G', "paneGlass");
@ -124,30 +124,30 @@ public class CraftingTableRecipes extends RecipeMethods {
if (!IC2Duplicates.deduplicate()) {
}
registerShaped(getMaterial("standard", 4, Type.MACHINE_CASING), "RRR", "CAC", "RRR", 'R', getStack(IC2Duplicates.REFINED_IRON), 'C', "circuitBasic", 'A', getMaterial("machine", Type.MACHINE_FRAME));
registerShaped(getMaterial("reinforced", 4, Type.MACHINE_CASING), "RRR", "CAC", "RRR", 'R', "ingotSteel", 'C', "circuitAdvanced", 'A', getMaterial("advanced_machine", Type.MACHINE_FRAME));
registerShaped(getMaterial("standard", 4, Type.MACHINE_CASING), "RRR", "CAC", "RRR", 'R', getStack(IC2Duplicates.REFINED_IRON), 'C', "circuitBasic", 'A', getMaterialObject("machine", Type.MACHINE_FRAME));
registerShaped(getMaterial("reinforced", 4, Type.MACHINE_CASING), "RRR", "CAC", "RRR", 'R', "ingotSteel", 'C', "circuitAdvanced", 'A', getMaterialObject("advanced_machine", Type.MACHINE_FRAME));
registerShaped(getMaterial("dataOrb", Type.PART), "DDD", "DID", "DDD", 'D', "circuitData", 'I', "circuitElite");
registerShaped(getMaterial("dataControlCircuit", 4, Type.PART), "CDC", "DID", "CDC", 'I', getMaterial("iridium", Type.PLATE), 'D', "circuitData", 'C', "circuitAdvanced");
registerShaped(getMaterial("dataControlCircuit", 4, Type.PART), "CDC", "DID", "CDC", 'I', getMaterialObject("iridium", Type.PLATE), 'D', "circuitData", 'C', "circuitAdvanced");
registerShaped(getStack(ModBlocks.THERMAL_GENERATOR), "III", "IRI", "CGC", 'I', "ingotInvar", 'R', ModBlocks.REINFORCED_GLASS, 'G', getStack(IC2Duplicates.GENERATOR), 'C', "circuitBasic");
if (!IC2Duplicates.deduplicate()) {
registerShaped(getStack(IC2Duplicates.HVT), "XHX", "XMX", "XHX", 'M', getStack(IC2Duplicates.MVT), 'H', getStack(IC2Duplicates.CABLE_IHV));
registerShaped(getStack(IC2Duplicates.MVT), "XGX", "XMX", "XGX", 'M', getMaterial("machine", Type.MACHINE_FRAME), 'G', getStack(IC2Duplicates.CABLE_IGOLD));
registerShaped(getStack(IC2Duplicates.MVT), "XGX", "XMX", "XGX", 'M', getMaterialObject("machine", Type.MACHINE_FRAME), 'G', getStack(IC2Duplicates.CABLE_IGOLD));
registerShaped(getStack(IC2Duplicates.LVT), "PWP", "CCC", "PPP", 'P', "plankWood", 'C', "ingotCopper", 'W', getStack(IC2Duplicates.CABLE_ICOPPER));
registerShaped(getStack(IC2Duplicates.BAT_BOX), "WCW", "BBB", "WWW", 'W', "plankWood", 'B', getStack(ModItems.RE_BATTERY), 'C', getStack(IC2Duplicates.CABLE_ICOPPER));
registerShaped(getStack(IC2Duplicates.MFE), "GEG", "EME", "GEG", 'M', getMaterial("machine", Type.MACHINE_FRAME), 'E', getStack(ModItems.ENERGY_CRYSTAL), 'G', getStack(IC2Duplicates.CABLE_IGOLD));
registerShaped(getStack(IC2Duplicates.MFSU), "LAL", "LML", "LOL", 'A', "circuitAdvanced", 'L', getStack(ModItems.LAPOTRONIC_CRYSTAL), 'M', getStack(IC2Duplicates.MFE), 'O', getMaterial("advanced_machine", Type.MACHINE_FRAME));
registerShaped(getStack(IC2Duplicates.COMPRESSOR), "SXS", "SCS", "SMS", 'C', "circuitBasic", 'M', getMaterial("machine", Type.MACHINE_FRAME), 'S', Blocks.STONE);
registerShaped(getStack(IC2Duplicates.MFE), "GEG", "EME", "GEG", 'M', getMaterialObject("machine", Type.MACHINE_FRAME), 'E', getStack(ModItems.ENERGY_CRYSTAL), 'G', getStack(IC2Duplicates.CABLE_IGOLD));
registerShaped(getStack(IC2Duplicates.MFSU), "LAL", "LML", "LOL", 'A', "circuitAdvanced", 'L', getStack(ModItems.LAPOTRONIC_CRYSTAL), 'M', getStack(IC2Duplicates.MFE), 'O', getMaterialObject("advanced_machine", Type.MACHINE_FRAME));
registerShaped(getStack(IC2Duplicates.COMPRESSOR), "SXS", "SCS", "SMS", 'C', "circuitBasic", 'M', getMaterialObject("machine", Type.MACHINE_FRAME), 'S', Blocks.STONE);
registerShaped(getStack(IC2Duplicates.ELECTRICAL_FURNACE), "XCX", "RFR", "XXX", 'C', "circuitBasic", 'F', getStack(IC2Duplicates.IRON_FURNACE), 'R', "dustRedstone");
registerShaped(getStack(IC2Duplicates.RECYCLER), "XEX", "DCD", "GDG", 'D', Blocks.DIRT, 'C', getStack(IC2Duplicates.COMPRESSOR), 'G', Items.GLOWSTONE_DUST, 'E', "circuitBasic");
registerShaped(getStack(IC2Duplicates.IRON_FURNACE), "III", "IXI", "III", 'I', "ingotIron");
registerShaped(getStack(IC2Duplicates.IRON_FURNACE), "XIX", "IXI", "IFI", 'I', "ingotIron", 'F', Blocks.FURNACE);
registerShaped(getMaterial("electronic_circuit", Type.PART), "WWW", "SRS", "WWW", 'R', getStack(IC2Duplicates.REFINED_IRON), 'S', Items.REDSTONE, 'W', getStack(IC2Duplicates.CABLE_ICOPPER));
registerShaped(getMaterial("advanced_circuit", Type.PART), "RGR", "LCL", "RGR", 'R', "dustRedstone", 'G', "dustGlowstone", 'L', "gemLapis", 'C', "circuitBasic");
registerShaped(getStack(IC2Duplicates.EXTRACTOR), "TMT", "TCT", "XXX", 'T', getStack(ModItems.TREE_TAP, true), 'M', getMaterial("machine", Type.MACHINE_FRAME), 'C', "circuitBasic");
registerShaped(getStack(IC2Duplicates.EXTRACTOR), "TMT", "TCT", "XXX", 'T', getStack(ModItems.TREE_TAP, true), 'M', getMaterialObject("machine", Type.MACHINE_FRAME), 'C', "circuitBasic");
}
registerShaped(getStack(ModBlocks.INDUSTRIAL_ELECTROLYZER), "RER", "CEC", "RER", 'R', getStack(IC2Duplicates.REFINED_IRON), 'E', getStack(IC2Duplicates.EXTRACTOR), 'C', "circuitAdvanced");
@ -160,10 +160,10 @@ public class CraftingTableRecipes extends RecipeMethods {
registerShaped(getStack(ModBlocks.INDUSTRIAL_CENTRIFUGE), "RCR", "AEA", "RCR", 'R', "ingotAluminium", 'E', getStack(IC2Duplicates.EXTRACTOR), 'A', "machineBlockAdvanced", 'C', "circuitAdvanced");
registerShaped(getStack(ModItems.ENERGY_CRYSTAL), "RRR", "RDR", "RRR", 'R', "dustRedstone", 'D', "gemDiamond");
registerShaped(getStack(ModItems.LAPOTRONIC_CRYSTAL), "LCL", "LEL", "LCL", 'L', "dyeBlue", 'E', "energyCrystal", 'C', "circuitBasic");
registerShapeless(getStack(IC2Duplicates.GENERATOR), getStack(ModItems.RE_BATTERY), getMaterial("machine", Type.MACHINE_FRAME), Blocks.FURNACE);
registerShapeless(getStack(IC2Duplicates.GENERATOR), getStack(ModItems.RE_BATTERY), getMaterialObject("machine", Type.MACHINE_FRAME), Blocks.FURNACE);
registerShaped(getMaterial("machine", Type.MACHINE_FRAME), "AAA", "AXA", "AAA", 'A', getStack(IC2Duplicates.REFINED_IRON));
registerShaped(getMaterial("advanced_machine", Type.MACHINE_FRAME), "XCX", "AMA", "XCX", 'A', "plateAdvancedAlloy", 'C', "plateCarbon", 'M', getMaterial("machine", Type.MACHINE_FRAME));
registerShaped(getMaterial("advanced_machine", Type.MACHINE_FRAME), "XCX", "AMA", "XCX", 'A', "plateAdvancedAlloy", 'C', "plateCarbon", 'M', getMaterialObject("machine", Type.MACHINE_FRAME));
registerShaped(getMaterial("data_storage_circuit", Type.PART), "EEE", "ECE", "EEE", 'E', "gemEmerald", 'C', "circuitBasic");
@ -303,8 +303,8 @@ public class CraftingTableRecipes extends RecipeMethods {
if (name.equals(ModItems.META_PLACEHOLDER)) {
continue;
}
registerShapeless(getMaterial(name, 4, Type.SMALL_DUST), getMaterial(name, Type.DUST));
registerShapeless(getMaterial(name, Type.DUST), getMaterial(name, Type.SMALL_DUST), getMaterial(name, Type.SMALL_DUST), getMaterial(name, Type.SMALL_DUST), getMaterial(name, Type.SMALL_DUST));
registerShapeless(getMaterial(name, 4, Type.SMALL_DUST), getMaterialObject(name, Type.DUST));
registerShapeless(getMaterial(name, Type.DUST), getMaterialObject(name, Type.SMALL_DUST), getMaterialObject(name, Type.SMALL_DUST), getMaterialObject(name, Type.SMALL_DUST), getMaterialObject(name, Type.SMALL_DUST));
}
for (String nuggets : ItemNuggets.types) {

View file

@ -29,6 +29,7 @@ import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraftforge.oredict.OreDictionary;
import reborncore.common.util.OreUtil;
import reborncore.common.util.StringUtils;
import techreborn.blocks.BlockMachineCasing;
import techreborn.blocks.BlockMachineFrame;
import techreborn.init.IC2Duplicates;
@ -70,10 +71,41 @@ public abstract class RecipeMethods {
return ItemStack.EMPTY;
}
static Object getMaterialObjectFromType(String name, Type type) {
Object object = null;
if (type == Type.DUST) {
object = "dust" + StringUtils.toFirstCapital(name);
} else if (type == Type.SMALL_DUST) {
object = "dust" + StringUtils.toFirstCapital(name);
} else if (type == Type.INGOT) {
object = "ingot" + StringUtils.toFirstCapital(name);
} else if (type == Type.GEM) {
object = "gem" + StringUtils.toFirstCapital(name);
} else if (type == Type.PLATE) {
object = "plate" + StringUtils.toFirstCapital(name);
} else if (type == Type.NUGGET) {
object = "nugget" + StringUtils.toFirstCapital(name);
}
if(object != null){
if(object instanceof String){
if(OreUtil.doesOreExistAndValid((String) object)){
return object;
}
} else {
return object;
}
}
return getMaterial(name, type);
}
static ItemStack getMaterial(String name, Type type) {
return getMaterial(name, 1, type);
}
static Object getMaterialObject(String name, Type type) {
return getMaterialObjectFromType(name, type);
}
static ItemStack getOre(String name, int count) {
return OreUtil.getStackFromName(name, count).copy();
}