Commits

md_5 authored 2fd45ae392e
Improve ItemFactory#enchantItem consistency
No tags

src/main/java/org/bukkit/inventory/ItemFactory.java

Modified
177 177
178 178 /**
179 179 * Enchants the given item at the provided level.
180 180 * <br>
181 181 * If an item that is air is passed through an error is thrown.
182 182 *
183 183 * @param entity the entity to use as a source of randomness
184 184 * @param item the item to enchant
185 185 * @param level the level to use, which is the level in the enchantment table
186 186 * @param allowTreasures allows treasure enchants, e.g. mending, if true.
187 - * @return the modified ItemStack, or a copy if the ItemStack cannot be enchanted directly
187 + * @return a new ItemStack containing the result of the Enchantment
188 188 */
189 189 @NotNull
190 190 ItemStack enchantItem(@NotNull final Entity entity, @NotNull final ItemStack item, final int level, final boolean allowTreasures);
191 191
192 192 /**
193 193 * Enchants the given item at the provided level.
194 194 * <br>
195 195 * If an item that is air is passed through an error is thrown.
196 196 *
197 197 * @param world the world to use as a source of randomness
198 198 * @param item the item to enchant
199 199 * @param level the level to use, which is the level in the enchantment table
200 200 * @param allowTreasures allow the treasure enchants, e.g. mending, if true.
201 - * @return the modified ItemStack, or a copy if the ItemStack cannot be
202 - * enchanted directly
201 + * @return a new ItemStack containing the result of the Enchantment
203 202 */
204 203 @NotNull
205 204 ItemStack enchantItem(@NotNull final World world, @NotNull final ItemStack item, final int level, final boolean allowTreasures);
206 205
207 206 /**
208 207 * Enchants the given item at the provided level.
209 208 * <br>
210 209 * If an item that is air is passed through an error is thrown.
211 210 *
212 211 * @param item the item to enchant
213 212 * @param level the level to use, which is the level in the enchantment table
214 213 * @param allowTreasures allow treasure enchantments, e.g. mending, if true.
215 - * @return the modified ItemStack, or a copy if the ItemStack cannot be
216 - * enchanted directly
214 + * @return a new ItemStack containing the result of the Enchantment
217 215 */
218 216 @NotNull
219 217 ItemStack enchantItem(@NotNull final ItemStack item, final int level, final boolean allowTreasures);
220 218 }

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

Add shortcut