Class RecipeStorage.Builder

java.lang.Object
com.minecolonies.api.crafting.RecipeStorage.Builder
Enclosing class:
RecipeStorage

public static class RecipeStorage.Builder extends Object
  • Constructor Details

    • Builder

      public Builder()
      Default constructor.
    • Builder

      public Builder(@NotNull @NotNull IRecipeStorage recipe)
      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

      public RecipeStorage.Builder withInputs(@NotNull @NotNull List<ItemStorage> inputs)
      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

      public RecipeStorage.Builder withGridSize(int gridSize)
      Set the crafting grid size (e.g. 3 for 3x3 grid).
      Parameters:
      gridSize - the required grid size to make it.
      Returns:
      this
    • withToken

      public RecipeStorage.Builder withToken(@Nullable @Nullable IToken<?> token)
      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

      public RecipeStorage.Builder withRequiredTool(@NotNull @NotNull EquipmentTypeEntry tool)
      Set the required crafting tool
      Parameters:
      tool - the tool needed to craft (in addition to anything in the recipe itself)
      Returns:
      this
    • build

      public RecipeStorage build()
      Build the recipe.
      Returns:
      the recipe.