Suspicious Effect Entry API

Exposes a new suspicious effect entry type that properly represents
storable effects in the context of suspicious effects as they only
define the potion effect type and duration.

This differentiates them from the existing PotionEffect API found in
bukkit and hence clarifies that storable values in the parts of the API
in which it replaces PotionEffect.

Co-authored-by: Yannick Lamprecht <yannicklamprecht@live.de>
This commit is contained in:
Owen1212055
2024-03-03 19:45:52 +01:00
parent 3073742fd7
commit 1725de0232
4 changed files with 151 additions and 0 deletions

View File

@@ -32,13 +32,28 @@ public interface SuspiciousStewMeta extends ItemMeta {
/**
* Adds a custom potion effect to this suspicious stew.
*
* @deprecated use {@link #addCustomEffect(io.papermc.paper.potion.SuspiciousEffectEntry, boolean)} as PotionEffect suggests that all attributes are used. In fact, only the PotionEffectType and the duration are used.
* @param effect the potion effect to add
* @param overwrite true if any existing effect of the same type should be
* overwritten
* @return true if the suspicious stew meta changed as a result of this call
*/
@Deprecated // Paper - add overloads to use suspicious effect entry to mushroom cow and suspicious stew meta
boolean addCustomEffect(@NotNull PotionEffect effect, boolean overwrite);
// Paper start - add overloads to use suspicious effect entry to mushroom cow and suspicious stew meta
/**
* Adds a custom potion effect to this suspicious stew.
*
* @param suspiciousEffectEntry the suspicious effect entry to add
* @param overwrite true if any existing effect of the same type should be
* overwritten
* @return true if the suspicious stew meta changed as a result of this call
* as a result of this call
*/
boolean addCustomEffect(@NotNull io.papermc.paper.potion.SuspiciousEffectEntry suspiciousEffectEntry, boolean overwrite);
// Paper end - add overloads to use suspicious effect entry to mushroom cow and suspicious stew meta
/**
* Removes a custom potion effect from this suspicious stew.
*