Record Class ProcessingRecipe
java.lang.Object
java.lang.Record
fr.robie.machineengine.api.recipe.ProcessingRecipe
- Record Components:
inputs- each matcher's amount is consumedoutputs- produced on completion (may be empty: a sink)duration- base ticks, scaled bymachineengine:process_durationcostPerTick- paid every tick, scaled bymachineengine:process_cost; the process pauses while it cannot be paidchanceOutputs- 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().-
Nested Class Summary
Nested Classes -
Constructor Summary
ConstructorsConstructorDescriptionProcessingRecipe(@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) 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) Creates an instance of aProcessingReciperecord class. -
Method Summary
Modifier and TypeMethodDescriptionstatic @NotNull ProcessingRecipe.Builderbuilder(@NotNull net.kyori.adventure.key.Key key, @NotNull RecipeType<ProcessingRecipe> type) @NotNull List<ChanceOutput> Returns the value of thechanceOutputsrecord component.@NotNull List<ResourceStack> Returns the value of thecostPerTickrecord component.longduration()Returns the value of thedurationrecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.@NotNull List<ResourceMatcher> inputs()Returns the value of theinputsrecord component.@NotNull net.kyori.adventure.key.Keykey()Returns the value of thekeyrecord component.@NotNull List<ResourceStack> outputs()Returns the value of theoutputsrecord component.final StringtoString()Returns a string representation of this record class.@NotNull RecipeType<ProcessingRecipe> type()Returns the value of thetyperecord component.
-
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 aProcessingReciperecord class.- Parameters:
key- the value for thekeyrecord componenttype- the value for thetyperecord componentinputs- the value for theinputsrecord componentoutputs- the value for theoutputsrecord componentduration- the value for thedurationrecord componentcostPerTick- the value for thecostPerTickrecord componentchanceOutputs- the value for thechanceOutputsrecord 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
-
hashCode
-
equals
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 withObjects::equals(Object,Object); primitive components are compared with thecomparemethod from their corresponding wrapper classes. -
key
@NotNull public @NotNull net.kyori.adventure.key.Key key()Returns the value of thekeyrecord component.- Specified by:
keyin interfacenet.kyori.adventure.key.Keyed- Returns:
- the value of the
keyrecord component
-
type
Returns the value of thetyperecord component. -
inputs
-
outputs
-
duration
-
costPerTick
Returns the value of thecostPerTickrecord component.- Returns:
- the value of the
costPerTickrecord component
-
chanceOutputs
Returns the value of thechanceOutputsrecord component.- Returns:
- the value of the
chanceOutputsrecord component
-