From cc298c931a19b35d0d7f66c060727b0c0efadc33 Mon Sep 17 00:00:00 2001 From: Doc Date: Tue, 21 Jan 2025 17:56:25 -0300 Subject: [PATCH 1/2] [ci skip] fix and improvements for docs in ConsumeEffect component --- .../item/consumable/ConsumeEffect.java | 31 ++++++++++--------- 1 file changed, 17 insertions(+), 14 deletions(-) diff --git a/paper-api/src/main/java/io/papermc/paper/datacomponent/item/consumable/ConsumeEffect.java b/paper-api/src/main/java/io/papermc/paper/datacomponent/item/consumable/ConsumeEffect.java index 87537e431e50..63327a98866b 100644 --- a/paper-api/src/main/java/io/papermc/paper/datacomponent/item/consumable/ConsumeEffect.java +++ b/paper-api/src/main/java/io/papermc/paper/datacomponent/item/consumable/ConsumeEffect.java @@ -21,7 +21,7 @@ public interface ConsumeEffect { * Creates a consume effect that randomly teleports the entity on consumption. * * @param diameter diameter of random teleportation - * @return the effect + * @return the effect instance */ @Contract(value = "_ -> new", pure = true) static TeleportRandomly teleportRandomlyEffect(final float diameter) { @@ -29,10 +29,10 @@ static TeleportRandomly teleportRandomlyEffect(final float diameter) { } /** - * Creates a consume effect that gives status effects on consumption. + * Creates a consume effect that removes status effects on consumption. * * @param key the sound effect to play - * @return the effect + * @return the effect instance */ @Contract(value = "_ -> new", pure = true) static RemoveStatusEffects removeEffects(final RegistryKeySet key) { @@ -43,7 +43,7 @@ static RemoveStatusEffects removeEffects(final RegistryKeySet * Creates a consume effect that plays a sound on consumption. * * @param key the sound effect to play - * @return the effect + * @return the effect instance */ @Contract(value = "_ -> new", pure = true) static PlaySound playSoundConsumeEffect(final Key key) { @@ -53,7 +53,7 @@ static PlaySound playSoundConsumeEffect(final Key key) { /** * Creates a consume effect that clears all status effects. * - * @return effect instance + * @return the effect instance */ @Contract(value = "-> new", pure = true) static ClearAllStatusEffects clearAllStatusEffects() { @@ -61,17 +61,20 @@ static ClearAllStatusEffects clearAllStatusEffects() { } /** - * Creates a consume effect that gives status effects on consumption. + * Creates a consume effect that gives potion effects on consumption. * * @param effects the potion effects to apply - * @param probability the probability of these effects being applied, between 0 and 1 inclusive. - * @return the effect + * @param probability the probability of these effects being applied, between 0 and 1 inclusive + * @return the effect instance */ @Contract(value = "_, _ -> new", pure = true) static ApplyStatusEffects applyStatusEffects(final List effects, final float probability) { return ConsumableTypesBridge.bridge().applyStatusEffects(effects, probability); } + /** + * Represents a consumable effect that randomly teleports the entity on consumption. + */ @ApiStatus.Experimental @ApiStatus.NonExtendable interface TeleportRandomly extends ConsumeEffect { @@ -85,14 +88,14 @@ interface TeleportRandomly extends ConsumeEffect { } /** - * Represents a consumable effect that removes status effects on consumption + * Represents a consumable effect that removes status effects on consumption. */ @ApiStatus.Experimental @ApiStatus.NonExtendable interface RemoveStatusEffects extends ConsumeEffect { /** - * Potion effects to remove + * Potion effects to remove. * * @return effects */ @@ -107,7 +110,7 @@ interface RemoveStatusEffects extends ConsumeEffect { interface PlaySound extends ConsumeEffect { /** - * Sound effect to play in the world + * Sound effect to play in the world. * * @return sound effect */ @@ -124,16 +127,16 @@ interface ClearAllStatusEffects extends ConsumeEffect { } /** - * Represents a consumable effect that applies effects based on a probability on consumption. + * Represents a consumable effect that applies potion effects based on a probability on consumption. */ @ApiStatus.Experimental @ApiStatus.NonExtendable interface ApplyStatusEffects extends ConsumeEffect { /** - * Effect instances to grant + * Potion effect instances to grant. * - * @return effect + * @return potion effects */ List effects(); From 765582fd036c4e78705e3d09bfe8ab215db4b424 Mon Sep 17 00:00:00 2001 From: Doc Date: Tue, 21 Jan 2025 19:37:19 -0300 Subject: [PATCH 2/2] [ci skip] fix docs for ConsumeEffect#removeEffects --- .../datacomponent/item/consumable/ConsumeEffect.java | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/paper-api/src/main/java/io/papermc/paper/datacomponent/item/consumable/ConsumeEffect.java b/paper-api/src/main/java/io/papermc/paper/datacomponent/item/consumable/ConsumeEffect.java index 63327a98866b..8442532a1874 100644 --- a/paper-api/src/main/java/io/papermc/paper/datacomponent/item/consumable/ConsumeEffect.java +++ b/paper-api/src/main/java/io/papermc/paper/datacomponent/item/consumable/ConsumeEffect.java @@ -31,18 +31,18 @@ static TeleportRandomly teleportRandomlyEffect(final float diameter) { /** * Creates a consume effect that removes status effects on consumption. * - * @param key the sound effect to play + * @param effects the potion effects to remove * @return the effect instance */ @Contract(value = "_ -> new", pure = true) - static RemoveStatusEffects removeEffects(final RegistryKeySet key) { - return ConsumableTypesBridge.bridge().removeStatusEffects(key); + static RemoveStatusEffects removeEffects(final RegistryKeySet effects) { + return ConsumableTypesBridge.bridge().removeStatusEffects(effects); } /** * Creates a consume effect that plays a sound on consumption. * - * @param key the sound effect to play + * @param key the key sound effect to play * @return the effect instance */ @Contract(value = "_ -> new", pure = true)