Now checks that an item in a stack is not null, will throw a NPE if one is found.
This commit is contained in:
parent
d4222693c0
commit
a483d48a2f
1 changed files with 11 additions and 0 deletions
|
@ -3,6 +3,7 @@ package techreborn.api.recipe;
|
||||||
import net.minecraft.item.ItemStack;
|
import net.minecraft.item.ItemStack;
|
||||||
import org.apache.commons.lang3.time.StopWatch;
|
import org.apache.commons.lang3.time.StopWatch;
|
||||||
import reborncore.common.util.ItemUtils;
|
import reborncore.common.util.ItemUtils;
|
||||||
|
import scala.actors.threadpool.Arrays;
|
||||||
import techreborn.Core;
|
import techreborn.Core;
|
||||||
import techreborn.api.recipe.recipeConfig.RecipeConfigManager;
|
import techreborn.api.recipe.recipeConfig.RecipeConfigManager;
|
||||||
|
|
||||||
|
@ -74,6 +75,16 @@ public class RecipeHandler {
|
||||||
buffer.append(ste);
|
buffer.append(ste);
|
||||||
}
|
}
|
||||||
stackMap.put(recipe, buffer.toString());
|
stackMap.put(recipe, buffer.toString());
|
||||||
|
for(ItemStack stack : recipe.getOutputs()){
|
||||||
|
if(stack.getItem() == null){
|
||||||
|
throw new NullPointerException("Null item in stack!");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
for(ItemStack stack : recipe.getInputs()){
|
||||||
|
if(stack.getItem() == null){
|
||||||
|
throw new NullPointerException("Null item in stack!");
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue