Added null check before getting effect type name
This commit is contained in:
parent
6c0a799198
commit
b8d5146d2f
|
@ -76,8 +76,10 @@ public class ActionHelper {
|
||||||
PotionMeta potionMeta = (PotionMeta) itemStack.getItemMeta();
|
PotionMeta potionMeta = (PotionMeta) itemStack.getItemMeta();
|
||||||
|
|
||||||
PotionData potionData = potionMeta.getBasePotionData();
|
PotionData potionData = potionMeta.getBasePotionData();
|
||||||
possibleMaterials.add(potionData.getType().getEffectType().getName() + "_" + name);
|
if (potionData.getType().getEffectType() != null) {
|
||||||
|
possibleMaterials.add(potionData.getType().getEffectType().getName() + "_" + name);
|
||||||
|
}
|
||||||
|
|
||||||
if (potionMeta.hasCustomEffects()) {
|
if (potionMeta.hasCustomEffects()) {
|
||||||
for (PotionEffect potionEffect : potionMeta.getCustomEffects()) {
|
for (PotionEffect potionEffect : potionMeta.getCustomEffects()) {
|
||||||
possibleMaterials.add(potionEffect.getType().getName() + "_" + name);
|
possibleMaterials.add(potionEffect.getType().getName() + "_" + name);
|
||||||
|
|
Loading…
Reference in New Issue