From 2352e3be31873090dfed7894cbf5209eec860a55 Mon Sep 17 00:00:00 2001 From: Ellpeck Date: Wed, 4 May 2016 12:19:02 +0200 Subject: [PATCH] Fixed oredict creating empty entries when searching for names --- .../ellpeck/actuallyadditions/api/ActuallyAdditionsAPI.java | 4 ++-- .../ellpeck/actuallyadditions/api/recipe/CrusherRecipe.java | 6 +++--- .../actuallyadditions/api/recipe/LensNoneRecipe.java | 4 ++-- .../actuallyadditions/mod/crafting/ItemCrafting.java | 2 +- .../actuallyadditions/mod/gen/JamVillagerTradeHandler.java | 2 +- .../actuallyadditions/mod/recipe/CrusherRecipeRegistry.java | 2 +- 6 files changed, 10 insertions(+), 10 deletions(-) diff --git a/src/main/java/de/ellpeck/actuallyadditions/api/ActuallyAdditionsAPI.java b/src/main/java/de/ellpeck/actuallyadditions/api/ActuallyAdditionsAPI.java index 54d956681..0e27aa6fd 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/api/ActuallyAdditionsAPI.java +++ b/src/main/java/de/ellpeck/actuallyadditions/api/ActuallyAdditionsAPI.java @@ -71,7 +71,7 @@ public class ActuallyAdditionsAPI{ * @param outputTwoChance The chance of the second output (0 won't occur at all, 100 will all the time) */ public static void addCrusherRecipe(String input, String outputOne, int outputOneAmount, String outputTwo, int outputTwoAmount, int outputTwoChance){ - if(!OreDictionary.getOres(input).isEmpty() && !OreDictionary.getOres(outputOne).isEmpty() && (outputTwo == null || outputTwo.isEmpty() || !OreDictionary.getOres(outputTwo).isEmpty())){ + if(!OreDictionary.getOres(input, false).isEmpty() && !OreDictionary.getOres(outputOne, false).isEmpty() && (outputTwo == null || outputTwo.isEmpty() || !OreDictionary.getOres(outputTwo, false).isEmpty())){ crusherRecipes.add(new CrusherRecipe(input, outputOne, outputOneAmount, outputTwo, outputTwoAmount, outputTwoChance)); } } @@ -109,7 +109,7 @@ public class ActuallyAdditionsAPI{ * @param outputOneAmount The amount of the first output */ public static void addCrusherRecipe(ItemStack input, String outputOne, int outputOneAmount){ - if(!OreDictionary.getOres(outputOne).isEmpty()){ + if(!OreDictionary.getOres(outputOne, false).isEmpty()){ crusherRecipes.add(new CrusherRecipe(input, outputOne, outputOneAmount)); } } diff --git a/src/main/java/de/ellpeck/actuallyadditions/api/recipe/CrusherRecipe.java b/src/main/java/de/ellpeck/actuallyadditions/api/recipe/CrusherRecipe.java index 31c326130..7a6c04d8b 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/api/recipe/CrusherRecipe.java +++ b/src/main/java/de/ellpeck/actuallyadditions/api/recipe/CrusherRecipe.java @@ -60,7 +60,7 @@ public class CrusherRecipe{ return null; } - List stacks = OreDictionary.getOres(this.outputOne); + List stacks = OreDictionary.getOres(this.outputOne, false); if(stacks != null && !stacks.isEmpty()){ List stacksCopy = new ArrayList(); for(ItemStack stack : stacks){ @@ -84,7 +84,7 @@ public class CrusherRecipe{ return null; } - List stacks = OreDictionary.getOres(this.outputTwo); + List stacks = OreDictionary.getOres(this.outputTwo, false); if(stacks != null && !stacks.isEmpty()){ List stacksCopy = new ArrayList(); for(ItemStack stack : stacks){ @@ -108,7 +108,7 @@ public class CrusherRecipe{ return null; } - List stacks = OreDictionary.getOres(this.input); + List stacks = OreDictionary.getOres(this.input, false); if(stacks != null && !stacks.isEmpty()){ List stacksCopy = new ArrayList(); for(ItemStack stack : stacks){ diff --git a/src/main/java/de/ellpeck/actuallyadditions/api/recipe/LensNoneRecipe.java b/src/main/java/de/ellpeck/actuallyadditions/api/recipe/LensNoneRecipe.java index 12d7b8aa1..45bb5e923 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/api/recipe/LensNoneRecipe.java +++ b/src/main/java/de/ellpeck/actuallyadditions/api/recipe/LensNoneRecipe.java @@ -46,7 +46,7 @@ public class LensNoneRecipe{ return null; } - List stacks = OreDictionary.getOres(this.output); + List stacks = OreDictionary.getOres(this.output, false); if(stacks != null && !stacks.isEmpty()){ List stacksCopy = new ArrayList(); for(ItemStack stack : stacks){ @@ -70,7 +70,7 @@ public class LensNoneRecipe{ return null; } - List stacks = OreDictionary.getOres(this.input); + List stacks = OreDictionary.getOres(this.input, false); if(stacks != null && !stacks.isEmpty()){ List stacksCopy = new ArrayList(); for(ItemStack stack : stacks){ diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/crafting/ItemCrafting.java b/src/main/java/de/ellpeck/actuallyadditions/mod/crafting/ItemCrafting.java index 41de7dbc4..56734059b 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/crafting/ItemCrafting.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/crafting/ItemCrafting.java @@ -392,7 +392,7 @@ public class ItemCrafting{ } //Resonant Rice - if(ConfigCrafting.RESONANT_RICE.isEnabled() && !OreDictionary.getOres("nuggetEnderium").isEmpty()){ + if(ConfigCrafting.RESONANT_RICE.isEnabled() && !OreDictionary.getOres("nuggetEnderium", false).isEmpty()){ GameRegistry.addRecipe(new ShapelessOreRecipe(new ItemStack(InitItems.itemResonantRice), new ItemStack(InitItems.itemFoods, 1, TheFoods.RICE.ordinal()), "nuggetEnderium", Items.GUNPOWDER)); } diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/gen/JamVillagerTradeHandler.java b/src/main/java/de/ellpeck/actuallyadditions/mod/gen/JamVillagerTradeHandler.java index cd748a82c..a576cd9e5 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/gen/JamVillagerTradeHandler.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/gen/JamVillagerTradeHandler.java @@ -41,7 +41,7 @@ public class JamVillagerTradeHandler{ } public void addWants(String oredictName, int minSize, int maxSize){ - ArrayList stacks = (ArrayList)OreDictionary.getOres(oredictName); + ArrayList stacks = (ArrayList)OreDictionary.getOres(oredictName, false); this.trades.add(new Trade(stacks, minSize, maxSize)); } diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/recipe/CrusherRecipeRegistry.java b/src/main/java/de/ellpeck/actuallyadditions/mod/recipe/CrusherRecipeRegistry.java index 77497cb10..1c26d7e77 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/recipe/CrusherRecipeRegistry.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/recipe/CrusherRecipeRegistry.java @@ -38,7 +38,7 @@ public class CrusherRecipeRegistry{ String output = theCase.resultPreString+ore.substring(theCase.theCase.length()); if(!hasOreRecipe(ore)){ - if(!OreDictionary.getOres(output).isEmpty() && !OreDictionary.getOres(ore).isEmpty()){ + if(!OreDictionary.getOres(output, false).isEmpty() && !OreDictionary.getOres(ore, false).isEmpty()){ ActuallyAdditionsAPI.addCrusherRecipe(ore, output, theCase.resultAmount); } else{