Record Class DiscardedQueryAnswerPayload
java.lang.Object
java.lang.Record
net.minecraft.network.protocol.login.custom.DiscardedQueryAnswerPayload
- All Implemented Interfaces:
CustomQueryAnswerPayload
public record DiscardedQueryAnswerPayload(@Nullable FriendlyByteBuf data, Consumer<FriendlyByteBuf> encoder)
extends Record
implements CustomQueryAnswerPayload
-
Field Summary
Modifier and TypeFieldDescriptionprivate final FriendlyByteBuf
The field for thedata
record component.private final Consumer
<FriendlyByteBuf> The field for theencoder
record component.static final DiscardedQueryAnswerPayload
-
Constructor Summary
ConstructorDescriptionDiscardedQueryAnswerPayload
(FriendlyByteBuf data, Consumer<FriendlyByteBuf> encoder) Creates an instance of aDiscardedQueryAnswerPayload
record class. -
Method Summary
Modifier and TypeMethodDescriptiondata()
Returns the value of thedata
record component.encoder()
Returns the value of theencoder
record component.final boolean
Indicates whether some other object is "equal to" this one.final int
hashCode()
Returns a hash code value for this object.final String
toString()
Returns a string representation of this record class.void
write
(FriendlyByteBuf p_299186_)
-
Field Details
-
data
The field for thedata
record component. -
encoder
The field for theencoder
record component. -
INSTANCE
-
-
Constructor Details
-
DiscardedQueryAnswerPayload
public DiscardedQueryAnswerPayload() -
DiscardedQueryAnswerPayload
public DiscardedQueryAnswerPayload(@Nullable FriendlyByteBuf data, Consumer<FriendlyByteBuf> encoder) Creates an instance of aDiscardedQueryAnswerPayload
record class.- Parameters:
data
- the value for thedata
record componentencoder
- the value for theencoder
record component
-
-
Method Details
-
write
- Specified by:
write
in interfaceCustomQueryAnswerPayload
-
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)
. -
data
Returns the value of thedata
record component.- Returns:
- the value of the
data
record component
-
encoder
Returns the value of theencoder
record component.- Returns:
- the value of the
encoder
record component
-