Merge pull request #482 from TehNut/master

Fix crashing with BiblioWoods Forestry
This commit is contained in:
WayofTime 2015-10-26 20:47:32 -04:00
commit 2a4e53714a
3 changed files with 27 additions and 7 deletions

View file

@ -3,6 +3,7 @@ package WayofTime.alchemicalWizardry.common.compress;
import java.util.LinkedList;
import java.util.List;
import WayofTime.alchemicalWizardry.AlchemicalWizardry;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.inventory.Container;
import net.minecraft.inventory.InventoryCrafting;
@ -26,7 +27,7 @@ public class StorageBlockCraftingManager
{
this.recipes = new StorageBlockCraftingRecipeAssimilator().getPackingRecipes();
System.out.println("Total number of compression recipes: " + this.recipes.size());
AlchemicalWizardry.logger.info("Total number of compression recipes: " + this.recipes.size());
// List<IRecipe> tempRecipeList = new LinkedList();
//
// World world = DimensionManager.getWorld(0);

View file

@ -21,6 +21,11 @@ import net.minecraftforge.oredict.ShapedOreRecipe;
import net.minecraftforge.oredict.ShapelessOreRecipe;
public class StorageBlockCraftingRecipeAssimilator {
public static String[] problemMods = {
"BiblioWoodsForestry"
};
public List<IRecipe> getPackingRecipes() {
// grab all recipes potentially suitable for packing or unpacking
@ -220,12 +225,26 @@ public class StorageBlockCraftingRecipeAssimilator {
}
private boolean areInputsIdentical(ItemStack a, ItemStack b) {
if (a.getItem() != b.getItem()) return false;
int dmgA = a.getItemDamage();
int dmgB = b.getItemDamage();
try {
if (a.getItem() != b.getItem())
return false;
return dmgA == dmgB || dmgA == OreDictionary.WILDCARD_VALUE || dmgB == OreDictionary.WILDCARD_VALUE;
int dmgA = a.getItemDamage();
int dmgB = b.getItemDamage();
return dmgA == dmgB || dmgA == OreDictionary.WILDCARD_VALUE || dmgB == OreDictionary.WILDCARD_VALUE;
} catch (NullPointerException e) {
AlchemicalWizardry.logger.error("A mod in this instance has registered an item with a null input. Known problem mods are:");
String err = "";
for (String problem : problemMods)
err += (err.length() > 0 ? ", " : "") + problem;
AlchemicalWizardry.logger.error(err);
return false;
}
}
private static class PackingRecipe {

View file

@ -3,8 +3,8 @@
"modid": "AWWayofTime",
"name": "Blood Magic: Alchemical Wizardry",
"description": "Rituals, spells, and more!",
"version": "v1.3.0Beta(1.7.10)",
"mcversion": "1.7.10",
"version": "${version}",
"mcversion": "${mcversion}",
"url": "http://www.minecraftforum.net/topic/1899223-",
"updateUrl": "",
"authorList": ["WayofTime"],