From 8b5a2dc87aae59bbdc60c180b788fb6c308137b8 Mon Sep 17 00:00:00 2001 From: modmuss50 Date: Sun, 6 Mar 2016 13:37:46 +0000 Subject: [PATCH] Fixes recipe crashing --- src/main/java/techreborn/init/ModRecipes.java | 13 +++++++------ src/main/java/techreborn/parts/ItemCables.java | 2 +- 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/src/main/java/techreborn/init/ModRecipes.java b/src/main/java/techreborn/init/ModRecipes.java index 666de795c..2e3f91069 100644 --- a/src/main/java/techreborn/init/ModRecipes.java +++ b/src/main/java/techreborn/init/ModRecipes.java @@ -45,6 +45,7 @@ import techreborn.items.ItemIngots; import techreborn.items.ItemNuggets; import techreborn.items.ItemParts; import techreborn.items.ItemPlates; +import techreborn.parts.ItemCables; import techreborn.utils.RecipeUtils; public class @@ -157,12 +158,12 @@ public class "AAA", "AAA", "AAA", 'A', "ingot" + name.substring(0, 1).toUpperCase() + name.substring(1)); } - //TODO can't use cables in recipes -// CraftingHelper.addShapedOreRecipe(ItemParts.getPartByName("electronicCircuit"), -// "WWW", "SRS", "WWW", -// 'R', ItemIngots.getIngotByName("refinediron"), -// 'S', Items.redstone, -// 'W', ItemCables.getCableByName("copper")); + + CraftingHelper.addShapedOreRecipe(ItemParts.getPartByName("electronicCircuit"), + "WWW", "SRS", "WWW", + 'R', ItemIngots.getIngotByName("refinediron"), + 'S', Items.redstone, + 'W', ItemCables.getCableByName("insulatedcopper")); CraftingHelper.addShapedOreRecipe(new ItemStack(ModItems.wrench), "BAB", "BBB", "ABA", diff --git a/src/main/java/techreborn/parts/ItemCables.java b/src/main/java/techreborn/parts/ItemCables.java index 142fe799c..680e79c07 100644 --- a/src/main/java/techreborn/parts/ItemCables.java +++ b/src/main/java/techreborn/parts/ItemCables.java @@ -28,7 +28,7 @@ public class ItemCables extends ItemMultiPart implements ITexturedItem { public static ItemStack getCableByName(String name, int count) { for (int i = 0; i < EnumCableType.values().length; i++) { - if (EnumCableType.values()[i].name().equalsIgnoreCase(name)) { + if (EnumCableType.values()[i].getName().equalsIgnoreCase(name)) { return new ItemStack(TechRebornParts.cables, count, i); } }