From ca52c2b6981b1510a055e8a01dca707d28075190 Mon Sep 17 00:00:00 2001 From: ImMorpheus Date: Sat, 18 Nov 2023 03:38:33 +0100 Subject: [PATCH] Allow negative amplifiers in potion effects --- .../spongepowered/api/effect/potion/PotionEffect.java | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/src/main/java/org/spongepowered/api/effect/potion/PotionEffect.java b/src/main/java/org/spongepowered/api/effect/potion/PotionEffect.java index 2b83756d6e..350a9d0cea 100644 --- a/src/main/java/org/spongepowered/api/effect/potion/PotionEffect.java +++ b/src/main/java/org/spongepowered/api/effect/potion/PotionEffect.java @@ -61,7 +61,7 @@ static Builder builder() { * @param amplifier The zero-indexed amplifier * @param duration The duration in ticks * @return The potion effect - * @throws IllegalArgumentException If the amplifier is negative or the duration is not positive + * @throws IllegalArgumentException If the duration is not positive */ static PotionEffect of(final PotionEffectType type, final int amplifier, final Ticks duration) throws IllegalArgumentException { return PotionEffect.builder().potionType(type).amplifier(amplifier).duration(duration).build(); @@ -76,7 +76,7 @@ static PotionEffect of(final PotionEffectType type, final int amplifier, final T * @param amplifier The amplifier * @param duration The duration in ticks * @return The potion effect - * @throws IllegalArgumentException If the amplifier is negative or the duration is not positive + * @throws IllegalArgumentException If the duration is not positive */ static PotionEffect of(final Supplier type, final int amplifier, final Ticks duration) throws IllegalArgumentException { return PotionEffect.builder().potionType(type).amplifier(amplifier).duration(duration).build(); @@ -172,15 +172,14 @@ default Builder potionType(final Supplier potionEffe /** * Sets the amplifier power of the potion effect. * - *

Amplifiers must be greater than or equal to zero. See + *

See * {@link #amplifier()} for an explanation of what the amplifier means. *

* * @param amplifier The amplifier power * @return This builder, for chaining - * @throws IllegalArgumentException If the amplifier is less than zero */ - Builder amplifier(int amplifier) throws IllegalArgumentException; + Builder amplifier(int amplifier); /** * Sets whether the potion effect is ambient.