Improve null safety of memorized recipe isValid check

This commit is contained in:
mezz committed 2014-12-07 16:23:03 -08:00
1 parent 2cb1959421
commit 23ffb78ab3
1 file changed
+6 -1
@@ -130,7 +130,12 @@ public class RecipeMemory implements INBTTagable {
public final int capacity = 9;
private static boolean isValid(World world, Recipe recipe) {
Item item = recipe.getRecipeOutput(world).getItem();
if (recipe == null)
return false;
ItemStack recipeOutput = recipe.getRecipeOutput(world);
if (recipeOutput == null)
return false;
Item item = recipeOutput.getItem();
return item != null && !memoryBlacklist.contains(item.getClass());
}