Record Class InventoryInteractionResult
java.lang.Object
java.lang.Record
team.lodestar.lodestone.modules.toolkit.inventory.InventoryInteractionResult
public record InventoryInteractionResult(InventoryInteractionResult.ResultType resultType, net.minecraft.world.item.ItemStack original, net.minecraft.world.item.ItemStack result)
extends Record
-
Nested Class Summary
Nested Classes -
Constructor Summary
ConstructorsConstructorDescriptionInventoryInteractionResult(InventoryInteractionResult.ResultType resultType, net.minecraft.world.item.ItemStack original, net.minecraft.world.item.ItemStack result) Creates an instance of aInventoryInteractionResultrecord class. -
Method Summary
Modifier and TypeMethodDescriptionfinal booleanIndicates whether some other object is "equal to" this one.static InventoryInteractionResultfailure()intgetLeftoverCount(int clamp) final inthashCode()Returns a hash code value for this object.net.minecraft.world.item.ItemStackoriginal()Returns the value of theoriginalrecord component.net.minecraft.world.item.ItemStackresult()Returns the value of theresultrecord component.Returns the value of theresultTyperecord component.static InventoryInteractionResultsuccess(InventoryInteractionResult.ResultType resultType, net.minecraft.world.item.ItemStack original, net.minecraft.world.item.ItemStack result) final StringtoString()Returns a string representation of this record class.static InventoryInteractionResultunchanged(InventoryInteractionResult.ResultType resultType, net.minecraft.world.item.ItemStack unchanged) boolean
-
Constructor Details
-
InventoryInteractionResult
public InventoryInteractionResult(InventoryInteractionResult.ResultType resultType, net.minecraft.world.item.ItemStack original, net.minecraft.world.item.ItemStack result) Creates an instance of aInventoryInteractionResultrecord class.- Parameters:
resultType- the value for theresultTyperecord componentoriginal- the value for theoriginalrecord componentresult- the value for theresultrecord component
-
-
Method Details
-
unchanged
public static InventoryInteractionResult unchanged(InventoryInteractionResult.ResultType resultType, net.minecraft.world.item.ItemStack unchanged) -
success
public static InventoryInteractionResult success(InventoryInteractionResult.ResultType resultType, net.minecraft.world.item.ItemStack original, net.minecraft.world.item.ItemStack result) -
failure
-
wasSuccessful
public boolean wasSuccessful() -
getLeftoverCount
public int getLeftoverCount(int clamp) -
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). -
resultType
Returns the value of theresultTyperecord component.- Returns:
- the value of the
resultTyperecord component
-
original
public net.minecraft.world.item.ItemStack original()Returns the value of theoriginalrecord component.- Returns:
- the value of the
originalrecord component
-
result
public net.minecraft.world.item.ItemStack result()Returns the value of theresultrecord component.- Returns:
- the value of the
resultrecord component
-