mirror of
https://github.com/PaperMC/Paper.git
synced 2025-08-11 18:22:08 -07:00
SPIGOT-749: Fix NullPointerException and broken logic in Potion.fromDamage(int)
By: Antony Riley <antony@cyberiantiger.org>
This commit is contained in:
@@ -405,7 +405,7 @@ public class Potion {
|
|||||||
if ((damage & SPLASH_BIT) > 0) {
|
if ((damage & SPLASH_BIT) > 0) {
|
||||||
potion = potion.splash();
|
potion = potion.splash();
|
||||||
}
|
}
|
||||||
if ((!type.equals(PotionType.INSTANT_DAMAGE) || type.equals(PotionType.FIRE_RESISTANCE)) && (damage & EXTENDED_BIT) > 0) {
|
if ((type == null || !type.isInstant()) && (damage & EXTENDED_BIT) > 0) {
|
||||||
potion = potion.extend();
|
potion = potion.extend();
|
||||||
}
|
}
|
||||||
return potion;
|
return potion;
|
||||||
|
Reference in New Issue
Block a user