Record Class RegistryDataMapSyncPayload<T>
java.lang.Object
java.lang.Record
net.neoforged.neoforge.network.payload.RegistryDataMapSyncPayload<T>
- All Implemented Interfaces:
CustomPacketPayload
@Internal
public record RegistryDataMapSyncPayload<T>(ResourceKey<? extends Registry<T>> registryKey, Map<Identifier, Map<ResourceKey<T>, ?>> dataMaps)
extends Record
implements CustomPacketPayload
-
Nested Class Summary
Nested classes/interfaces inherited from interface CustomPacketPayload
CustomPacketPayload.FallbackProvider<B>, CustomPacketPayload.Type<T>, CustomPacketPayload.TypeAndCodec<B,T> -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final Map<Identifier, Map<ResourceKey<T>, ?>> The field for thedataMapsrecord component.private static final Gsonprivate final ResourceKey<? extends Registry<T>> The field for theregistryKeyrecord component.static final StreamCodec<RegistryFriendlyByteBuf, RegistryDataMapSyncPayload<?>> static final CustomPacketPayload.Type<RegistryDataMapSyncPayload<?>> -
Constructor Summary
ConstructorsConstructorDescriptionRegistryDataMapSyncPayload(ResourceKey<? extends Registry<T>> registryKey, Map<Identifier, Map<ResourceKey<T>, ?>> dataMaps) Creates an instance of aRegistryDataMapSyncPayloadrecord class. -
Method Summary
Modifier and TypeMethodDescriptionMap<Identifier, Map<ResourceKey<T>, ?>> dataMaps()Returns the value of thedataMapsrecord component.static <T> RegistryDataMapSyncPayload<T> final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.private static <T> TreadJsonWithRegistryCodec(RegistryFriendlyByteBuf buf, com.mojang.serialization.Codec<T> codec) ResourceKey<? extends Registry<T>> Returns the value of theregistryKeyrecord component.final StringtoString()Returns a string representation of this record class.type()voidprivate static <T> voidwriteJsonWithRegistryCodec(RegistryFriendlyByteBuf buf, com.mojang.serialization.Codec<T> codec, T value) Methods inherited from interface CustomPacketPayload
toVanillaClientbound, toVanillaServerbound
-
Field Details
-
registryKey
The field for theregistryKeyrecord component. -
dataMaps
The field for thedataMapsrecord component. -
TYPE
-
STREAM_CODEC
public static final StreamCodec<RegistryFriendlyByteBuf, RegistryDataMapSyncPayload<?>> STREAM_CODEC -
GSON
-
-
Constructor Details
-
RegistryDataMapSyncPayload
public RegistryDataMapSyncPayload(ResourceKey<? extends Registry<T>> registryKey, Map<Identifier, Map<ResourceKey<T>, ?>> dataMaps) Creates an instance of aRegistryDataMapSyncPayloadrecord class.- Parameters:
registryKey- the value for theregistryKeyrecord componentdataMaps- the value for thedataMapsrecord component
-
-
Method Details
-
decode
-
write
-
type
- Specified by:
typein interfaceCustomPacketPayload
-
readJsonWithRegistryCodec
private static <T> T readJsonWithRegistryCodec(RegistryFriendlyByteBuf buf, com.mojang.serialization.Codec<T> codec) -
writeJsonWithRegistryCodec
private static <T> void writeJsonWithRegistryCodec(RegistryFriendlyByteBuf buf, com.mojang.serialization.Codec<T> codec, T value) -
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). -
registryKey
Returns the value of theregistryKeyrecord component.- Returns:
- the value of the
registryKeyrecord component
-
dataMaps
Returns the value of thedataMapsrecord component.- Returns:
- the value of the
dataMapsrecord component
-