From fe015deb2ac3793aaa6cb1a084c589d90470fc57 Mon Sep 17 00:00:00 2001 From: olivervscreeper Date: Mon, 25 May 2015 22:11:37 +0100 Subject: Checked for instant potions, to fix NPE in serialization. Fixes SPIGOT-749 --- src/main/java/org/bukkit/potion/Potion.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/org/bukkit/potion/Potion.java b/src/main/java/org/bukkit/potion/Potion.java index edc91754..265b0505 100644 --- a/src/main/java/org/bukkit/potion/Potion.java +++ b/src/main/java/org/bukkit/potion/Potion.java @@ -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; -- cgit v1.2.3