mirror of
https://github.com/PaperMC/Paper.git
synced 2025-01-02 17:32:03 +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) {
|
||||
super.applyToItem(tag);
|
||||
|
||||
if (isPotionEmpty()) {
|
||||
return;
|
||||
}
|
||||
|
||||
Optional<Holder<PotionRegistry>> defaultPotion = (hasBasePotionType()) ? Optional.of(CraftPotionType.bukkitToMinecraftHolder(type)) : Optional.empty();
|
||||
Optional<Integer> potionColor = (hasColor()) ? Optional.of(this.color.asRGB()) : Optional.empty();
|
||||
|
||||
|
@ -174,7 +178,7 @@ class CraftMetaPotion extends CraftMetaItem implements PotionMeta {
|
|||
|
||||
@Override
|
||||
public boolean hasCustomEffects() {
|
||||
return customEffects != null;
|
||||
return customEffects != null && !customEffects.isEmpty();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
Loading…
Reference in a new issue