Checked for instant potions, to fix NPE in serialization. Fixes SPIGOT-749

This commit is contained in:
olivervscreeper 2015-05-25 22:11:37 +01:00 committed by md_5
parent 7d306d4e02
commit fe015deb2a

View file

@ -405,7 +405,7 @@ public class Potion {
if ((damage & SPLASH_BIT) > 0) {
potion = potion.splash();
}
if ((damage & EXTENDED_BIT) > 0) {
if ((!type.equals(PotionType.INSTANT_DAMAGE) || type.equals(PotionType.FIRE_RESISTANCE)) && (damage & EXTENDED_BIT) > 0) {
potion = potion.extend();
}
return potion;