Package com.minecolonies.api.crafting
Interface IRecipeManager
- All Known Implementing Classes:
StandardRecipeManager
public interface IRecipeManager
The Interface describing the recipeManager which takes care of the recipes discovered by the colonies in this world.
-
Method Summary
Modifier and TypeMethodDescriptionIToken<?>addRecipe(IRecipeStorage storage) Add a recipe to the map.IToken<?>checkOrAddRecipe(IRecipeStorage storage) Check if recipe is in map already, if not.Get a recipe from the storage.IToken<?>getRecipeId(IRecipeStorage storage) Get the recipe id of a given recipeStorage.com.google.common.collect.ImmutableMap<IToken<?>,IRecipeStorage> Get a unmodifiable copy of the recipes map.voidread(@NotNull net.minecraft.nbt.CompoundTag compound) Read Colonies from saved NBT data.voidregisterUse(IToken<?> token) Register the recipe as used with the recipe managervoidreset()Clear the recipe list (used during shutdown)voidwrite(@NotNull net.minecraft.nbt.CompoundTag compound) Write colonies to NBT data for saving.
-
Method Details
-
getRecipes
com.google.common.collect.ImmutableMap<IToken<?>,IRecipeStorage> getRecipes()Get a unmodifiable copy of the recipes map.- Returns:
- a map of Token, RecipeStorage.
-
getRecipe
Get a recipe from the storage.- Parameters:
token- the unique token.- Returns:
- the recipe.
-
addRecipe
Add a recipe to the map.- Parameters:
storage- the recipe to add- Returns:
- the IToken.
-
checkOrAddRecipe
Check if recipe is in map already, if not. Add a recipe to the map.- Parameters:
storage- the recipe to add- Returns:
- the iToken.
-
getRecipeId
Get the recipe id of a given recipeStorage.- Parameters:
storage- the storage.- Returns:
- the id or null if inexistent.
-
registerUse
Register the recipe as used with the recipe manager- Parameters:
token- the recipe token
-
write
void write(@NotNull @NotNull net.minecraft.nbt.CompoundTag compound) Write colonies to NBT data for saving.- Parameters:
compound- NBT-Tag.
-
read
void read(@NotNull @NotNull net.minecraft.nbt.CompoundTag compound) Read Colonies from saved NBT data.- Parameters:
compound- NBT Tag.
-
reset
void reset()Clear the recipe list (used during shutdown)
-