Fix a bunch of issues with recipes

This commit is contained in:
modmuss50 2017-06-25 14:15:01 +01:00
parent a774b2bcb2
commit f56ffa9eed
No known key found for this signature in database
GPG key ID: 773D17BE8BF49C82
3 changed files with 43 additions and 45 deletions

View file

@ -121,6 +121,9 @@ public class ModRecipes {
2)); 2));
for (String ore : OreUtil.oreNames) { for (String ore : OreUtil.oreNames) {
if(ore.equals("iridium")){
continue;
}
if (OreUtil.doesOreExistAndValid("plate" + OreUtil.capitalizeFirstLetter(ore)) && OreUtil.doesOreExistAndValid("ingot" + OreUtil.capitalizeFirstLetter(ore))) { if (OreUtil.doesOreExistAndValid("plate" + OreUtil.capitalizeFirstLetter(ore)) && OreUtil.doesOreExistAndValid("ingot" + OreUtil.capitalizeFirstLetter(ore))) {
RecipeHandler.addRecipe( RecipeHandler.addRecipe(
@ -491,7 +494,7 @@ public class ModRecipes {
// Brass // Brass
if (OreUtil.doesOreExistAndValid("ingotBrass")) { if (OreUtil.doesOreExistAndValid("ingotBrass")) {
ItemStack brassStack = OreDictionary.getOres("ingotBrass").get(0); ItemStack brassStack = getOre("ingotBrass");
brassStack.setCount(4); brassStack.setCount(4);
RecipeHandler.addRecipe( RecipeHandler.addRecipe(
new AlloySmelterRecipe(ItemIngots.getIngotByName("copper", 3), ItemIngots.getIngotByName("zinc", 1), new AlloySmelterRecipe(ItemIngots.getIngotByName("copper", 3), ItemIngots.getIngotByName("zinc", 1),
@ -509,7 +512,7 @@ public class ModRecipes {
// Red Alloy // Red Alloy
if (OreUtil.doesOreExistAndValid("ingotRedAlloy")) { if (OreUtil.doesOreExistAndValid("ingotRedAlloy")) {
ItemStack redAlloyStack = OreDictionary.getOres("ingotRedAlloy").get(0); ItemStack redAlloyStack = getOre("ingotRedAlloy");
redAlloyStack.setCount(1); redAlloyStack.setCount(1);
RecipeHandler.addRecipe( RecipeHandler.addRecipe(
new AlloySmelterRecipe(new ItemStack(Items.REDSTONE, 4), ItemIngots.getIngotByName("copper", 1), new AlloySmelterRecipe(new ItemStack(Items.REDSTONE, 4), ItemIngots.getIngotByName("copper", 1),
@ -521,7 +524,7 @@ public class ModRecipes {
// Blue Alloy // Blue Alloy
if (OreUtil.doesOreExistAndValid("ingotBlueAlloy")) { if (OreUtil.doesOreExistAndValid("ingotBlueAlloy")) {
ItemStack blueAlloyStack = OreDictionary.getOres("ingotBlueAlloy").get(0); ItemStack blueAlloyStack = getOre("ingotBlueAlloy");
blueAlloyStack.setCount(1); blueAlloyStack.setCount(1);
RecipeHandler.addRecipe(new AlloySmelterRecipe(ItemDusts.getDustByName("teslatite", 4), RecipeHandler.addRecipe(new AlloySmelterRecipe(ItemDusts.getDustByName("teslatite", 4),
ItemIngots.getIngotByName("silver", 1), blueAlloyStack, 200, 16)); ItemIngots.getIngotByName("silver", 1), blueAlloyStack, 200, 16));
@ -529,9 +532,9 @@ public class ModRecipes {
// Blue Alloy // Blue Alloy
if (OreUtil.doesOreExistAndValid("ingotPurpleAlloy") && OreUtil.doesOreExistAndValid("dustInfusedTeslatite")) { if (OreUtil.doesOreExistAndValid("ingotPurpleAlloy") && OreUtil.doesOreExistAndValid("dustInfusedTeslatite")) {
ItemStack purpleAlloyStack = OreDictionary.getOres("ingotPurpleAlloy").get(0); ItemStack purpleAlloyStack = getOre("ingotPurpleAlloy");
purpleAlloyStack.setCount(1); purpleAlloyStack.setCount(1);
ItemStack infusedTeslatiteStack = OreDictionary.getOres("ingotPurpleAlloy").get(0); ItemStack infusedTeslatiteStack = getOre("ingotPurpleAlloy");
infusedTeslatiteStack.setCount(8); infusedTeslatiteStack.setCount(8);
RecipeHandler.addRecipe(new AlloySmelterRecipe(ItemIngots.getIngotByName("redAlloy", 1), RecipeHandler.addRecipe(new AlloySmelterRecipe(ItemIngots.getIngotByName("redAlloy", 1),
ItemIngots.getIngotByName("blueAlloy", 1), purpleAlloyStack, 200, 16)); ItemIngots.getIngotByName("blueAlloy", 1), purpleAlloyStack, 200, 16));
@ -542,7 +545,7 @@ public class ModRecipes {
// Aluminum Brass // Aluminum Brass
if (OreUtil.doesOreExistAndValid("ingotAluminumBrass")) { if (OreUtil.doesOreExistAndValid("ingotAluminumBrass")) {
ItemStack aluminumBrassStack = OreDictionary.getOres("ingotAluminumBrass").get(0); ItemStack aluminumBrassStack = getOre("ingotAluminumBrass");
aluminumBrassStack.setCount(4); aluminumBrassStack.setCount(4);
RecipeHandler.addRecipe(new AlloySmelterRecipe(ItemIngots.getIngotByName("copper", 3), RecipeHandler.addRecipe(new AlloySmelterRecipe(ItemIngots.getIngotByName("copper", 3),
ItemIngots.getIngotByName("aluminum", 1), aluminumBrassStack, 200, 16)); ItemIngots.getIngotByName("aluminum", 1), aluminumBrassStack, 200, 16));
@ -558,18 +561,18 @@ public class ModRecipes {
// Manyullyn // Manyullyn
if (OreUtil.doesOreExistAndValid("ingotManyullyn") && OreUtil.doesOreExistAndValid("ingotCobalt") && OreUtil if (OreUtil.doesOreExistAndValid("ingotManyullyn") && OreUtil.doesOreExistAndValid("ingotCobalt") && OreUtil
.doesOreExistAndValid("ingotArdite")) { .doesOreExistAndValid("ingotArdite")) {
ItemStack manyullynStack = OreDictionary.getOres("ingotManyullyn").get(0); ItemStack manyullynStack = getOre("ingotManyullyn");
manyullynStack.setCount(1); manyullynStack.setCount(1);
ItemStack cobaltStack = OreDictionary.getOres("ingotCobalt").get(0); ItemStack cobaltStack = getOre("ingotCobalt");
cobaltStack.setCount(1); cobaltStack.setCount(1);
ItemStack arditeStack = OreDictionary.getOres("ingotArdite").get(0); ItemStack arditeStack = getOre("ingotArdite");
arditeStack.setCount(1); arditeStack.setCount(1);
RecipeHandler.addRecipe(new AlloySmelterRecipe(cobaltStack, arditeStack, manyullynStack, 200, 16)); RecipeHandler.addRecipe(new AlloySmelterRecipe(cobaltStack, arditeStack, manyullynStack, 200, 16));
} }
// Conductive Iron // Conductive Iron
if (OreUtil.doesOreExistAndValid("ingotConductiveIron")) { if (OreUtil.doesOreExistAndValid("ingotConductiveIron")) {
ItemStack conductiveIronStack = OreDictionary.getOres("ingotConductiveIron").get(0); ItemStack conductiveIronStack = getOre("ingotConductiveIron");
conductiveIronStack.setCount(1); conductiveIronStack.setCount(1);
RecipeHandler.addRecipe( RecipeHandler.addRecipe(
new AlloySmelterRecipe(new ItemStack(Items.REDSTONE, 1), new ItemStack(Items.IRON_INGOT, 1), new AlloySmelterRecipe(new ItemStack(Items.REDSTONE, 1), new ItemStack(Items.IRON_INGOT, 1),
@ -578,9 +581,9 @@ public class ModRecipes {
// Redstone Alloy // Redstone Alloy
if (OreUtil.doesOreExistAndValid("ingotRedstoneAlloy") && OreUtil.doesOreExistAndValid("itemSilicon")) { if (OreUtil.doesOreExistAndValid("ingotRedstoneAlloy") && OreUtil.doesOreExistAndValid("itemSilicon")) {
ItemStack redstoneAlloyStack = OreDictionary.getOres("ingotRedstoneAlloy").get(0); ItemStack redstoneAlloyStack = getOre("ingotRedstoneAlloy");
redstoneAlloyStack.setCount(1); redstoneAlloyStack.setCount(1);
ItemStack siliconStack = OreDictionary.getOres("itemSilicon").get(0); ItemStack siliconStack = getOre("itemSilicon");
siliconStack.setCount(1); siliconStack.setCount(1);
RecipeHandler.addRecipe( RecipeHandler.addRecipe(
new AlloySmelterRecipe(new ItemStack(Items.REDSTONE, 1), siliconStack, redstoneAlloyStack, 200, new AlloySmelterRecipe(new ItemStack(Items.REDSTONE, 1), siliconStack, redstoneAlloyStack, 200,
@ -589,7 +592,7 @@ public class ModRecipes {
// Pulsating Iron // Pulsating Iron
if (OreUtil.doesOreExistAndValid("ingotPhasedIron")) { if (OreUtil.doesOreExistAndValid("ingotPhasedIron")) {
ItemStack pulsatingIronStack = OreDictionary.getOres("ingotPhasedIron").get(0); ItemStack pulsatingIronStack = getOre("ingotPhasedIron");
pulsatingIronStack.setCount(1); pulsatingIronStack.setCount(1);
RecipeHandler.addRecipe( RecipeHandler.addRecipe(
new AlloySmelterRecipe(new ItemStack(Items.IRON_INGOT, 1), new ItemStack(Items.ENDER_PEARL, 1), new AlloySmelterRecipe(new ItemStack(Items.IRON_INGOT, 1), new ItemStack(Items.ENDER_PEARL, 1),
@ -601,9 +604,9 @@ public class ModRecipes {
// Vibrant Alloy // Vibrant Alloy
if (OreUtil.doesOreExistAndValid("ingotEnergeticAlloy") && OreUtil.doesOreExistAndValid("ingotPhasedGold")) { if (OreUtil.doesOreExistAndValid("ingotEnergeticAlloy") && OreUtil.doesOreExistAndValid("ingotPhasedGold")) {
ItemStack energeticAlloyStack = OreDictionary.getOres("ingotEnergeticAlloy").get(0); ItemStack energeticAlloyStack = getOre("ingotEnergeticAlloy");
energeticAlloyStack.setCount(1); energeticAlloyStack.setCount(1);
ItemStack vibrantAlloyStack = OreDictionary.getOres("ingotPhasedGold").get(0); ItemStack vibrantAlloyStack = getOre("ingotPhasedGold");
vibrantAlloyStack.setCount(1); vibrantAlloyStack.setCount(1);
RecipeHandler.addRecipe( RecipeHandler.addRecipe(
new AlloySmelterRecipe(energeticAlloyStack, new ItemStack(Items.ENDER_PEARL, 1), vibrantAlloyStack, new AlloySmelterRecipe(energeticAlloyStack, new ItemStack(Items.ENDER_PEARL, 1), vibrantAlloyStack,
@ -615,7 +618,7 @@ public class ModRecipes {
// Soularium // Soularium
if (OreUtil.doesOreExistAndValid("ingotSoularium")) { if (OreUtil.doesOreExistAndValid("ingotSoularium")) {
ItemStack soulariumStack = OreDictionary.getOres("ingotSoularium").get(0); ItemStack soulariumStack = getOre("ingotSoularium");
soulariumStack.setCount(1); soulariumStack.setCount(1);
RecipeHandler.addRecipe( RecipeHandler.addRecipe(
new AlloySmelterRecipe(new ItemStack(Blocks.SOUL_SAND, 1), new ItemStack(Items.GOLD_INGOT, 1), new AlloySmelterRecipe(new ItemStack(Blocks.SOUL_SAND, 1), new ItemStack(Items.GOLD_INGOT, 1),
@ -797,7 +800,7 @@ public class ModRecipes {
BlockMachineFrames.getFrameByName("advancedMachine", 1), 'F', IC2Duplicates.ELECTRICAL_FURNACE.getStackBasedOnConfig()); BlockMachineFrames.getFrameByName("advancedMachine", 1), 'F', IC2Duplicates.ELECTRICAL_FURNACE.getStackBasedOnConfig());
RebornCraftingHelper.addShapedOreRecipe(new ItemStack(ModBlocks.INDUSTRIAL_GRINDER), "ECG", "HHH", "CBC", 'E', RebornCraftingHelper.addShapedOreRecipe(new ItemStack(ModBlocks.INDUSTRIAL_GRINDER), "ECG", "HHH", "CBC", 'E',
ModBlocks.INDUSTRIAL_ELECTROLYZER, 'H', "craftingGrinder", 'C', ModBlocks.INDUSTRIAL_ELECTROLYZER, 'H', "craftingDiamondGrinder", 'C',
"circuitAdvanced", 'B', "machineBlockAdvanced", "circuitAdvanced", 'B', "machineBlockAdvanced",
'G', IC2Duplicates.GRINDER.getStackBasedOnConfig()); 'G', IC2Duplicates.GRINDER.getStackBasedOnConfig());
@ -899,15 +902,15 @@ public class ModRecipes {
1F); 1F);
RebornCraftingHelper RebornCraftingHelper
.addShapedOreRecipe((OreDictionary.getOres("oreIridium").get(0)), "UUU", " U ", "UUU", 'U', .addShapedOreRecipe((getOre("oreIridium")), "UUU", " U ", "UUU", 'U',
ModItems.UU_MATTER); ModItems.UU_MATTER);
// Chemical Reactor // Chemical Reactor
RecipeHandler.addRecipe(new ChemicalReactorRecipe(ItemDusts.getDustByName("calcite", 1), null, RecipeHandler.addRecipe(new ChemicalReactorRecipe(ItemDusts.getDustByName("calcite", 1), null,
new ItemStack(OreDictionary.getOres("fertilizer").get(0).getItem(), 1), 100, 30)); new ItemStack(getOre("fertilizer").getItem(), 1), 100, 30));
RecipeHandler.addRecipe(new ChemicalReactorRecipe(ItemDusts.getDustByName("calcite", 1), RecipeHandler.addRecipe(new ChemicalReactorRecipe(ItemDusts.getDustByName("calcite", 1),
ItemDusts.getDustByName("phosphorous", 1), ItemDusts.getDustByName("phosphorous", 1),
new ItemStack(OreDictionary.getOres("fertilizer").get(0).getItem(), 3), 100, 30)); new ItemStack(getOre("fertilizer").getItem(), 3), 100, 30));
RecipeHandler.addRecipe(new ChemicalReactorRecipe(ItemCells.getCellByName("sodiumSulfide", 1), RecipeHandler.addRecipe(new ChemicalReactorRecipe(ItemCells.getCellByName("sodiumSulfide", 1),
ItemCells.getCellByName("empty"), ItemCells.getCellByName("sodiumPersulfate", 2), 2000, ItemCells.getCellByName("empty"), ItemCells.getCellByName("sodiumPersulfate", 2), 2000,
30)); 30));
@ -916,7 +919,7 @@ public class ModRecipes {
RecipeHandler.addRecipe( RecipeHandler.addRecipe(
new ChemicalReactorRecipe(ItemDusts.getDustByName("calcite", 1), ItemDusts.getDustByName("sulfur", 1), new ChemicalReactorRecipe(ItemDusts.getDustByName("calcite", 1), ItemDusts.getDustByName("sulfur", 1),
new ItemStack(OreDictionary.getOres("fertilizer").get(0).getItem(), 2), 100, 30)); new ItemStack(getOre("fertilizer").getItem(), 2), 100, 30));
ItemStack waterCells = ItemCells.getCellByName("water").copy(); ItemStack waterCells = ItemCells.getCellByName("water").copy();
waterCells.setCount(2); waterCells.setCount(2);

View file

@ -90,10 +90,9 @@ public class OreDict {
//OreDictionary.registerOre("woodRubber", ModBlocks.RUBBER_LOG); //OreDictionary.registerOre("woodRubber", ModBlocks.RUBBER_LOG);
OreDictionary.registerOre("glassReinforced", ModBlocks.REINFORCED_GLASS); OreDictionary.registerOre("glassReinforced", ModBlocks.REINFORCED_GLASS);
OreDictionary.registerOre("craftingGrinder", ItemParts.getPartByName("diamondGrindingHead")); OreDictionary.registerOre("craftingDiamondGrinder", ItemParts.getPartByName("diamondGrindingHead"));
OreDictionary.registerOre("craftingGrinder", ItemParts.getPartByName("tungstenGrindingHead")); OreDictionary.registerOre("craftingTungstenGrinder", ItemParts.getPartByName("tungstenGrindingHead"));
OreDictionary.registerOre("craftingSuperconductor", ItemParts.getPartByName("superconductor")); OreDictionary.registerOre("craftingSuperconductor", ItemParts.getPartByName("superconductor"));
OreDictionary.registerOre("batteryUltimate", ItemParts.getPartByName("diamondGrindingHead"));
OreDictionary.registerOre("materialResin", ItemParts.getPartByName("rubberSap")); OreDictionary.registerOre("materialResin", ItemParts.getPartByName("rubberSap"));
OreDictionary.registerOre("materialRubber", ItemParts.getPartByName("rubber")); OreDictionary.registerOre("materialRubber", ItemParts.getPartByName("rubber"));

View file

@ -30,7 +30,9 @@ import net.minecraft.init.Items;
import net.minecraft.item.ItemStack; import net.minecraft.item.ItemStack;
import net.minecraftforge.oredict.OreDictionary; import net.minecraftforge.oredict.OreDictionary;
import org.apache.commons.lang3.ArrayUtils; import org.apache.commons.lang3.ArrayUtils;
import reborncore.common.util.OreUtil;
import reborncore.common.util.RebornCraftingHelper; import reborncore.common.util.RebornCraftingHelper;
import reborncore.common.util.StringUtils;
import techreborn.blocks.BlockStorage; import techreborn.blocks.BlockStorage;
import techreborn.blocks.BlockStorage2; import techreborn.blocks.BlockStorage2;
import techreborn.config.ConfigTechReborn; import techreborn.config.ConfigTechReborn;
@ -211,28 +213,13 @@ public class CraftingTableRecipes extends RecipeMethods {
static void registerCompressionRecipes() { static void registerCompressionRecipes() {
for (String name : ArrayUtils.addAll(BlockStorage.types, BlockStorage2.types)) { for (String name : ArrayUtils.addAll(BlockStorage.types, BlockStorage2.types)) {
ItemStack item = ItemStack.EMPTY; if(OreUtil.hasIngot(name)){
try { registerShaped(BlockStorage.getStorageBlockByName(name), "AAA", "AAA", "AAA", 'A',
item = getMaterial(name, 9, Type.INGOT); "ingot" + StringUtils.toFirstCapital(name));
} catch (InvalidParameterException e) { } else if (OreUtil.hasGem(name)){
try { registerShaped(BlockStorage.getStorageBlockByName(name), "AAA", "AAA", "AAA", 'A',
item = getMaterial(name, 9, Type.GEM); "gem" + StringUtils.toFirstCapital(name));
} catch (InvalidParameterException e2) {
continue;
}
} }
if (item != null && !item.isEmpty()) {
registerShaped(BlockStorage.getStorageBlockByName(name), "III", "III", "III", 'I', item);
registerShapeless(item, BlockStorage.getStorageBlockByName(name, 1));
}
}
for (String name : ArrayUtils.addAll(BlockStorage.types, BlockStorage2.types)) {
registerShaped(BlockStorage.getStorageBlockByName(name), "AAA", "AAA", "AAA", 'A',
"ingot" + name.substring(0, 1).toUpperCase() + name.substring(1));
registerShaped(BlockStorage.getStorageBlockByName(name), "AAA", "AAA", "AAA", 'A',
"gem" + name.substring(0, 1).toUpperCase() + name.substring(1));
} }
for (String name : ItemDustsSmall.types) { for (String name : ItemDustsSmall.types) {
@ -283,6 +270,15 @@ public class CraftingTableRecipes extends RecipeMethods {
} }
static void registerMixedMetal(String top, String middle, String bottom, int amount) { static void registerMixedMetal(String top, String middle, String bottom, int amount) {
if(!OreDictionary.doesOreNameExist(top)){
return;
}
if(!OreDictionary.doesOreNameExist(middle)){
return;
}
if(!OreDictionary.doesOreNameExist(bottom)){
return;
}
if (top.equals("ingotRefinedIron") && IC2Duplicates.deduplicate()) { if (top.equals("ingotRefinedIron") && IC2Duplicates.deduplicate()) {
registerShaped(getMaterial("mixed_metal", amount, Type.INGOT), "TTT", "MMM", "BBB", 'T', getStack(IC2Duplicates.REFINED_IRON), 'M', middle, 'B', bottom); registerShaped(getMaterial("mixed_metal", amount, Type.INGOT), "TTT", "MMM", "BBB", 'T', getStack(IC2Duplicates.REFINED_IRON), 'M', middle, 'B', bottom);
} else { } else {