Record Class ChanceOutput
java.lang.Object
java.lang.Record
fr.robie.machineengine.api.recipe.ChanceOutput
An extra recipe output produced with probability
chance() (e.g. sawdust from a sawmill).
Rolled once when the process starts, with the machine's own random, then kept with the process.-
Constructor Summary
ConstructorsConstructorDescriptionChanceOutput(@NotNull ResourceStack stack, double chance) Creates an instance of aChanceOutputrecord class. -
Method Summary
Modifier and TypeMethodDescriptiondoublechance()Returns the value of thechancerecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.@NotNull ResourceStackstack()Returns the value of thestackrecord component.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
ChanceOutput
Creates an instance of aChanceOutputrecord class.- Parameters:
stack- the value for thestackrecord componentchance- the value for thechancerecord component
-
-
Method Details
-
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. -
stack
Returns the value of thestackrecord component.- Returns:
- the value of the
stackrecord component
-
chance
public double chance()Returns the value of thechancerecord component.- Returns:
- the value of the
chancerecord component
-