Fix Nullpointer in PotionEffectTypeEditorPanel pre 1.13

This commit is contained in:
Aurora 2020-08-13 18:26:18 +02:00
parent 8d41e3fa2d
commit 2b6cdf8d43
No known key found for this signature in database
GPG Key ID: 89839F67B53656AD
1 changed files with 4 additions and 2 deletions

View File

@ -91,7 +91,9 @@ public class PotionEffectTypeEditorPanel extends SubVariablePanelHandler<Skill,
potionMeta.setBasePotionData(new PotionData(potionType));
} else {
potionMeta.addCustomEffect(this.potionEffectConverter.from(potionEffectHolder), true);
PotionEffectHolder holder = new PotionEffectHolder(potionEffectType.getName(), null, null);
potionMeta.addCustomEffect(this.potionEffectConverter.from(holder), true);
// potionMeta.setMainEffect(potionEffectType);
}
itemStack.setItemMeta(potionMeta);
@ -104,7 +106,7 @@ public class PotionEffectTypeEditorPanel extends SubVariablePanelHandler<Skill,
if (type != null && !type.isEmpty()) {
PotionEffectFinder potionEffectFinder = PotionEffectFinder.getByName(type);
if (potionEffectFinder != null) {
if (potionEffectFinder != null && potionEffectFinder.getPotionEffectType().equals(potionEffectType)) {
ItemStackUtils.applyDisplayName(itemStack, this.plugin.getDisplay().getString("Display.Skills.CreatePotion.selectedName"), replaceMap);
found = true;
}