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 aUnifiedInteractionResult
record class. -
Method Summary
Modifier and TypeMethodDescriptionstatic UnifiedInteractionResult
consume
(boolean partial) net.minecraft.world.InteractionResult
Returns the value of theemptyHandResult
record component.final boolean
Indicates whether some other object is "equal to" this one.static UnifiedInteractionResult
fail()
final int
hashCode()
Returns a hash code value for this object.net.minecraft.world.ItemInteractionResult
Returns the value of theitemResult
record component.static UnifiedInteractionResult
of
(net.minecraft.world.InteractionResult emptyHandResult, net.minecraft.world.ItemInteractionResult itemResult) static UnifiedInteractionResult
pass
(boolean skipEmptyHandInteraction) static UnifiedInteractionResult
success()
static UnifiedInteractionResult
success
(boolean itemUsed) static UnifiedInteractionResult
successOrFail
(boolean success) static UnifiedInteractionResult
successOrFail
(boolean success, boolean itemUsed) final String
toString()
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 aUnifiedInteractionResult
record class.- Parameters:
emptyHandResult
- the value for theemptyHandResult
record componentitemResult
- the value for theitemResult
record 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 theemptyHandResult
record component.- Returns:
- the value of the
emptyHandResult
record component
-
itemResult
public net.minecraft.world.ItemInteractionResult itemResult()Returns the value of theitemResult
record component.- Returns:
- the value of the
itemResult
record component
-