Deprecate magic values

By: Wesley Wolfe <weswolf@aol.com>
This commit is contained in:
Bukkit/Spigot
2013-08-19 13:32:18 -05:00
parent d9f3848e22
commit f9bec6eadd
108 changed files with 1194 additions and 11 deletions

View File

@@ -36,7 +36,9 @@ public class FurnaceRecipe implements Recipe {
* @param result The item you want the recipe to create.
* @param source The input material.
* @param data The data value. (Note: This is currently ignored by the CraftBukkit server.)
* @deprecated Magic value
*/
@Deprecated
public FurnaceRecipe(ItemStack result, Material source, int data) {
this.output = new ItemStack(result);
this.ingredient = new ItemStack(source, 1, (short) data);
@@ -68,7 +70,9 @@ public class FurnaceRecipe implements Recipe {
* @param input The input material.
* @param data The data value. (Note: This is currently ignored by the CraftBukkit server.)
* @return The changed recipe, so you can chain calls.
* @deprecated Magic value
*/
@Deprecated
public FurnaceRecipe setInput(Material input, int data) {
this.ingredient = new ItemStack(input, 1, (short) data);
return this;

View File

@@ -126,7 +126,9 @@ public interface Inventory extends Iterable<ItemStack> {
*
* @param materialId The materialId to check for
* @return true if an ItemStack in this inventory contains the materialId
* @deprecated Magic value
*/
@Deprecated
public boolean contains(int materialId);
/**
@@ -153,7 +155,9 @@ public interface Inventory extends Iterable<ItemStack> {
* @param materialId The materialId to check for
* @param amount The minimum amount to look for
* @return true if this contains any matching ItemStack with the given materialId and amount
* @deprecated Magic value
*/
@Deprecated
public boolean contains(int materialId, int amount);
/**
@@ -195,7 +199,9 @@ public interface Inventory extends Iterable<ItemStack> {
*
* @param materialId The materialId to look for
* @return A HashMap containing the slot index, ItemStack pairs
* @deprecated Magic value
*/
@Deprecated
public HashMap<Integer, ? extends ItemStack> all(int materialId);
/**
@@ -230,7 +236,9 @@ public interface Inventory extends Iterable<ItemStack> {
*
* @param materialId The materialId to look for
* @return The slot index of the given materialId or -1 if not found
* @deprecated Magic value
*/
@Deprecated
public int first(int materialId);
/**
@@ -262,7 +270,9 @@ public interface Inventory extends Iterable<ItemStack> {
* Removes all stacks in the inventory matching the given materialId.
*
* @param materialId The material to remove
* @deprecated Magic value
*/
@Deprecated
public void remove(int materialId);
/**
@@ -325,6 +335,7 @@ public interface Inventory extends Iterable<ItemStack> {
*/
public InventoryHolder getHolder();
@Override
public ListIterator<ItemStack> iterator();
/**

View File

@@ -56,6 +56,11 @@ public abstract class InventoryView {
return style;
}
/**
*
* @deprecated Magic value
*/
@Deprecated
public int getId() {
return id;
}

View File

@@ -30,7 +30,9 @@ public class ItemStack implements Cloneable, ConfigurationSerializable {
* Defaults stack size to 1, with no extra data
*
* @param type item material id
* @deprecated Magic value
*/
@Deprecated
public ItemStack(final int type) {
this(type, 1);
}
@@ -49,7 +51,9 @@ public class ItemStack implements Cloneable, ConfigurationSerializable {
*
* @param type item material id
* @param amount stack size
* @deprecated Magic value
*/
@Deprecated
public ItemStack(final int type, final int amount) {
this(type, amount, (short) 0);
}
@@ -70,7 +74,9 @@ public class ItemStack implements Cloneable, ConfigurationSerializable {
* @param type item material id
* @param amount stack size
* @param damage durability / damage
* @deprecated Magic value
*/
@Deprecated
public ItemStack(final int type, final int amount, final short damage) {
this.type = type;
this.amount = amount;
@@ -163,7 +169,9 @@ public class ItemStack implements Cloneable, ConfigurationSerializable {
* Gets the type id of this item
*
* @return Type Id of the items in this stack
* @deprecated Magic value
*/
@Deprecated
public int getTypeId() {
return type;
}
@@ -174,7 +182,9 @@ public class ItemStack implements Cloneable, ConfigurationSerializable {
* Note that in doing so you will reset the MaterialData for this stack
*
* @param type New type id to set the items in this stack to
* @deprecated Magic value
*/
@Deprecated
public void setTypeId(int type) {
this.type = type;
if (this.meta != null) {

View File

@@ -119,7 +119,9 @@ public interface PlayerInventory extends Inventory {
* @param id the id of the item you want to clear from the inventory
* @param data the data of the item you want to clear from the inventory
* @return The number of items cleared
* @deprecated Magic value
*/
@Deprecated
public int clear(int id, int data);
public HumanEntity getHolder();

View File

@@ -33,7 +33,7 @@ public class ShapedRecipe implements Recipe {
/**
* Set the shape of this recipe to the specified rows. Each character represents a different
* ingredient; exactly what each character represents is set separately. The first row supplied
* corresponds with the upper most part of the recipe on the workbench e.g. if all three
* corresponds with the upper most part of the recipe on the workbench e.g. if all three
* rows are supplies the first string represents the top row on the workbench.
*
* @param shape The rows of the recipe (up to 3 rows).
@@ -93,7 +93,9 @@ public class ShapedRecipe implements Recipe {
* @param ingredient The ingredient.
* @param raw The raw material data as an integer.
* @return The changed recipe, so you can chain calls.
* @deprecated Magic value
*/
@Deprecated
public ShapedRecipe setIngredient(char key, Material ingredient, int raw) {
Validate.isTrue(ingredients.containsKey(key), "Symbol does not appear in the shape:", key);

View File

@@ -59,7 +59,9 @@ public class ShapelessRecipe implements Recipe {
* @param ingredient The ingredient to add.
* @param rawdata The data value, or -1 to allow any data value.
* @return The changed recipe, so you can chain calls.
* @deprecated Magic value
*/
@Deprecated
public ShapelessRecipe addIngredient(Material ingredient, int rawdata) {
return addIngredient(1, ingredient, rawdata);
}
@@ -93,7 +95,9 @@ public class ShapelessRecipe implements Recipe {
* @param ingredient The ingredient to add.
* @param rawdata The data value, or -1 to allow any data value.
* @return The changed recipe, so you can chain calls.
* @deprecated Magic value
*/
@Deprecated
public ShapelessRecipe addIngredient(int count, Material ingredient, int rawdata) {
Validate.isTrue(ingredients.size() + count <= 9, "Shapeless recipes cannot have more than 9 ingredients");
@@ -166,7 +170,9 @@ public class ShapelessRecipe implements Recipe {
* @param ingredient The ingredient to remove
* @param rawdata The data value;
* @return The changed recipe.
* @deprecated Magic value
*/
@Deprecated
public ShapelessRecipe removeIngredient(Material ingredient, int rawdata) {
return removeIngredient(1, ingredient, rawdata);
}
@@ -180,7 +186,9 @@ public class ShapelessRecipe implements Recipe {
* @param ingredient The ingredient to remove.
* @param rawdata The data value.
* @return The changed recipe.
* @deprecated Magic value
*/
@Deprecated
public ShapelessRecipe removeIngredient(int count, Material ingredient, int rawdata) {
Iterator<ItemStack> iterator = ingredients.iterator();
while (count > 0 && iterator.hasNext()) {