SPIGOT-7665: Fix ThrownPotion#getEffects() implementation only bringing custom effects

By: Doc <nachito94@msn.com>
This commit is contained in:
CraftBukkit/Spigot 2024-05-10 19:09:20 +10:00
parent 17b4c0d7a3
commit 54f230de84

View file

@ -23,7 +23,7 @@ public class CraftThrownPotion extends CraftThrowableProjectile implements Throw
@Override
public Collection<PotionEffect> getEffects() {
ImmutableList.Builder<PotionEffect> builder = ImmutableList.builder();
for (MobEffect effect : getHandle().getItem().getOrDefault(DataComponents.POTION_CONTENTS, PotionContents.EMPTY).customEffects()) {
for (MobEffect effect : getHandle().getItem().getOrDefault(DataComponents.POTION_CONTENTS, PotionContents.EMPTY).getAllEffects()) {
builder.add(CraftPotionUtil.toBukkit(effect));
}
return builder.build();