Fixed oredict creating empty entries when searching for names

This commit is contained in:
Ellpeck 2016-05-04 12:19:02 +02:00
parent f50c9f32c1
commit 2352e3be31
6 changed files with 10 additions and 10 deletions

View file

@ -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) * @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){ 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)); 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 * @param outputOneAmount The amount of the first output
*/ */
public static void addCrusherRecipe(ItemStack input, String outputOne, int outputOneAmount){ 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)); crusherRecipes.add(new CrusherRecipe(input, outputOne, outputOneAmount));
} }
} }

View file

@ -60,7 +60,7 @@ public class CrusherRecipe{
return null; return null;
} }
List<ItemStack> stacks = OreDictionary.getOres(this.outputOne); List<ItemStack> stacks = OreDictionary.getOres(this.outputOne, false);
if(stacks != null && !stacks.isEmpty()){ if(stacks != null && !stacks.isEmpty()){
List<ItemStack> stacksCopy = new ArrayList<ItemStack>(); List<ItemStack> stacksCopy = new ArrayList<ItemStack>();
for(ItemStack stack : stacks){ for(ItemStack stack : stacks){
@ -84,7 +84,7 @@ public class CrusherRecipe{
return null; return null;
} }
List<ItemStack> stacks = OreDictionary.getOres(this.outputTwo); List<ItemStack> stacks = OreDictionary.getOres(this.outputTwo, false);
if(stacks != null && !stacks.isEmpty()){ if(stacks != null && !stacks.isEmpty()){
List<ItemStack> stacksCopy = new ArrayList<ItemStack>(); List<ItemStack> stacksCopy = new ArrayList<ItemStack>();
for(ItemStack stack : stacks){ for(ItemStack stack : stacks){
@ -108,7 +108,7 @@ public class CrusherRecipe{
return null; return null;
} }
List<ItemStack> stacks = OreDictionary.getOres(this.input); List<ItemStack> stacks = OreDictionary.getOres(this.input, false);
if(stacks != null && !stacks.isEmpty()){ if(stacks != null && !stacks.isEmpty()){
List<ItemStack> stacksCopy = new ArrayList<ItemStack>(); List<ItemStack> stacksCopy = new ArrayList<ItemStack>();
for(ItemStack stack : stacks){ for(ItemStack stack : stacks){

View file

@ -46,7 +46,7 @@ public class LensNoneRecipe{
return null; return null;
} }
List<ItemStack> stacks = OreDictionary.getOres(this.output); List<ItemStack> stacks = OreDictionary.getOres(this.output, false);
if(stacks != null && !stacks.isEmpty()){ if(stacks != null && !stacks.isEmpty()){
List<ItemStack> stacksCopy = new ArrayList<ItemStack>(); List<ItemStack> stacksCopy = new ArrayList<ItemStack>();
for(ItemStack stack : stacks){ for(ItemStack stack : stacks){
@ -70,7 +70,7 @@ public class LensNoneRecipe{
return null; return null;
} }
List<ItemStack> stacks = OreDictionary.getOres(this.input); List<ItemStack> stacks = OreDictionary.getOres(this.input, false);
if(stacks != null && !stacks.isEmpty()){ if(stacks != null && !stacks.isEmpty()){
List<ItemStack> stacksCopy = new ArrayList<ItemStack>(); List<ItemStack> stacksCopy = new ArrayList<ItemStack>();
for(ItemStack stack : stacks){ for(ItemStack stack : stacks){

View file

@ -392,7 +392,7 @@ public class ItemCrafting{
} }
//Resonant Rice //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), GameRegistry.addRecipe(new ShapelessOreRecipe(new ItemStack(InitItems.itemResonantRice),
new ItemStack(InitItems.itemFoods, 1, TheFoods.RICE.ordinal()), "nuggetEnderium", Items.GUNPOWDER)); new ItemStack(InitItems.itemFoods, 1, TheFoods.RICE.ordinal()), "nuggetEnderium", Items.GUNPOWDER));
} }

View file

@ -41,7 +41,7 @@ public class JamVillagerTradeHandler{
} }
public void addWants(String oredictName, int minSize, int maxSize){ public void addWants(String oredictName, int minSize, int maxSize){
ArrayList<ItemStack> stacks = (ArrayList<ItemStack>)OreDictionary.getOres(oredictName); ArrayList<ItemStack> stacks = (ArrayList<ItemStack>)OreDictionary.getOres(oredictName, false);
this.trades.add(new Trade(stacks, minSize, maxSize)); this.trades.add(new Trade(stacks, minSize, maxSize));
} }

View file

@ -38,7 +38,7 @@ public class CrusherRecipeRegistry{
String output = theCase.resultPreString+ore.substring(theCase.theCase.length()); String output = theCase.resultPreString+ore.substring(theCase.theCase.length());
if(!hasOreRecipe(ore)){ 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); ActuallyAdditionsAPI.addCrusherRecipe(ore, output, theCase.resultAmount);
} }
else{ else{