Improve null safety of memorized recipe isValid check

(cherry picked from commit 23ffb78ab3)
This commit is contained in:
mezz committed 2014-12-07 16:25:01 -08:00
1 parent 5133e721cc
commit 6b35ff2ba1
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());
}