Fixed NPE when calling canBrew
Oversight on my part, If the ingredient doesn't return true in Item.isPotionIngredient, Items.potionitem.getEffects(stack) returns null, causing an NPE to be thrown later on. This invalidates #1947.
This commit is contained in:
parent
f2eec981ff
commit
953ddae475
1 changed files with 2 additions and 2 deletions
|
@ -40,7 +40,7 @@ public class VanillaBrewingRecipe implements IBrewingRecipe {
|
||||||
@Override
|
@Override
|
||||||
public ItemStack getOutput(ItemStack input, ItemStack ingredient)
|
public ItemStack getOutput(ItemStack input, ItemStack ingredient)
|
||||||
{
|
{
|
||||||
if (ingredient != null && input != null && input.getItem() instanceof ItemPotion)
|
if (ingredient != null && input != null && input.getItem() instanceof ItemPotion && isIngredient(ingredient))
|
||||||
{
|
{
|
||||||
int inputMeta = input.getMetadata();
|
int inputMeta = input.getMetadata();
|
||||||
int outputMeta = PotionHelper.applyIngredient(inputMeta, ingredient.getItem().getPotionEffect(ingredient));
|
int outputMeta = PotionHelper.applyIngredient(inputMeta, ingredient.getItem().getPotionEffect(ingredient));
|
||||||
|
@ -72,4 +72,4 @@ public class VanillaBrewingRecipe implements IBrewingRecipe {
|
||||||
|
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue