mirror of
https://github.com/Ellpeck/ActuallyAdditions.git
synced 2024-11-22 23:28:35 +01:00
Fixed the second output not being checked when registering oredict crusher recipes
This commit is contained in:
parent
5b812a6b67
commit
ed842e6fe4
1 changed files with 16 additions and 8 deletions
|
@ -23,7 +23,7 @@ public class CrusherRecipeManualRegistry{
|
|||
public static ArrayList<CrusherRecipe> recipes = new ArrayList<CrusherRecipe>();
|
||||
|
||||
public static void registerRecipe(ItemStack input, ItemStack outputOne, ItemStack outputTwo, int secondChance){
|
||||
if(!hasRecipe(input, outputOne)){
|
||||
if(!hasRecipe(input, outputOne, outputTwo)){
|
||||
recipes.add(new CrusherRecipe(input, outputOne, outputTwo, secondChance));
|
||||
}
|
||||
}
|
||||
|
@ -51,20 +51,24 @@ public class CrusherRecipeManualRegistry{
|
|||
registerRecipe(theInput, theOutputOne, theOutputTwo, secondChance);
|
||||
}
|
||||
}
|
||||
else registerRecipe(theInput, theOutputOne, null, 0);
|
||||
else{
|
||||
registerRecipe(theInput, theOutputOne, null, 0);
|
||||
}
|
||||
}
|
||||
}
|
||||
else{
|
||||
if(ConfigBoolValues.DO_CRUSHER_SPAM.isEnabled())
|
||||
if(ConfigBoolValues.DO_CRUSHER_SPAM.isEnabled()){
|
||||
ModUtil.LOGGER.warn("Couldn't register Crusher Recipe! An Item with OreDictionary Registry '"+outputOne+"' doesn't exist! It should be the output of '"+input+"'!");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
else{
|
||||
if(ConfigBoolValues.DO_CRUSHER_SPAM.isEnabled())
|
||||
if(ConfigBoolValues.DO_CRUSHER_SPAM.isEnabled()){
|
||||
ModUtil.LOGGER.warn("Couldn't register Crusher Recipe! Didn't find Items registered as '"+input+"'!");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public static void registerRecipe(ItemStack input, ItemStack outputOne){
|
||||
registerRecipe(input, outputOne, null, 0);
|
||||
|
@ -79,9 +83,13 @@ public class CrusherRecipeManualRegistry{
|
|||
return null;
|
||||
}
|
||||
|
||||
public static boolean hasRecipe(ItemStack input, ItemStack outputOne){
|
||||
public static boolean hasRecipe(ItemStack input, ItemStack outputOne, ItemStack outputTwo){
|
||||
for(CrusherRecipe recipe : recipes){
|
||||
if(recipe.input.isItemEqual(input) && recipe.firstOutput.isItemEqual(outputOne) || (recipe.input.getItem() == input.getItem() && recipe.firstOutput.getItem() == outputOne.getItem() && recipe.input.getItemDamage() == Util.WILDCARD)) return true;
|
||||
if(outputTwo == null || (recipe.secondOutput != null && recipe.secondOutput.isItemEqual(outputTwo))){
|
||||
if(recipe.input.isItemEqual(input) && recipe.firstOutput.isItemEqual(outputOne) || (recipe.input.getItem() == input.getItem() && recipe.firstOutput.getItem() == outputOne.getItem() && recipe.input.getItemDamage() == Util.WILDCARD)){
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue