Fixing another NPE for brewing

This commit is contained in:
nossr50 2019-04-14 05:27:31 -07:00
parent 5a56b27ea8
commit 0f8c0f97d9

View File

@ -93,12 +93,12 @@ public final class AlchemyPotionBrewer {
}
private static List<ItemStack> getValidIngredients(Player player) {
if(UserManager.getPlayer(player) == null)
if(player == null || UserManager.getPlayer(player) == null)
{
return PotionConfig.getInstance().getIngredients(1);
}
return PotionConfig.getInstance().getIngredients((player == null || !Permissions.isSubSkillEnabled(player, SubSkillType.ALCHEMY_CONCOCTIONS)) ? 1 : UserManager.getPlayer(player).getAlchemyManager().getTier());
return PotionConfig.getInstance().getIngredients(!Permissions.isSubSkillEnabled(player, SubSkillType.ALCHEMY_CONCOCTIONS) ? 1 : UserManager.getPlayer(player).getAlchemyManager().getTier());
}
public static void finishBrewing(BlockState brewingStand, Player player, boolean forced) {