Record Class UnifiedInteractionResult
java.lang.Object
java.lang.Record
com.pixelmonmod.pixelmon.api.util.UnifiedInteractionResult
public record UnifiedInteractionResult(net.minecraft.world.InteractionResult emptyHandResult, net.minecraft.world.ItemInteractionResult itemResult)
extends Record
-
Constructor Summary
ConstructorsConstructorDescriptionUnifiedInteractionResult(net.minecraft.world.InteractionResult emptyHandResult, net.minecraft.world.ItemInteractionResult itemResult) Creates an instance of aUnifiedInteractionResultrecord class. -
Method Summary
Modifier and TypeMethodDescriptionstatic UnifiedInteractionResultconsume(boolean partial) net.minecraft.world.InteractionResultReturns the value of theemptyHandResultrecord component.final booleanIndicates whether some other object is "equal to" this one.static UnifiedInteractionResultfail()final inthashCode()Returns a hash code value for this object.net.minecraft.world.ItemInteractionResultReturns the value of theitemResultrecord component.static UnifiedInteractionResultof(net.minecraft.world.InteractionResult emptyHandResult, net.minecraft.world.ItemInteractionResult itemResult) static UnifiedInteractionResultpass(boolean skipEmptyHandInteraction) static UnifiedInteractionResultsuccess()static UnifiedInteractionResultsuccess(boolean itemUsed) static UnifiedInteractionResultsuccessOrFail(boolean success) static UnifiedInteractionResultsuccessOrFail(boolean success, boolean itemUsed) final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
UnifiedInteractionResult
public UnifiedInteractionResult(net.minecraft.world.InteractionResult emptyHandResult, net.minecraft.world.ItemInteractionResult itemResult) Creates an instance of aUnifiedInteractionResultrecord class.- Parameters:
emptyHandResult- the value for theemptyHandResultrecord componentitemResult- the value for theitemResultrecord component
-
-
Method Details
-
of
public static UnifiedInteractionResult of(net.minecraft.world.InteractionResult emptyHandResult, net.minecraft.world.ItemInteractionResult itemResult) -
successOrFail
-
successOrFail
-
success
-
success
-
fail
-
consume
-
pass
-
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). -
emptyHandResult
public net.minecraft.world.InteractionResult emptyHandResult()Returns the value of theemptyHandResultrecord component.- Returns:
- the value of the
emptyHandResultrecord component
-
itemResult
public net.minecraft.world.ItemInteractionResult itemResult()Returns the value of theitemResultrecord component.- Returns:
- the value of the
itemResultrecord component
-