Record Class InventoryInteractionResult
java.lang.Object
java.lang.Record
team.lodestar.lodestone.modules.toolkit.inventory.InventoryInteractionResult
public record InventoryInteractionResult(InventoryItemStackTransaction internalChanges, InventoryItemStackTransaction externalChanges, InventoryInteractionResult.InteractionType interactionType)
extends Record
-
Nested Class Summary
Nested Classes -
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionInventoryInteractionResult(InventoryItemStackTransaction internalChanges, InventoryItemStackTransaction externalChanges, InventoryInteractionResult.InteractionType interactionType) Creates an instance of aInventoryInteractionResultrecord class. -
Method Summary
Modifier and TypeMethodDescriptioncreate(InventoryInteractionResult.InteractionType interactionType) final booleanIndicates whether some other object is "equal to" this one.Returns the value of theexternalChangesrecord component.extract()net.minecraft.world.item.ItemStackfinal inthashCode()Returns a hash code value for this object.insert()Returns the value of theinteractionTyperecord component.Returns the value of theinternalChangesrecord component.final StringtoString()Returns a string representation of this record class.boolean
-
Field Details
-
EMPTY
-
-
Constructor Details
-
InventoryInteractionResult
public InventoryInteractionResult(InventoryItemStackTransaction internalChanges, InventoryItemStackTransaction externalChanges, InventoryInteractionResult.InteractionType interactionType) Creates an instance of aInventoryInteractionResultrecord class.- Parameters:
internalChanges- the value for theinternalChangesrecord componentexternalChanges- the value for theexternalChangesrecord componentinteractionType- the value for theinteractionTyperecord component
-
-
Method Details
-
extract
-
insert
-
create
public static InventoryInteractionResultBuilder create(InventoryInteractionResult.InteractionType interactionType) -
wasSuccessful
public boolean wasSuccessful() -
getTransferredItem
public net.minecraft.world.item.ItemStack getTransferredItem() -
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). -
internalChanges
Returns the value of theinternalChangesrecord component.- Returns:
- the value of the
internalChangesrecord component
-
externalChanges
Returns the value of theexternalChangesrecord component.- Returns:
- the value of the
externalChangesrecord component
-
interactionType
Returns the value of theinteractionTyperecord component.- Returns:
- the value of the
interactionTyperecord component
-