Package com.minecolonies.api.crafting
Class RecipeStorage.Builder
java.lang.Object
com.minecolonies.api.crafting.RecipeStorage.Builder
- Enclosing class:
RecipeStorage
-
Constructor Summary
ConstructorsConstructorDescriptionBuilder()Default constructor.Builder(@NotNull IRecipeStorage recipe) Construct from existing recipe. -
Method Summary
Modifier and TypeMethodDescriptionbuild()Build the recipe.withAlternateOutputs(@NotNull List<net.minecraft.world.item.ItemStack> outputs) Set alternative outputs (one-of with the primary output).withGridSize(int gridSize) Set the crafting grid size (e.g.withInputs(@NotNull List<ItemStorage> inputs) Set the recipe inputs.withIntermediate(@NotNull net.minecraft.world.level.block.Block intermediate) Set the intermediate crafting block.withLootTable(@Nullable net.minecraft.resources.ResourceKey<net.minecraft.world.level.storage.loot.LootTable> lootTable) Set the loot table.withPrimaryOutput(@NotNull net.minecraft.world.item.ItemStack output) Set the recipe primary output.withRecipeId(@Nullable net.minecraft.resources.ResourceLocation id) Set the recipe id.withRecipeType(@Nullable net.minecraft.resources.ResourceLocation type) Set the recipe type.withRequiredTool(@NotNull EquipmentTypeEntry tool) Set the required crafting toolwithSecondaryOutputs(@NotNull List<net.minecraft.world.item.ItemStack> outputs) Set the secondary outputs (in addition to the primary output).Set the token.
-
Constructor Details
-
Builder
public Builder()Default constructor. -
Builder
Construct from existing recipe.- Parameters:
recipe- a recipe to use as a base.
-
-
Method Details
-
withRecipeType
public RecipeStorage.Builder withRecipeType(@Nullable @Nullable net.minecraft.resources.ResourceLocation type) Set the recipe type.- Parameters:
type- What type of recipe this is. (ie: minecolonies:classic)- Returns:
- this
-
withRecipeId
public RecipeStorage.Builder withRecipeId(@Nullable @Nullable net.minecraft.resources.ResourceLocation id) Set the recipe id.- Parameters:
id- the source of this recipe (ie: minecolonies:crafter/recipename, "player name", "improvement", etc)- Returns:
- this
-
withInputs
Set the recipe inputs.- Parameters:
inputs- the list of input items (required for the recipe).- Returns:
- this
-
withPrimaryOutput
public RecipeStorage.Builder withPrimaryOutput(@NotNull @NotNull net.minecraft.world.item.ItemStack output) Set the recipe primary output.- Parameters:
output- the primary output of the recipe.- Returns:
- this
-
withAlternateOutputs
public RecipeStorage.Builder withAlternateOutputs(@NotNull @NotNull List<net.minecraft.world.item.ItemStack> outputs) Set alternative outputs (one-of with the primary output).- Parameters:
outputs- List of alternate outputs for a multi-output recipe- Returns:
- this
-
withSecondaryOutputs
public RecipeStorage.Builder withSecondaryOutputs(@NotNull @NotNull List<net.minecraft.world.item.ItemStack> outputs) Set the secondary outputs (in addition to the primary output).- Parameters:
outputs- List of secondary outputs for a recipe. this includes containers, etc.- Returns:
- this
-
withIntermediate
public RecipeStorage.Builder withIntermediate(@NotNull @NotNull net.minecraft.world.level.block.Block intermediate) Set the intermediate crafting block.- Parameters:
intermediate- the intermediate to use (e.g furnace).- Returns:
- this
-
withGridSize
Set the crafting grid size (e.g. 3 for 3x3 grid).- Parameters:
gridSize- the required grid size to make it.- Returns:
- this
-
withToken
Set the token.- Parameters:
token- the token of the storage.
-
withLootTable
public RecipeStorage.Builder withLootTable(@Nullable @Nullable net.minecraft.resources.ResourceKey<net.minecraft.world.level.storage.loot.LootTable> lootTable) Set the loot table.- Parameters:
lootTable- Loot table to use for possible alternate outputs- Returns:
- this
-
withRequiredTool
Set the required crafting tool- Parameters:
tool- the tool needed to craft (in addition to anything in the recipe itself)- Returns:
- this
-
build
Build the recipe.- Returns:
- the recipe.
-