Record Class ConfigNetwork.UpdatePayload
java.lang.Object
java.lang.Record
net.ixdarklord.coolcatcore.internal.config.network.ConfigNetwork.UpdatePayload
- All Implemented Interfaces:
CustomPacketPayload
- Enclosing class:
- ConfigNetwork
public static record ConfigNetwork.UpdatePayload(net.minecraft.resources.ResourceLocation configId, String values)
extends Record
implements CustomPacketPayload
The values a player changed in a synced config.
-
Nested Class Summary
Nested classes/interfaces inherited from interface net.ixdarklord.coolcatcore.api.network.CustomPacketPayload
CustomPacketPayload.Type<T extends CustomPacketPayload>, CustomPacketPayload.TypeAndCodec<B extends io.netty.buffer.ByteBuf,T extends CustomPacketPayload> -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StreamCodec<net.minecraft.network.FriendlyByteBuf,ConfigNetwork.UpdatePayload> static final CustomPacketPayload.Type<ConfigNetwork.UpdatePayload> -
Constructor Summary
ConstructorsConstructorDescriptionUpdatePayload(net.minecraft.resources.ResourceLocation configId, String values) Creates an instance of aUpdatePayloadrecord class. -
Method Summary
Modifier and TypeMethodDescriptionnet.minecraft.resources.ResourceLocationconfigId()Returns the value of theconfigIdrecord component.final booleanIndicates whether some other object is "equal to" this one.booleanfits()Whether the payload fits in a serverbound packet.final inthashCode()Returns a hash code value for this object.final StringtoString()Returns a string representation of this record class.type()values()Returns the value of thevaluesrecord component.
-
Field Details
-
TYPE
-
STREAM_CODEC
public static final StreamCodec<net.minecraft.network.FriendlyByteBuf,ConfigNetwork.UpdatePayload> STREAM_CODEC
-
-
Constructor Details
-
UpdatePayload
Creates an instance of aUpdatePayloadrecord class.- Parameters:
configId- the value for theconfigIdrecord componentvalues- the value for thevaluesrecord component
-
-
Method Details
-
fits
public boolean fits()Whether the payload fits in a serverbound packet. -
type
- Specified by:
typein interfaceCustomPacketPayload
-
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). -
configId
public net.minecraft.resources.ResourceLocation configId()Returns the value of theconfigIdrecord component.- Returns:
- the value of the
configIdrecord component
-
values
Returns the value of thevaluesrecord component.- Returns:
- the value of the
valuesrecord component
-