Potion NPE fix

This commit is contained in:
nossr50
2020-07-13 10:53:36 -07:00
parent 1d1736481c
commit ded7fd5bdf
2 changed files with 6 additions and 0 deletions

View File

@ -1061,6 +1061,9 @@ public class EntityListener implements Listener {
if(WorldBlacklist.isWorldBlacklisted(event.getEntity().getWorld()))
return;
if(event.getPotion().getItem().getItemMeta() == null)
return;
for (PotionEffect effect : ((PotionMeta) event.getPotion().getItem().getItemMeta()).getCustomEffects()) {
if (!effect.getType().equals(PotionEffectType.SATURATION)) {
return;