Record Class ProcessingRecipe

java.lang.Object
java.lang.Record
fr.robie.machineengine.api.recipe.ProcessingRecipe
Record Components:
inputs - each matcher's amount is consumed
outputs - produced on completion (may be empty: a sink)
duration - base ticks, scaled by machineengine:process_duration
costPerTick - paid every tick, scaled by machineengine:process_cost; the process pauses while it cannot be paid
chanceOutputs - extra outputs, each produced with its chance (rolled when the process starts)
All Implemented Interfaces:
Recipe, net.kyori.adventure.key.Keyed

public record ProcessingRecipe(@NotNull net.kyori.adventure.key.Key key, @NotNull RecipeType<ProcessingRecipe> type, @NotNull List<ResourceMatcher> inputs, @NotNull List<ResourceStack> outputs, long duration, @NotNull List<ResourceStack> costPerTick, @NotNull List<ChanceOutput> chanceOutputs) extends Record implements Recipe
A timed transformation run by the built-in process (ARCHITECTURE.md ยง13): consume inputs() when starting, pay costPerTick() every tick for duration() ticks, then produce outputs().
  • Constructor Details

    • ProcessingRecipe

      public ProcessingRecipe(@NotNull @NotNull net.kyori.adventure.key.Key key, @NotNull @NotNull RecipeType<ProcessingRecipe> type, @NotNull @NotNull List<ResourceMatcher> inputs, @NotNull @NotNull List<ResourceStack> outputs, long duration, @NotNull @NotNull List<ResourceStack> costPerTick, @NotNull @NotNull List<ChanceOutput> chanceOutputs)
      Creates an instance of a ProcessingRecipe record class.
      Parameters:
      key - the value for the key record component
      type - the value for the type record component
      inputs - the value for the inputs record component
      outputs - the value for the outputs record component
      duration - the value for the duration record component
      costPerTick - the value for the costPerTick record component
      chanceOutputs - the value for the chanceOutputs record component
    • ProcessingRecipe

      public ProcessingRecipe(@NotNull @NotNull net.kyori.adventure.key.Key key, @NotNull @NotNull RecipeType<ProcessingRecipe> type, @NotNull @NotNull List<ResourceMatcher> inputs, @NotNull @NotNull List<ResourceStack> outputs, long duration, @NotNull @NotNull List<ResourceStack> costPerTick)
  • Method Details

    • builder

      @NotNull public static @NotNull ProcessingRecipe.Builder builder(@NotNull @NotNull net.kyori.adventure.key.Key key, @NotNull @NotNull RecipeType<ProcessingRecipe> type)
    • toString

      public final String toString()
      Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • hashCode

      public final int hashCode()
      Returns a hash code value for this object. The value is derived from the hash code of each of the record components.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object o)
      Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. Reference components are compared with Objects::equals(Object,Object); primitive components are compared with the compare method from their corresponding wrapper classes.
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • key

      @NotNull public @NotNull net.kyori.adventure.key.Key key()
      Returns the value of the key record component.
      Specified by:
      key in interface net.kyori.adventure.key.Keyed
      Returns:
      the value of the key record component
    • type

      @NotNull public @NotNull RecipeType<ProcessingRecipe> type()
      Returns the value of the type record component.
      Specified by:
      type in interface Recipe
      Returns:
      the value of the type record component
    • inputs

      @NotNull public @NotNull List<ResourceMatcher> inputs()
      Returns the value of the inputs record component.
      Returns:
      the value of the inputs record component
    • outputs

      @NotNull public @NotNull List<ResourceStack> outputs()
      Returns the value of the outputs record component.
      Returns:
      the value of the outputs record component
    • duration

      public long duration()
      Returns the value of the duration record component.
      Returns:
      the value of the duration record component
    • costPerTick

      @NotNull public @NotNull List<ResourceStack> costPerTick()
      Returns the value of the costPerTick record component.
      Returns:
      the value of the costPerTick record component
    • chanceOutputs

      @NotNull public @NotNull List<ChanceOutput> chanceOutputs()
      Returns the value of the chanceOutputs record component.
      Returns:
      the value of the chanceOutputs record component