Package net.minecraft.util
Record Class ActionResult.Success
java.lang.Object
java.lang.Record
net.minecraft.util.ActionResult.Success
- Record Components:
swingSource-itemContext-
- All Implemented Interfaces:
ActionResult
- Enclosing interface:
ActionResult
public static record ActionResult.Success(ActionResult.SwingSource swingSource, ActionResult.ItemContext itemContext)
extends Record
implements ActionResult
- Mappings:
Namespace Name named net/minecraft/util/ActionResult$Successintermediary net/minecraft/class_1269$class_9860official bvc$dnamed swingSourceintermediary comp_2909official gnamed itemContextintermediary comp_2910official h
-
Nested Class Summary
Nested classes/interfaces inherited from interface net.minecraft.util.ActionResult
ActionResult.Fail, ActionResult.ItemContext, ActionResult.Pass, ActionResult.PassToDefaultBlockAction, ActionResult.Success, ActionResult.SwingSource -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final ActionResult.ItemContextThe field for theitemContextrecord component.private final ActionResult.SwingSourceThe field for theswingSourcerecord component.Fields inherited from interface net.minecraft.util.ActionResult
CONSUME, FAIL, PASS, PASS_TO_DEFAULT_BLOCK_ACTION, SUCCESS, SUCCESS_SERVER -
Constructor Summary
ConstructorsConstructorDescriptionSuccess(ActionResult.SwingSource swingSource, ActionResult.ItemContext itemContext) Creates an instance of aSuccessrecord class. -
Method Summary
Modifier and TypeMethodDescriptionfinal booleanIndicates whether some other object is "equal to" this one.Returns the item stack that should replace the hand stack after this interaction, if any.final inthashCode()Returns a hash code value for this object.booleanReturns whether an action is performed.Returns the value of theitemContextrecord component.booleanReturns the value of theswingSourcerecord component.final StringtoString()Returns a string representation of this record class.withNewHandStack(ItemStack newHandStack)
-
Field Details
-
swingSource
The field for theswingSourcerecord component. -
itemContext
The field for theitemContextrecord component.
-
-
Constructor Details
-
Success
Creates an instance of aSuccessrecord class.- Parameters:
swingSource- the value for theswingSourcerecord componentitemContext- the value for theitemContextrecord component
-
-
Method Details
-
isAccepted
public boolean isAccepted()Returns whether an action is performed.- Specified by:
isAcceptedin interfaceActionResult- Returns:
- whether an action is performed
- Mappings:
Namespace Name Mixin selector named isAcceptedLnet/minecraft/util/ActionResult;isAccepted()Zintermediary method_23665Lnet/minecraft/class_1269;method_23665()Zofficial aLbvc;a()Z
-
withNewHandStack
- Mappings:
Namespace Name Mixin selector named withNewHandStackLnet/minecraft/util/ActionResult$Success;withNewHandStack(Lnet/minecraft/item/ItemStack;)Lnet/minecraft/util/ActionResult$Success;intermediary method_61393Lnet/minecraft/class_1269$class_9860;method_61393(Lnet/minecraft/class_1799;)Lnet/minecraft/class_1269$class_9860;official aLbvc$d;a(Ldak;)Lbvc$d;
-
noIncrementStat
- Mappings:
Namespace Name Mixin selector named noIncrementStatLnet/minecraft/util/ActionResult$Success;noIncrementStat()Lnet/minecraft/util/ActionResult$Success;intermediary method_61394Lnet/minecraft/class_1269$class_9860;method_61394()Lnet/minecraft/class_1269$class_9860;official bLbvc$d;b()Lbvc$d;
-
shouldIncrementStat
public boolean shouldIncrementStat()- Mappings:
Namespace Name Mixin selector named shouldIncrementStatLnet/minecraft/util/ActionResult$Success;shouldIncrementStat()Zintermediary method_61395Lnet/minecraft/class_1269$class_9860;method_61395()Zofficial cLbvc$d;c()Z
-
getNewHandStack
Returns the item stack that should replace the hand stack after this interaction, if any.- Returns:
- the item stack that should replace the hand stack after this interaction, if any
- Mappings:
Namespace Name Mixin selector named getNewHandStackLnet/minecraft/util/ActionResult$Success;getNewHandStack()Lnet/minecraft/item/ItemStack;intermediary method_61396Lnet/minecraft/class_1269$class_9860;method_61396()Lnet/minecraft/class_1799;official dLbvc$d;d()Ldak;
-
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). -
swingSource
Returns the value of theswingSourcerecord component.- Returns:
- the value of the
swingSourcerecord component
-
itemContext
Returns the value of theitemContextrecord component.- Returns:
- the value of the
itemContextrecord component
-