Fix Spigot annotation mistakes
while some of these may of been true, they are extreme cases and cause a ton of noise to plugin developers. Use ApiStatus.Internal instead of Deprecated for actual internal API that continues to have use (internally). These do not help plugin developers if they bring moise noise than value.
This commit is contained in:
@@ -68,7 +68,9 @@ public abstract class CookingRecipe<T extends CookingRecipe> implements Recipe,
|
||||
* Get the input material.
|
||||
*
|
||||
* @return The input material.
|
||||
* @deprecated Use {@link #getInputChoice()} instead for more complete data.
|
||||
*/
|
||||
@Deprecated // Paper
|
||||
@NotNull
|
||||
public ItemStack getInput() {
|
||||
return this.ingredient.getItemStack();
|
||||
|
||||
@@ -21,8 +21,7 @@ public interface CraftingInventory extends Inventory {
|
||||
*
|
||||
* @return The contents. Individual entries may be null.
|
||||
*/
|
||||
@NotNull
|
||||
ItemStack[] getMatrix();
|
||||
@Nullable ItemStack @NotNull [] getMatrix(); // Paper - make array elements nullable instead array
|
||||
|
||||
/**
|
||||
* Set the item in the result slot of the crafting inventory.
|
||||
@@ -38,7 +37,7 @@ public interface CraftingInventory extends Inventory {
|
||||
* @throws IllegalArgumentException if the length of contents is greater
|
||||
* than the size of the crafting matrix.
|
||||
*/
|
||||
void setMatrix(@NotNull ItemStack[] contents);
|
||||
void setMatrix(@Nullable ItemStack @NotNull [] contents); // Paper - make array elements nullable instead array
|
||||
|
||||
/**
|
||||
* Get the current recipe formed on the crafting inventory, if any.
|
||||
|
||||
@@ -525,6 +525,6 @@ public interface EntityEquipment {
|
||||
*
|
||||
* @return the entity this EntityEquipment belongs to
|
||||
*/
|
||||
@Nullable
|
||||
@NotNull // Paper
|
||||
Entity getHolder();
|
||||
}
|
||||
|
||||
@@ -67,8 +67,10 @@ public class FurnaceRecipe extends CookingRecipe<FurnaceRecipe> {
|
||||
*
|
||||
* @param input The input material.
|
||||
* @return The changed recipe, so you can chain calls.
|
||||
* @deprecated use {@link #setInputChoice(RecipeChoice)}
|
||||
*/
|
||||
@NotNull
|
||||
@Deprecated
|
||||
public FurnaceRecipe setInput(@NotNull MaterialData input) {
|
||||
return setInput(input.getItemType(), input.getData());
|
||||
}
|
||||
|
||||
@@ -161,8 +161,7 @@ public interface Inventory extends Iterable<ItemStack> {
|
||||
*
|
||||
* @return An array of ItemStacks from the inventory. Individual items may be null.
|
||||
*/
|
||||
@NotNull
|
||||
public ItemStack[] getContents();
|
||||
public @Nullable ItemStack @NotNull [] getContents(); // Paper - make array elements nullable instead array
|
||||
|
||||
/**
|
||||
* Completely replaces the inventory's contents. Removes all existing
|
||||
@@ -173,7 +172,7 @@ public interface Inventory extends Iterable<ItemStack> {
|
||||
* @throws IllegalArgumentException If the array has more items than the
|
||||
* inventory.
|
||||
*/
|
||||
public void setContents(@NotNull ItemStack[] items) throws IllegalArgumentException;
|
||||
public void setContents(@Nullable ItemStack @NotNull [] items) throws IllegalArgumentException; // Paper - make array elements nullable instead array
|
||||
|
||||
/**
|
||||
* Return the contents from the section of the inventory where items can
|
||||
@@ -186,8 +185,7 @@ public interface Inventory extends Iterable<ItemStack> {
|
||||
*
|
||||
* @return inventory storage contents. Individual items may be null.
|
||||
*/
|
||||
@NotNull
|
||||
public ItemStack[] getStorageContents();
|
||||
public @Nullable ItemStack @NotNull [] getStorageContents(); // Paper - make array elements nullable instead array
|
||||
|
||||
/**
|
||||
* Put the given ItemStacks into the storage slots
|
||||
@@ -196,7 +194,7 @@ public interface Inventory extends Iterable<ItemStack> {
|
||||
* @throws IllegalArgumentException If the array has more items than the
|
||||
* inventory.
|
||||
*/
|
||||
public void setStorageContents(@NotNull ItemStack[] items) throws IllegalArgumentException;
|
||||
public void setStorageContents(@Nullable ItemStack @NotNull [] items) throws IllegalArgumentException; // Paper - make array elements nullable instead array
|
||||
|
||||
/**
|
||||
* Checks if the inventory contains any ItemStacks with the given
|
||||
|
||||
@@ -123,9 +123,9 @@ public interface InventoryView {
|
||||
* Gets the id of this view.
|
||||
*
|
||||
* @return the id of this view
|
||||
* @deprecated Magic value
|
||||
* @apiNote Internal Use Only
|
||||
*/
|
||||
@Deprecated(since = "1.6.2")
|
||||
@org.jetbrains.annotations.ApiStatus.Internal // Paper
|
||||
public int getId() {
|
||||
return id;
|
||||
}
|
||||
@@ -195,10 +195,10 @@ public interface InventoryView {
|
||||
/**
|
||||
* Get the item on the cursor of one of the viewing players.
|
||||
*
|
||||
* @return The item on the player's cursor, or null if they aren't holding
|
||||
* one.
|
||||
* @return The item on the player's cursor, or an empty stack
|
||||
* if they aren't holding one.
|
||||
*/
|
||||
@Nullable
|
||||
@NotNull // Paper - fix nullability
|
||||
public ItemStack getCursor();
|
||||
|
||||
/**
|
||||
@@ -296,8 +296,10 @@ public interface InventoryView {
|
||||
* made using {@link #setTitle(String)}.
|
||||
*
|
||||
* @return the original title
|
||||
* @deprecated changing the title is not supported
|
||||
*/
|
||||
@NotNull
|
||||
@Deprecated(since = "1.21.1") // Paper
|
||||
public String getOriginalTitle();
|
||||
|
||||
/**
|
||||
@@ -309,6 +311,9 @@ public interface InventoryView {
|
||||
* exception.
|
||||
*
|
||||
* @param title The new title.
|
||||
* @deprecated changing the title is not supported. This method has
|
||||
* poorly defined and broken behaviors. It should not be used.
|
||||
*/
|
||||
@Deprecated(since = "1.21.1") // Paper
|
||||
public void setTitle(@NotNull String title);
|
||||
}
|
||||
|
||||
@@ -29,7 +29,7 @@ public interface ItemFactory {
|
||||
* @return a new ItemMeta that could be applied to an item stack of the
|
||||
* specified material
|
||||
*/
|
||||
@Nullable
|
||||
@org.bukkit.UndefinedNullability // Paper
|
||||
ItemMeta getItemMeta(@NotNull final Material material);
|
||||
|
||||
/**
|
||||
|
||||
@@ -10,6 +10,7 @@ import org.bukkit.Material;
|
||||
import org.bukkit.NamespacedKey;
|
||||
import org.bukkit.Registry;
|
||||
import org.bukkit.Translatable;
|
||||
import org.bukkit.UndefinedNullability;
|
||||
import org.bukkit.Utility;
|
||||
import org.bukkit.configuration.serialization.ConfigurationSerializable;
|
||||
import org.bukkit.enchantments.Enchantment;
|
||||
@@ -82,7 +83,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(since = "1.4.5")
|
||||
@Deprecated(since = "1.4.5", forRemoval = true)
|
||||
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()) {
|
||||
@@ -179,8 +180,10 @@ public class ItemStack implements Cloneable, ConfigurationSerializable, Translat
|
||||
* Gets the MaterialData for this stack of items
|
||||
*
|
||||
* @return MaterialData for this item
|
||||
* @deprecated cast to {@link org.bukkit.inventory.meta.BlockDataMeta} and use {@link org.bukkit.inventory.meta.BlockDataMeta#getBlockData(Material)}
|
||||
*/
|
||||
@Nullable
|
||||
@Deprecated(forRemoval = true, since = "1.13")
|
||||
public MaterialData getData() {
|
||||
Material mat = Bukkit.getUnsafe().toLegacy(getType());
|
||||
if (data == null && mat != null && mat.getData() != null) {
|
||||
@@ -194,7 +197,9 @@ public class ItemStack implements Cloneable, ConfigurationSerializable, Translat
|
||||
* Sets the MaterialData for this stack of items
|
||||
*
|
||||
* @param data New MaterialData for this item
|
||||
* @deprecated cast to {@link org.bukkit.inventory.meta.BlockDataMeta} and use {@link org.bukkit.inventory.meta.BlockDataMeta#setBlockData(org.bukkit.block.data.BlockData)}
|
||||
*/
|
||||
@Deprecated(forRemoval = true, since = "1.13")
|
||||
public void setData(@Nullable MaterialData data) {
|
||||
if (data == null) {
|
||||
this.data = data;
|
||||
@@ -574,7 +579,7 @@ public class ItemStack implements Cloneable, ConfigurationSerializable, Translat
|
||||
*
|
||||
* @return a copy of the current ItemStack's ItemData
|
||||
*/
|
||||
@Nullable
|
||||
@UndefinedNullability // Paper
|
||||
public ItemMeta getItemMeta() {
|
||||
return this.meta == null ? Bukkit.getItemFactory().getItemMeta(this.type) : this.meta.clone();
|
||||
}
|
||||
|
||||
@@ -16,8 +16,7 @@ public interface PlayerInventory extends Inventory {
|
||||
* null and are returned in a fixed order starting from the boots and going
|
||||
* up to the helmet
|
||||
*/
|
||||
@NotNull
|
||||
public ItemStack[] getArmorContents();
|
||||
public @Nullable ItemStack @NotNull [] getArmorContents(); // Paper - make array elements nullable instead array
|
||||
|
||||
/**
|
||||
* Get all additional ItemStacks stored in this inventory.
|
||||
@@ -28,8 +27,7 @@ public interface PlayerInventory extends Inventory {
|
||||
*
|
||||
* @return All additional ItemStacks. Individual items can be null.
|
||||
*/
|
||||
@NotNull
|
||||
public ItemStack[] getExtraContents();
|
||||
public @Nullable ItemStack @NotNull [] getExtraContents(); // Paper - make array elements nullable instead array
|
||||
|
||||
/**
|
||||
* Return the ItemStack from the helmet slot
|
||||
@@ -106,9 +104,9 @@ public interface PlayerInventory extends Inventory {
|
||||
*
|
||||
* @param slot the slot to get the ItemStack
|
||||
*
|
||||
* @return the ItemStack in the given slot or null if there is not one
|
||||
* @return the ItemStack in the given slot
|
||||
*/
|
||||
@Nullable
|
||||
@NotNull // Paper
|
||||
public ItemStack getItem(@NotNull EquipmentSlot slot);
|
||||
|
||||
/**
|
||||
|
||||
@@ -107,8 +107,10 @@ public class ShapedRecipe extends CraftingRecipe {
|
||||
* @return The changed recipe, so you can chain calls.
|
||||
* @throws IllegalArgumentException if the {@code key} is a space character
|
||||
* @throws IllegalArgumentException if the {@code key} does not appear in the shape.
|
||||
* @deprecated use {@link #setIngredient(char, RecipeChoice)}
|
||||
*/
|
||||
@NotNull
|
||||
@Deprecated // Paper
|
||||
public ShapedRecipe setIngredient(char key, @NotNull MaterialData ingredient) {
|
||||
return setIngredient(key, ingredient.getItemType(), ingredient.getData());
|
||||
}
|
||||
@@ -191,7 +193,9 @@ public class ShapedRecipe extends CraftingRecipe {
|
||||
* Get a copy of the ingredients map.
|
||||
*
|
||||
* @return The mapping of character to ingredients.
|
||||
* @deprecated Use {@link #getChoiceMap()} instead for more complete data.
|
||||
*/
|
||||
@Deprecated // Paper
|
||||
@NotNull
|
||||
public Map<Character, ItemStack> getIngredientMap() {
|
||||
HashMap<Character, ItemStack> result = new HashMap<Character, ItemStack>();
|
||||
|
||||
@@ -44,8 +44,10 @@ public class ShapelessRecipe extends CraftingRecipe {
|
||||
*
|
||||
* @param ingredient The ingredient to add.
|
||||
* @return The changed recipe, so you can chain calls.
|
||||
* @deprecated use {@link #addIngredient(RecipeChoice)}
|
||||
*/
|
||||
@NotNull
|
||||
@Deprecated
|
||||
public ShapelessRecipe addIngredient(@NotNull MaterialData ingredient) {
|
||||
return addIngredient(1, ingredient);
|
||||
}
|
||||
@@ -81,8 +83,10 @@ public class ShapelessRecipe extends CraftingRecipe {
|
||||
* @param count How many to add (can't be more than 9!)
|
||||
* @param ingredient The ingredient to add.
|
||||
* @return The changed recipe, so you can chain calls.
|
||||
* @deprecated use {@link #addIngredient(int, Material)}
|
||||
*/
|
||||
@NotNull
|
||||
@Deprecated // Paper
|
||||
public ShapelessRecipe addIngredient(int count, @NotNull MaterialData ingredient) {
|
||||
return addIngredient(count, ingredient.getItemType(), ingredient.getData());
|
||||
}
|
||||
@@ -199,8 +203,10 @@ public class ShapelessRecipe extends CraftingRecipe {
|
||||
*
|
||||
* @param ingredient The ingredient to remove
|
||||
* @return The changed recipe.
|
||||
* @deprecated use {@link #removeIngredient(Material)}
|
||||
*/
|
||||
@NotNull
|
||||
@Deprecated // Paper
|
||||
public ShapelessRecipe removeIngredient(@NotNull MaterialData ingredient) {
|
||||
return removeIngredient(ingredient.getItemType(), ingredient.getData());
|
||||
}
|
||||
@@ -227,8 +233,10 @@ public class ShapelessRecipe extends CraftingRecipe {
|
||||
* @param count The number of copies to remove.
|
||||
* @param ingredient The ingredient to remove.
|
||||
* @return The changed recipe.
|
||||
* @deprecated use {@link #removeIngredient(int, Material)}
|
||||
*/
|
||||
@NotNull
|
||||
@Deprecated // Paper
|
||||
public ShapelessRecipe removeIngredient(int count, @NotNull MaterialData ingredient) {
|
||||
return removeIngredient(count, ingredient.getItemType(), ingredient.getData());
|
||||
}
|
||||
@@ -278,7 +286,9 @@ public class ShapelessRecipe extends CraftingRecipe {
|
||||
* Get the list of ingredients used for this recipe.
|
||||
*
|
||||
* @return The input list
|
||||
* @deprecated Use {@link #getChoiceList()} instead for more complete data.
|
||||
*/
|
||||
@Deprecated // Paper
|
||||
@NotNull
|
||||
public List<ItemStack> getIngredientList() {
|
||||
ArrayList<ItemStack> result = new ArrayList<ItemStack>(ingredients.size());
|
||||
|
||||
@@ -57,7 +57,9 @@ public class StonecuttingRecipe implements Recipe, Keyed {
|
||||
* Get the input material.
|
||||
*
|
||||
* @return The input material.
|
||||
* @deprecated Use {@link #getInputChoice()} instead for more complete data.
|
||||
*/
|
||||
@Deprecated // Paper
|
||||
@NotNull
|
||||
public ItemStack getInput() {
|
||||
return this.ingredient.getItemStack();
|
||||
|
||||
@@ -187,6 +187,7 @@ public interface ItemMeta extends Cloneable, ConfigurationSerializable, Persiste
|
||||
/**
|
||||
* Checks for existence of a localized name.
|
||||
*
|
||||
* @deprecated Use {@link ItemMeta#displayName()} and check if it is instanceof a {@link net.kyori.adventure.text.TranslatableComponent}.
|
||||
* @return true if this has a localized name
|
||||
* @deprecated meta no longer exists
|
||||
*/
|
||||
@@ -199,6 +200,7 @@ public interface ItemMeta extends Cloneable, ConfigurationSerializable, Persiste
|
||||
* Plugins should check that hasLocalizedName() returns <code>true</code>
|
||||
* before calling this method.
|
||||
*
|
||||
* @deprecated Use {@link ItemMeta#displayName()} and cast it to a {@link net.kyori.adventure.text.TranslatableComponent}. No longer used by the client.
|
||||
* @return the localized name that is set
|
||||
* @deprecated meta no longer exists
|
||||
*/
|
||||
@@ -209,6 +211,7 @@ public interface ItemMeta extends Cloneable, ConfigurationSerializable, Persiste
|
||||
/**
|
||||
* Sets the localized name.
|
||||
*
|
||||
* @deprecated Use {@link ItemMeta#displayName(Component)} with a {@link net.kyori.adventure.text.TranslatableComponent}. No longer used by the client.
|
||||
* @param name the name to set
|
||||
* @deprecated meta no longer exists
|
||||
*/
|
||||
@@ -802,7 +805,7 @@ public interface ItemMeta extends Cloneable, ConfigurationSerializable, Persiste
|
||||
*
|
||||
* @return component
|
||||
*/
|
||||
@Nullable
|
||||
@NotNull // Paper
|
||||
JukeboxPlayableComponent getJukeboxPlayable();
|
||||
|
||||
/**
|
||||
|
||||
@@ -16,13 +16,8 @@ public interface MapMeta extends ItemMeta {
|
||||
*
|
||||
* @return true if this has a map ID number.
|
||||
* @see #hasMapView()
|
||||
* @deprecated These methods are poor API: They rely on the caller to pass
|
||||
* in an only an integer property, and have poorly defined implementation
|
||||
* behavior if that integer is not a valid map (the current implementation
|
||||
* for example will generate a new map with a different ID). The xxxMapView
|
||||
* family of methods should be used instead.
|
||||
*/
|
||||
@Deprecated(since = "1.13.2")
|
||||
//@Deprecated(since = "1.13.2") // Paper
|
||||
boolean hasMapId();
|
||||
|
||||
/**
|
||||
@@ -34,13 +29,8 @@ public interface MapMeta extends ItemMeta {
|
||||
*
|
||||
* @return the map ID that is set
|
||||
* @see #getMapView()
|
||||
* @deprecated These methods are poor API: They rely on the caller to pass
|
||||
* in an only an integer property, and have poorly defined implementation
|
||||
* behavior if that integer is not a valid map (the current implementation
|
||||
* for example will generate a new map with a different ID). The xxxMapView
|
||||
* family of methods should be used instead.
|
||||
*/
|
||||
@Deprecated(since = "1.13.2")
|
||||
// @Deprecated(since = "1.13.2") // Paper
|
||||
int getMapId();
|
||||
|
||||
/**
|
||||
|
||||
@@ -37,7 +37,7 @@ public interface EquippableComponent extends ConfigurationSerializable {
|
||||
*
|
||||
* @return the sound
|
||||
*/
|
||||
@Nullable
|
||||
@NotNull // Paper
|
||||
Sound getEquipSound();
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user