Class StandardRecipeManager
java.lang.Object
com.minecolonies.core.colony.requestsystem.management.manager.StandardRecipeManager
- All Implemented Interfaces:
IRecipeManager
-
Constructor Summary
Constructors -
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.
-
Constructor Details
-
StandardRecipeManager
public StandardRecipeManager()
-
-
Method Details
-
getRecipes
Description copied from interface:IRecipeManagerGet a unmodifiable copy of the recipes map.- Specified by:
getRecipesin interfaceIRecipeManager- Returns:
- a map of Token, RecipeStorage.
-
getRecipe
Description copied from interface:IRecipeManagerGet a recipe from the storage.- Specified by:
getRecipein interfaceIRecipeManager- Parameters:
token- the unique token.- Returns:
- the recipe.
-
addRecipe
Description copied from interface:IRecipeManagerAdd a recipe to the map.- Specified by:
addRecipein interfaceIRecipeManager- Parameters:
storage- the recipe to add- Returns:
- the IToken.
-
checkOrAddRecipe
Description copied from interface:IRecipeManagerCheck if recipe is in map already, if not. Add a recipe to the map.- Specified by:
checkOrAddRecipein interfaceIRecipeManager- Parameters:
storage- the recipe to add- Returns:
- the iToken.
-
getRecipeId
Description copied from interface:IRecipeManagerGet the recipe id of a given recipeStorage.- Specified by:
getRecipeIdin interfaceIRecipeManager- Parameters:
storage- the storage.- Returns:
- the id or null if inexistent.
-
write
public void write(@NotNull @NotNull net.minecraft.nbt.CompoundTag compound) Description copied from interface:IRecipeManagerWrite colonies to NBT data for saving.- Specified by:
writein interfaceIRecipeManager- Parameters:
compound- NBT-Tag.
-
read
public void read(@NotNull @NotNull net.minecraft.nbt.CompoundTag compound) Description copied from interface:IRecipeManagerRead Colonies from saved NBT data.- Specified by:
readin interfaceIRecipeManager- Parameters:
compound- NBT Tag.
-
reset
public void reset()Description copied from interface:IRecipeManagerClear the recipe list (used during shutdown)- Specified by:
resetin interfaceIRecipeManager
-
registerUse
Description copied from interface:IRecipeManagerRegister the recipe as used with the recipe manager- Specified by:
registerUsein interfaceIRecipeManager- Parameters:
token- the recipe token
-