mirror of
https://github.com/PaperMC/Paper.git
synced 2025-08-04 06:02:12 -07:00
[Bleeding] Add ways to retrieve and delete crafting recipes and fixed some issues with the existing recipe API.
- New recipe iterator which enables deleting specific recipes - Functions to delete all recipes or revert to vanilla recipe set - Fixed the recipes API; you should now be able to define recipes that take brewed potions! - Fetch all recipes that result in a specific item By: Celtic Minstrel <celtic.minstrel.ca@some.place>
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
package org.bukkit;
|
||||
|
||||
import java.io.File;
|
||||
import java.util.Iterator;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
@@ -12,6 +13,7 @@ import org.bukkit.command.CommandSender;
|
||||
import org.bukkit.command.ConsoleCommandSender;
|
||||
import org.bukkit.command.PluginCommand;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.inventory.ItemStack;
|
||||
import org.bukkit.inventory.Recipe;
|
||||
import org.bukkit.map.MapView;
|
||||
import org.bukkit.plugin.PluginManager;
|
||||
@@ -382,10 +384,36 @@ public interface Server extends PluginMessageRecipient {
|
||||
* Adds a recipe to the crafting manager.
|
||||
*
|
||||
* @param recipe The recipe to add.
|
||||
* @return True to indicate that the recipe was added.
|
||||
* @return True if the recipe was added, false if it wasn't for some reason.
|
||||
*/
|
||||
public boolean addRecipe(Recipe recipe);
|
||||
|
||||
/**
|
||||
* Get a list of all recipes for a given item. The stack size is ignored in comparisons.
|
||||
* If the durability is -1, it will match any data value.
|
||||
*
|
||||
* @param result The item whose recipes you want
|
||||
* @return The list of recipes
|
||||
*/
|
||||
public List<Recipe> getRecipesFor(ItemStack result);
|
||||
|
||||
/**
|
||||
* Get an iterator through the list of crafting recipes.
|
||||
*
|
||||
* @return The iterator.
|
||||
*/
|
||||
public Iterator<Recipe> recipeIterator();
|
||||
|
||||
/**
|
||||
* Clears the list of crafting recipes.
|
||||
*/
|
||||
public void clearRecipes();
|
||||
|
||||
/**
|
||||
* Resets the list of crafting recipes to the default.
|
||||
*/
|
||||
public void resetRecipes();
|
||||
|
||||
/**
|
||||
* Gets a list of command aliases defined in the server properties.
|
||||
*
|
||||
|
Reference in New Issue
Block a user