#1082: Add "since" to Deprecation annotations

By: DerFrZocker <derrieple@gmail.com>
This commit is contained in:
Bukkit/Spigot
2024-11-25 07:52:33 +11:00
parent 98f6ab9a04
commit 0023e5549a
257 changed files with 1523 additions and 1176 deletions

View File

@@ -28,7 +28,7 @@ public interface PotionBrewer {
* @return The list of effects
* @deprecated Non-Functional
*/
@Deprecated
@Deprecated(since = "1.6.2")
@NotNull
public Collection<PotionEffect> getEffectsFromDamage(int damage);
@@ -43,6 +43,6 @@ public interface PotionBrewer {
* @deprecated Upgraded / extended potions are now their own {@link PotionType} use {@link PotionType#getPotionEffects()} instead
*/
@NotNull
@Deprecated
@Deprecated(since = "1.20.2")
public Collection<PotionEffect> getEffects(@NotNull PotionType type, boolean upgraded, boolean extended);
}

View File

@@ -6,7 +6,7 @@ import org.jetbrains.annotations.NotNull;
/**
* @deprecated Upgraded / extended potions are now their own {@link PotionType} use them instead.
*/
@Deprecated(forRemoval = true)
@Deprecated(since = "1.20.6", forRemoval = true)
public final class PotionData {
private final PotionType type;

View File

@@ -256,9 +256,9 @@ public class PotionEffect implements ConfigurationSerializable {
* @return color of this potion's particles. May be null if the potion has no particles or defined color.
* @deprecated color is not part of potion effects
*/
@Deprecated
@Nullable
@Contract("-> null")
@Deprecated(since = "1.13")
@Nullable
@Contract("-> null")
public Color getColor() {
return null;
}

View File

@@ -271,7 +271,7 @@ public abstract class PotionEffectType implements Keyed, Translatable {
* @return duration modifier
* @deprecated unused, always 1.0
*/
@Deprecated
@Deprecated(since = "1.14")
public abstract double getDurationModifier();
/**
@@ -280,7 +280,7 @@ public abstract class PotionEffectType implements Keyed, Translatable {
* @return Unique ID
* @deprecated Magic value
*/
@Deprecated
@Deprecated(since = "1.6.2")
public abstract int getId();
/**
@@ -290,7 +290,7 @@ public abstract class PotionEffectType implements Keyed, Translatable {
* @deprecated only for backwards compatibility, use {@link #getKey()} instead.
*/
@NotNull
@Deprecated
@Deprecated(since = "1.20.3")
public abstract String getName();
/**
@@ -302,7 +302,7 @@ public abstract class PotionEffectType implements Keyed, Translatable {
*/
@Contract("null -> null")
@Nullable
@Deprecated
@Deprecated(since = "1.20.3")
public static PotionEffectType getByKey(@Nullable NamespacedKey key) {
if (key == null) {
return null;
@@ -318,7 +318,7 @@ public abstract class PotionEffectType implements Keyed, Translatable {
* @return Resulting type, or null if not found.
* @deprecated Magic value
*/
@Deprecated
@Deprecated(since = "1.6.2")
@Nullable
public static PotionEffectType getById(int id) {
PotionEffectType type = ID_MAP.get(id);
@@ -345,7 +345,7 @@ public abstract class PotionEffectType implements Keyed, Translatable {
* @deprecated only for backwards compatibility, use {@link Registry#get(NamespacedKey)} instead.
*/
@Nullable
@Deprecated
@Deprecated(since = "1.20.3")
public static PotionEffectType getByName(@NotNull String name) {
Preconditions.checkArgument(name != null, "name cannot be null");
return Registry.EFFECT.get(NamespacedKey.fromString(name.toLowerCase(Locale.ROOT)));
@@ -356,7 +356,7 @@ public abstract class PotionEffectType implements Keyed, Translatable {
* @deprecated use {@link Registry#iterator()}.
*/
@NotNull
@Deprecated
@Deprecated(since = "1.20.3")
public static PotionEffectType[] values() {
return Lists.newArrayList(Registry.EFFECT).toArray(new PotionEffectType[0]);
}

View File

@@ -5,7 +5,7 @@ import org.jetbrains.annotations.NotNull;
/**
* @deprecated only for backwards compatibility, PotionEffectTypeWrapper is no longer used.
*/
@Deprecated
@Deprecated(since = "1.20.3")
public abstract class PotionEffectTypeWrapper extends PotionEffectType {
protected PotionEffectTypeWrapper() {
}

View File

@@ -76,7 +76,7 @@ public enum PotionType implements Keyed {
* @deprecated Potions can have multiple effects use {@link #getPotionEffects()}
*/
@Nullable
@Deprecated
@Deprecated(since = "1.20.2")
public PotionEffectType getEffectType() {
return internalPotionDataSupplier.get().getEffectType();
}
@@ -94,7 +94,7 @@ public enum PotionType implements Keyed {
* @deprecated PotionType can have multiple effects, some of which can be instant and others not.
* Use {@link PotionEffectType#isInstant()} in combination with {@link #getPotionEffects()} and {@link PotionEffect#getType()}
*/
@Deprecated
@Deprecated(since = "1.20.2")
public boolean isInstant() {
return internalPotionDataSupplier.get().isInstant();
}
@@ -129,7 +129,7 @@ public enum PotionType implements Keyed {
* @return the matching potion type
* @deprecated Misleading
*/
@Deprecated
@Deprecated(since = "1.9")
@Nullable
public static PotionType getByEffect(@Nullable PotionEffectType effectType) {
if (effectType == null)
@@ -150,7 +150,7 @@ public enum PotionType implements Keyed {
/**
* @deprecated Do not use, interface will get removed, and the plugin won't run
*/
@Deprecated
@Deprecated(since = "1.20.2")
@ApiStatus.Internal
public interface InternalPotionData {