#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

@@ -93,7 +93,7 @@ public interface EntityEquipment {
* @deprecated entities can duel wield now use the methods for the
* specific hand instead
*/
@Deprecated
@Deprecated(since = "1.9")
@NotNull
ItemStack getItemInHand();
@@ -106,7 +106,7 @@ public interface EntityEquipment {
* @deprecated entities can duel wield now use the methods for the
* specific hand instead
*/
@Deprecated
@Deprecated(since = "1.9")
void setItemInHand(@Nullable ItemStack stack);
/**
@@ -230,7 +230,7 @@ public interface EntityEquipment {
* @deprecated entities can duel wield now use the methods for the specific
* hand instead
*/
@Deprecated
@Deprecated(since = "1.9")
float getItemInHandDropChance();
/**
@@ -240,7 +240,7 @@ public interface EntityEquipment {
* @deprecated entities can duel wield now use the methods for the specific
* hand instead
*/
@Deprecated
@Deprecated(since = "1.9")
void setItemInHandDropChance(float chance);
/**

View File

@@ -57,7 +57,7 @@ public final class EquipmentSlotGroup implements Predicate<EquipmentSlot> {
* @deprecated for internal compatibility use only
*/
@NotNull
@Deprecated
@Deprecated(since = "1.20.5")
@ApiStatus.Internal
public EquipmentSlot getExample() {
return example;

View File

@@ -11,22 +11,22 @@ import org.jetbrains.annotations.NotNull;
*/
public class FurnaceRecipe extends CookingRecipe<FurnaceRecipe> {
@Deprecated
@Deprecated(since = "1.13")
public FurnaceRecipe(@NotNull ItemStack result, @NotNull Material source) {
this(NamespacedKey.randomKey(), result, source, 0, 0, 200);
}
@Deprecated
@Deprecated(since = "1.13")
public FurnaceRecipe(@NotNull ItemStack result, @NotNull MaterialData source) {
this(NamespacedKey.randomKey(), result, source.getItemType(), source.getData(), 0, 200);
}
@Deprecated
@Deprecated(since = "1.13")
public FurnaceRecipe(@NotNull ItemStack result, @NotNull MaterialData source, float experience) {
this(NamespacedKey.randomKey(), result, source.getItemType(), source.getData(), experience, 200);
}
@Deprecated
@Deprecated(since = "1.6.2")
public FurnaceRecipe(@NotNull ItemStack result, @NotNull Material source, int data) {
this(NamespacedKey.randomKey(), result, source, data, 0, 200);
}
@@ -44,7 +44,7 @@ public class FurnaceRecipe extends CookingRecipe<FurnaceRecipe> {
this(key, result, source, 0, experience, cookingTime);
}
@Deprecated
@Deprecated(since = "1.9")
public FurnaceRecipe(@NotNull NamespacedKey key, @NotNull ItemStack result, @NotNull Material source, int data, float experience, int cookingTime) {
this(key, result, new RecipeChoice.MaterialChoice(Collections.singletonList(source)), experience, cookingTime);
}
@@ -88,7 +88,7 @@ public class FurnaceRecipe extends CookingRecipe<FurnaceRecipe> {
* @return The changed recipe, so you can chain calls.
* @deprecated Magic value
*/
@Deprecated
@Deprecated(since = "1.6.2")
public FurnaceRecipe setInput(@NotNull Material input, int data) {
return setInputChoice(new RecipeChoice.MaterialChoice(Collections.singletonList(input)));
}

View File

@@ -125,7 +125,7 @@ public interface InventoryView {
* @return the id of this view
* @deprecated Magic value
*/
@Deprecated
@Deprecated(since = "1.6.2")
public int getId() {
return id;
}

View File

@@ -70,7 +70,7 @@ public class ItemStack implements Cloneable, ConfigurationSerializable, Translat
* @param damage durability / damage
* @deprecated see {@link #setDurability(short)}
*/
@Deprecated
@Deprecated(since = "1.20.5")
public ItemStack(@NotNull final Material type, final int amount, final short damage) {
this(type, amount, damage, null);
}
@@ -82,7 +82,7 @@ public class ItemStack implements Cloneable, ConfigurationSerializable, Translat
* @param data the data value or null
* @deprecated this method uses an ambiguous data byte object
*/
@Deprecated
@Deprecated(since = "1.4.5")
public ItemStack(@NotNull Material type, final int amount, final short damage, @Nullable final Byte data) {
Preconditions.checkArgument(type != null, "Material cannot be null");
if (type.isLegacy()) {
@@ -219,7 +219,7 @@ public class ItemStack implements Cloneable, ConfigurationSerializable, Translat
* any call to this method will be overwritten by subsequent setting of
* ItemMeta which was created before this call.
*/
@Deprecated
@Deprecated(since = "1.13")
public void setDurability(final short durability) {
ItemMeta meta = getItemMeta();
if (meta != null) {
@@ -234,7 +234,7 @@ public class ItemStack implements Cloneable, ConfigurationSerializable, Translat
* @return Durability of this item
* @deprecated see {@link #setDurability(short)}
*/
@Deprecated
@Deprecated(since = "1.13")
public short getDurability() {
ItemMeta meta = getItemMeta();
return (meta == null) ? 0 : (short) ((Damageable) meta).getDamage();

View File

@@ -2428,7 +2428,7 @@ public interface ItemType extends Keyed, Translatable {
* @deprecated creative categories no longer exist on the server
*/
@Nullable
@Deprecated
@Deprecated(since = "1.20.6")
CreativeCategory getCreativeCategory();
/**
@@ -2446,6 +2446,6 @@ public interface ItemType extends Keyed, Translatable {
* @deprecated only for internal use
*/
@Nullable
@Deprecated
@Deprecated(since = "1.20.6")
Material asMaterial();
}

View File

@@ -200,7 +200,7 @@ public interface PlayerInventory extends Inventory {
* @deprecated players can duel wield now use the methods for the
* specific hand instead
*/
@Deprecated
@Deprecated(since = "1.9")
@NotNull
public ItemStack getItemInHand();
@@ -213,7 +213,7 @@ public interface PlayerInventory extends Inventory {
* @deprecated players can duel wield now use the methods for the
* specific hand instead
*/
@Deprecated
@Deprecated(since = "1.9")
public void setItemInHand(@Nullable ItemStack stack);
/**

View File

@@ -28,7 +28,7 @@ public interface RecipeChoice extends Predicate<ItemStack>, Cloneable {
* @return a single representative item
* @deprecated for compatibility only
*/
@Deprecated
@Deprecated(since = "1.13.1")
@NotNull
ItemStack getItemStack();

View File

@@ -30,7 +30,7 @@ public class ShapedRecipe extends CraftingRecipe {
* @deprecated Recipes must have keys. Use {@link #ShapedRecipe(NamespacedKey, ItemStack)}
* instead.
*/
@Deprecated
@Deprecated(since = "1.12")
public ShapedRecipe(@NotNull ItemStack result) {
this(NamespacedKey.randomKey(), result);
}
@@ -147,7 +147,7 @@ public class ShapedRecipe extends CraftingRecipe {
* @throws IllegalArgumentException if the {@code key} does not appear in the shape.
* @deprecated Magic value
*/
@Deprecated
@Deprecated(since = "1.6.2")
@NotNull
public ShapedRecipe setIngredient(char key, @NotNull Material ingredient, int raw) {
Preconditions.checkArgument(key != ' ', "Space in recipe shape must represent no ingredient");

View File

@@ -17,7 +17,7 @@ import org.jetbrains.annotations.NotNull;
public class ShapelessRecipe extends CraftingRecipe {
private final List<RecipeChoice> ingredients = new ArrayList<>();
@Deprecated
@Deprecated(since = "1.12")
public ShapelessRecipe(@NotNull ItemStack result) {
this(NamespacedKey.randomKey(), result);
}
@@ -71,7 +71,7 @@ public class ShapelessRecipe extends CraftingRecipe {
* @return The changed recipe, so you can chain calls.
* @deprecated Magic value
*/
@Deprecated
@Deprecated(since = "1.6.2")
@NotNull
public ShapelessRecipe addIngredient(@NotNull Material ingredient, int rawdata) {
return addIngredient(1, ingredient, rawdata);
@@ -110,7 +110,7 @@ public class ShapelessRecipe extends CraftingRecipe {
* @return The changed recipe, so you can chain calls.
* @deprecated Magic value
*/
@Deprecated
@Deprecated(since = "1.6.2")
@NotNull
public ShapelessRecipe addIngredient(int count, @NotNull Material ingredient, int rawdata) {
Preconditions.checkArgument(ingredients.size() + count <= 9, "Shapeless recipes cannot have more than 9 ingredients");
@@ -211,7 +211,7 @@ public class ShapelessRecipe extends CraftingRecipe {
* @return The changed recipe.
* @deprecated Magic value
*/
@Deprecated
@Deprecated(since = "1.6.2")
@NotNull
public ShapelessRecipe removeIngredient(@NotNull Material ingredient, int rawdata) {
return removeIngredient(1, ingredient, rawdata);
@@ -228,7 +228,7 @@ public class ShapelessRecipe extends CraftingRecipe {
* @return The changed recipe.
* @deprecated Magic value
*/
@Deprecated
@Deprecated(since = "1.6.2")
@NotNull
public ShapelessRecipe removeIngredient(int count, @NotNull Material ingredient, int rawdata) {
Iterator<RecipeChoice> iterator = ingredients.iterator();

View File

@@ -27,7 +27,7 @@ public class SmithingRecipe implements Recipe, Keyed {
* This class now acts as a base class to these two classes and will do nothing when
* added to the server.
*/
@Deprecated
@Deprecated(since = "1.20.1")
public SmithingRecipe(@NotNull NamespacedKey key, @NotNull ItemStack result, @Nullable RecipeChoice base, @Nullable RecipeChoice addition) {
this.key = key;
this.result = result;

View File

@@ -102,7 +102,7 @@ public interface ItemMeta extends Cloneable, ConfigurationSerializable, Persiste
* @return true if this has a localized name
* @deprecated meta no longer exists
*/
@Deprecated(forRemoval = true)
@Deprecated(since = "1.20.5", forRemoval = true)
boolean hasLocalizedName();
/**
@@ -115,7 +115,7 @@ public interface ItemMeta extends Cloneable, ConfigurationSerializable, Persiste
* @deprecated meta no longer exists
*/
@NotNull
@Deprecated(forRemoval = true)
@Deprecated(since = "1.20.5", forRemoval = true)
String getLocalizedName();
/**
@@ -124,7 +124,7 @@ public interface ItemMeta extends Cloneable, ConfigurationSerializable, Persiste
* @param name the name to set
* @deprecated meta no longer exists
*/
@Deprecated(forRemoval = true)
@Deprecated(since = "1.20.5", forRemoval = true)
void setLocalizedName(@Nullable String name);
/**
@@ -432,7 +432,7 @@ public interface ItemMeta extends Cloneable, ConfigurationSerializable, Persiste
* @deprecated use {@link #getDamageResistant()} and
* {@link DamageTypeTags#IS_FIRE}
*/
@Deprecated
@Deprecated(since = "1.21.2")
boolean isFireResistant();
/**
@@ -443,7 +443,7 @@ public interface ItemMeta extends Cloneable, ConfigurationSerializable, Persiste
* @deprecated use {@link #setDamageResistant(org.bukkit.Tag)} and
* {@link DamageTypeTags#IS_FIRE}
*/
@Deprecated
@Deprecated(since = "1.21.2")
void setFireResistant(boolean fireResistant);
/**
@@ -869,7 +869,7 @@ public interface ItemMeta extends Cloneable, ConfigurationSerializable, Persiste
* Please use {@link PersistentDataHolder#getPersistentDataContainer()} instead of this.
*/
@NotNull
@Deprecated
@Deprecated(since = "1.14")
CustomItemTagContainer getCustomTagContainer();
/**

View File

@@ -22,7 +22,7 @@ public interface MapMeta extends ItemMeta {
* for example will generate a new map with a different ID). The xxxMapView
* family of methods should be used instead.
*/
@Deprecated
@Deprecated(since = "1.13.2")
boolean hasMapId();
/**
@@ -40,7 +40,7 @@ public interface MapMeta extends ItemMeta {
* for example will generate a new map with a different ID). The xxxMapView
* family of methods should be used instead.
*/
@Deprecated
@Deprecated(since = "1.13.2")
int getMapId();
/**
@@ -54,7 +54,7 @@ public interface MapMeta extends ItemMeta {
* for example will generate a new map with a different ID). The xxxMapView
* family of methods should be used instead.
*/
@Deprecated
@Deprecated(since = "1.13.2")
void setMapId(int id);
/**
@@ -110,7 +110,7 @@ public interface MapMeta extends ItemMeta {
* @deprecated This method does not have the expected effect and is
* actually an alias for {@link ItemMeta#hasLocalizedName()}.
*/
@Deprecated
@Deprecated(since = "1.19.4")
boolean hasLocationName();
/**
@@ -123,7 +123,7 @@ public interface MapMeta extends ItemMeta {
* @deprecated This method does not have the expected effect and is
* actually an alias for {@link ItemMeta#getLocalizedName()}.
*/
@Deprecated
@Deprecated(since = "1.19.4")
@Nullable
String getLocationName();
@@ -134,7 +134,7 @@ public interface MapMeta extends ItemMeta {
* @deprecated This method does not have the expected effect and is
* actually an alias for {@link ItemMeta#setLocalizedName(String)}.
*/
@Deprecated
@Deprecated(since = "1.19.4")
void setLocationName(@Nullable String name);
/**

View File

@@ -20,7 +20,7 @@ public interface PotionMeta extends ItemMeta {
* @param data PotionData to set the base potion state to
* @deprecated Upgraded / extended potions are now their own {@link PotionType} use {@link #setBasePotionType} instead.
*/
@Deprecated
@Deprecated(since = "1.20.6")
void setBasePotionData(@Nullable PotionData data);
/**
@@ -30,7 +30,7 @@ public interface PotionMeta extends ItemMeta {
* @deprecated Upgraded / extended potions are now their own {@link PotionType} use {@link #getBasePotionType()} instead.
*/
@Nullable
@Deprecated
@Deprecated(since = "1.20.6")
PotionData getBasePotionData();
/**
@@ -109,7 +109,7 @@ public interface PotionMeta extends ItemMeta {
* @return true if the potion meta changed as a result of this call
* @deprecated use {@link #setBasePotionType(org.bukkit.potion.PotionType)}
*/
@Deprecated
@Deprecated(since = "1.9")
boolean setMainEffect(@NotNull PotionEffectType type);
/**

View File

@@ -17,7 +17,7 @@ public interface SkullMeta extends ItemMeta {
* @return the owner if the skull
* @deprecated see {@link #getOwningPlayer()}.
*/
@Deprecated
@Deprecated(since = "1.12.1")
@Nullable
String getOwner();
@@ -35,7 +35,7 @@ public interface SkullMeta extends ItemMeta {
* @return true if the owner was successfully set
* @deprecated see {@link #setOwningPlayer(org.bukkit.OfflinePlayer)}.
*/
@Deprecated
@Deprecated(since = "1.12.1")
boolean setOwner(@Nullable String owner);
/**

View File

@@ -17,7 +17,7 @@ public interface SpawnEggMeta extends ItemMeta {
* @return The entity type. May be null for implementation specific default.
* @deprecated different types are different items
*/
@Deprecated
@Deprecated(since = "1.13")
@Contract("-> fail")
EntityType getSpawnedType();
@@ -28,7 +28,7 @@ public interface SpawnEggMeta extends ItemMeta {
* default.
* @deprecated different types are different items
*/
@Deprecated
@Deprecated(since = "1.13")
@Contract("_ -> fail")
void setSpawnedType(EntityType type);

View File

@@ -13,7 +13,7 @@ import org.jetbrains.annotations.Nullable;
* {@link org.bukkit.persistence.PersistentDataHolder} API. Please use
* {@link org.bukkit.persistence.PersistentDataHolder} instead of this.
*/
@Deprecated
@Deprecated(since = "1.14")
public interface CustomItemTagContainer {
/**

View File

@@ -11,7 +11,7 @@ import org.jetbrains.annotations.NotNull;
* @deprecated this API part has been replaced by {@link PersistentDataHolder}.
* Please use {@link PersistentDataAdapterContext} instead of this.
*/
@Deprecated
@Deprecated(since = "1.14")
public interface ItemTagAdapterContext {
/**

View File

@@ -46,7 +46,7 @@ import org.jetbrains.annotations.NotNull;
*
* @deprecated please use {@link PersistentDataType} as this part of the api is being replaced
*/
@Deprecated
@Deprecated(since = "1.14")
public interface ItemTagType<T, Z> {
/*