From f6175ea588f26f36163376839a9626e43aa16bed Mon Sep 17 00:00:00 2001 From: Bukkit/Spigot Date: Mon, 25 May 2015 22:11:37 +0100 Subject: [PATCH] Checked for instant potions, to fix NPE in serialization. Fixes SPIGOT-749 By: olivervscreeper --- paper-api/src/main/java/org/bukkit/potion/Potion.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/paper-api/src/main/java/org/bukkit/potion/Potion.java b/paper-api/src/main/java/org/bukkit/potion/Potion.java index edc9175464..265b050579 100644 --- a/paper-api/src/main/java/org/bukkit/potion/Potion.java +++ b/paper-api/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;