Interface ShapedRecipe.Builder

Enclosing interface:
ShapedRecipe

public static interface ShapedRecipe.Builder
Builds a ShapedRecipe, vanilla-style: a pattern of characters and what each one stands for. A space is an empty cell.

Builders are mutable and are not safe to share between threads.

Since:
0.1.0
  • Method Details

    • pattern

      ShapedRecipe.Builder pattern(String... rows)
      Parameters:
      rows - one string per row, all as wide, at most 3 of at most 3 characters
      Returns:
      this builder
      Since:
      0.1.0
    • define

      ShapedRecipe.Builder define(char symbol, Ingredient ingredient)
      Parameters:
      symbol - a character of the pattern, anything but a space
      ingredient - what it stands for
      Returns:
      this builder
      Since:
      0.1.0
    • result

      Parameters:
      result - what one craft gives
      Returns:
      this builder
      Since:
      0.1.0
    • group

      Parameters:
      group - the recipe book group, empty for none
      Returns:
      this builder
      Since:
      0.1.0
    • category

      Parameters:
      category - the recipe book tab
      Returns:
      this builder
      Since:
      0.1.0
    • mirrored

      ShapedRecipe.Builder mirrored(boolean mirrored)
      Parameters:
      mirrored - whether the pattern also matches flipped left to right, true by default
      Returns:
      this builder
      Since:
      0.1.0
    • build

      ShapedRecipe build()
      Returns:
      the recipe
      Throws:
      IllegalArgumentException - if the pattern is malformed, uses an undefined symbol, leaves a definition unused or the result is empty
      Since:
      0.1.0