Record Class CommandResponseTracker.MessagesWithArg<Element,Arg>
java.lang.Object
java.lang.Record
net.minecraft.server.commands.CommandResponseTracker.MessagesWithArg<Element,Arg>
- Enclosing class:
CommandResponseTracker<Element>
public static record CommandResponseTracker.MessagesWithArg<Element,Arg> (@Nullable CommandResponseTracker.ErrorHandlerWithArg<Arg> onZero, CommandResponseTracker.DispatchWithArg<Component, Element, Arg> onSuccess)
extends Record
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final CommandResponseTracker.DispatchWithArg<Component, Element, Arg> The field for theonSuccessrecord component.private final @Nullable CommandResponseTracker.ErrorHandlerWithArg<Arg> The field for theonZerorecord component. -
Constructor Summary
ConstructorsConstructorDescriptionMessagesWithArg(@Nullable CommandResponseTracker.ErrorHandlerWithArg<Arg> onZero, CommandResponseTracker.DispatchWithArg<Component, Element, Arg> onSuccess) Creates an instance of aMessagesWithArgrecord class. -
Method Summary
Modifier and TypeMethodDescriptionfinal booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.Returns the value of theonSuccessrecord component.onZero()Returns the value of theonZerorecord component.voidthrowIfZero(int value, Arg argument) final StringtoString()Returns a string representation of this record class.
-
Field Details
-
onZero
The field for theonZerorecord component. -
onSuccess
The field for theonSuccessrecord component.
-
-
Constructor Details
-
MessagesWithArg
public MessagesWithArg(@Nullable CommandResponseTracker.ErrorHandlerWithArg<Arg> onZero, CommandResponseTracker.DispatchWithArg<Component, Element, Arg> onSuccess) Creates an instance of aMessagesWithArgrecord class.- Parameters:
onZero- the value for theonZerorecord componentonSuccess- the value for theonSuccessrecord component
-
-
Method Details
-
throwIfZero
public void throwIfZero(int value, Arg argument) throws com.mojang.brigadier.exceptions.CommandSyntaxException - Throws:
com.mojang.brigadier.exceptions.CommandSyntaxException
-
toString
-
hashCode
-
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). -
onZero
Returns the value of theonZerorecord component.- Returns:
- the value of the
onZerorecord component
-
onSuccess
Returns the value of theonSuccessrecord component.- Returns:
- the value of the
onSuccessrecord component
-