mirror of
https://github.com/PaperMC/Paper.git
synced 2025-01-20 07:34:48 +01:00
SPIGOT-7902, #1477: Fix CraftMetaPotion#hasCustomEffects() does not check if customEffects (List) is empty
By: James Perry <beanp02@yahoo.com>
This commit is contained in:
parent
060be9b96a
commit
074c4c011e
1 changed files with 5 additions and 1 deletions
|
@ -115,6 +115,10 @@ class CraftMetaPotion extends CraftMetaItem implements PotionMeta {
|
||||||
void applyToItem(CraftMetaItem.Applicator tag) {
|
void applyToItem(CraftMetaItem.Applicator tag) {
|
||||||
super.applyToItem(tag);
|
super.applyToItem(tag);
|
||||||
|
|
||||||
|
if (isPotionEmpty()) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
Optional<Holder<PotionRegistry>> defaultPotion = (hasBasePotionType()) ? Optional.of(CraftPotionType.bukkitToMinecraftHolder(type)) : Optional.empty();
|
Optional<Holder<PotionRegistry>> defaultPotion = (hasBasePotionType()) ? Optional.of(CraftPotionType.bukkitToMinecraftHolder(type)) : Optional.empty();
|
||||||
Optional<Integer> potionColor = (hasColor()) ? Optional.of(this.color.asRGB()) : Optional.empty();
|
Optional<Integer> potionColor = (hasColor()) ? Optional.of(this.color.asRGB()) : Optional.empty();
|
||||||
|
|
||||||
|
@ -174,7 +178,7 @@ class CraftMetaPotion extends CraftMetaItem implements PotionMeta {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean hasCustomEffects() {
|
public boolean hasCustomEffects() {
|
||||||
return customEffects != null;
|
return customEffects != null && !customEffects.isEmpty();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
Loading…
Reference in a new issue