mirror of
https://github.com/GTNewHorizons/ForestryMC.git
synced 2026-11-14 01:04:12 +00:00
Improve null safety of memorized recipe isValid check
This commit is contained in:
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());
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user