Class AdvancedDataMapType.Builder<T,R,VR extends DataMapValueRemover<R,T>>
java.lang.Object
net.neoforged.neoforge.registries.datamaps.DataMapType.Builder<T,R>
net.neoforged.neoforge.registries.datamaps.AdvancedDataMapType.Builder<T,R,VR>
- Type Parameters:
T
- the type of the dataR
- the registry the data is forVR
- the type of the remover
- Enclosing class:
AdvancedDataMapType<R,
T, VR extends DataMapValueRemover<R, T>>
public static final class AdvancedDataMapType.Builder<T,R,VR extends DataMapValueRemover<R,T>>
extends DataMapType.Builder<T,R>
A builder for
advanced data map types
.-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate DataMapValueMerger<R,
T> private com.mojang.serialization.Codec<VR>
Fields inherited from class net.neoforged.neoforge.registries.datamaps.DataMapType.Builder
codec, id, mandatorySync, networkCodec, registryKey
-
Constructor Summary
ConstructorsConstructorDescriptionBuilder
(ResourceKey<Registry<R>> registryKey, ResourceLocation id, com.mojang.serialization.Codec<T> codec) -
Method Summary
Modifier and TypeMethodDescriptionbuild()
Returns a built advanced data map type.merger
(DataMapValueMerger<R, T> merger) Configures the merger that will handle conflicting values for the same registry object.<VR1 extends DataMapValueRemover<R,
T>>
AdvancedDataMapType.Builder<T,R, VR1> remover
(com.mojang.serialization.Codec<VR1> remover) Configures a remover for the data map.Marks the data map as synced.
-
Field Details
-
remover
-
merger
-
-
Constructor Details
-
Builder
Builder(ResourceKey<Registry<R>> registryKey, ResourceLocation id, com.mojang.serialization.Codec<T> codec)
-
-
Method Details
-
remover
public <VR1 extends DataMapValueRemover<R,T>> AdvancedDataMapType.Builder<T,R, removerVR1> (com.mojang.serialization.Codec<VR1> remover) Configures a remover for the data map.- Type Parameters:
VR1
- the type of the new remover- Parameters:
remover
- a codec used to decode the remover- Returns:
- the builder instance
- See Also:
-
merger
Configures the merger that will handle conflicting values for the same registry object.- Parameters:
merger
- a merger that handles conflicting values- Returns:
- the builder instance
-
synced
public AdvancedDataMapType.Builder<T,R, syncedVR> (com.mojang.serialization.Codec<T> networkCodec, boolean mandatory) Marks the data map as synced.
A synced data map will be sent to clients that support it.- Overrides:
synced
in classDataMapType.Builder<T,
R> - Parameters:
networkCodec
- a codec used to sync the valuesmandatory
- iftrue
, clients that do not support this data map will not be able to connect to the server- Returns:
- the builder instance
-
build
Returns a built advanced data map type.- Overrides:
build
in classDataMapType.Builder<T,
R> - Returns:
- a built advanced data map type
-