Record Class ScribeAction.Lose
java.lang.Object
java.lang.Record
johnsmith.enchantingoverhauled.menu.scribe.controller.ScribeAction.Lose
- All Implemented Interfaces:
ScribeAction
- Enclosing interface:
ScribeAction
public static record ScribeAction.Lose(net.minecraft.world.item.ItemStack consumedSource)
extends Record
implements ScribeAction
Action representing a loss.
Deducts lapis if refunded, and terminates the hostage source item entirely.
-
Nested Class Summary
Nested classes/interfaces inherited from interface johnsmith.enchantingoverhauled.menu.scribe.controller.ScribeAction
ScribeAction.AcknowledgeLoss, ScribeAction.Lose, ScribeAction.Start, ScribeAction.TakeBook, ScribeAction.Win -
Constructor Summary
ConstructorsConstructorDescriptionLose(net.minecraft.world.item.ItemStack consumedSource) Creates an instance of aLoserecord class. -
Method Summary
Modifier and TypeMethodDescriptionnet.minecraft.world.item.ItemStackReturns the value of theconsumedSourcerecord component.final booleanIndicates whether some other object is "equal to" this one.booleanexecute(net.minecraft.world.entity.player.Player player, net.minecraft.world.Container container, ScribeGridData gridData, net.minecraft.world.inventory.ContainerLevelAccess access) Executes the action, modifying the container and the player's state.final inthashCode()Returns a hash code value for this object.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
Lose
public Lose(net.minecraft.world.item.ItemStack consumedSource) Creates an instance of aLoserecord class.- Parameters:
consumedSource- the value for theconsumedSourcerecord component
-
-
Method Details
-
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. -
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. -
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. All components in this record class are compared withObjects::equals(Object,Object). -
consumedSource
public net.minecraft.world.item.ItemStack consumedSource()Returns the value of theconsumedSourcerecord component.- Returns:
- the value of the
consumedSourcerecord component