Commits

md_5 authored 6751b88aad4
SPIGOT-3361: Deprecate confusing MaterialData.toItemStack()
No tags

src/main/java/org/bukkit/material/MaterialData.java

Modified
83 83 */
84 84 @Deprecated
85 85 public int getItemTypeId() {
86 86 return type;
87 87 }
88 88
89 89 /**
90 90 * Creates a new ItemStack based on this MaterialData
91 91 *
92 92 * @return New ItemStack containing a copy of this MaterialData
93 + * @deprecated this method creates an ItemStack of size 0 which is not
94 + * generally useful. Consider {@link #toItemStack(int)}.
93 95 */
96 + @Deprecated
94 97 public ItemStack toItemStack() {
95 98 return new ItemStack(type, 0, data);
96 99 }
97 100
98 101 /**
99 102 * Creates a new ItemStack based on this MaterialData
100 103 *
101 104 * @param amount The stack size of the new stack
102 105 * @return New ItemStack containing a copy of this MaterialData
103 106 */

Everything looks good. We'll let you know here if there's anything you should know about.

Add shortcut