Record Class MachineAction.Outcome
java.lang.Object
java.lang.Record
fr.robie.machineengine.api.machine.MachineAction.Outcome
- Record Components:
done- whether it did anything (the menu redraws)used- how much ofMachineAction.Click.heldthe machine tookgive- what goes to the player's inventory (dropped at their feet if full)message- shown to the player (action bar), or null
- Enclosing interface:
MachineAction
public static record MachineAction.Outcome(boolean done, long used, @NotNull List<ResourceStack> give, @Nullable net.kyori.adventure.text.Component message)
extends Record
What came of an action.
-
Constructor Summary
ConstructorsConstructorDescriptionOutcome(boolean done, long used, @NotNull List<ResourceStack> give, @Nullable net.kyori.adventure.text.Component message) Creates an instance of aOutcomerecord class. -
Method Summary
Modifier and TypeMethodDescriptionbooleandone()Returns the value of thedonerecord component.final booleanIndicates whether some other object is "equal to" this one.@NotNull List<ResourceStack> give()Returns the value of thegiverecord component.static @NotNull MachineAction.Outcomegive(@NotNull ResourceStack... stacks) Givesstacksto the player.final inthashCode()Returns a hash code value for this object.@Nullable net.kyori.adventure.text.Componentmessage()Returns the value of themessagerecord component.static @NotNull MachineAction.Outcomenothing()Did nothing, silently (e.g.static @NotNull MachineAction.Outcomeok()static @NotNull MachineAction.Outcomerefused(@NotNull net.kyori.adventure.text.Component message) Did nothing, and tells the player why.final StringtoString()Returns a string representation of this record class.longused()Returns the value of theusedrecord component.static @NotNull MachineAction.Outcomeused(long used) Tookusedof the held stack.@NotNull MachineAction.OutcomewithMessage(@Nullable net.kyori.adventure.text.Component message)
-
Constructor Details
-
Outcome
public Outcome(boolean done, long used, @NotNull @NotNull List<ResourceStack> give, @Nullable @Nullable net.kyori.adventure.text.Component message) Creates an instance of aOutcomerecord class.
-
-
Method Details
-
ok
-
used
Tookusedof the held stack. -
give
@NotNull public static @NotNull MachineAction.Outcome give(@NotNull @NotNull ResourceStack... stacks) Givesstacksto the player. -
refused
@NotNull public static @NotNull MachineAction.Outcome refused(@NotNull @NotNull net.kyori.adventure.text.Component message) Did nothing, and tells the player why. -
nothing
Did nothing, silently (e.g. a click on an empty row). -
withMessage
@NotNull public @NotNull MachineAction.Outcome withMessage(@Nullable @Nullable net.kyori.adventure.text.Component message) -
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. -
done
-
used
-
give
-
message
-