类 DataMapType.Builder<T,R>
java.lang.Object
net.neoforged.neoforge.registries.datamaps.DataMapType.Builder<T,R>
- 类型参数:
T
- the type of the dataR
- the registry the data is for
- 直接已知子类:
AdvancedDataMapType.Builder
- 封闭类:
DataMapType<R,
T>
public static sealed class DataMapType.Builder<T,R>
extends Object
permits AdvancedDataMapType.Builder<T,R,VR>
A builder for
data map types
.-
字段概要
字段修饰符和类型字段说明protected final com.mojang.serialization.Codec
<T> protected final ResourceLocation
protected boolean
protected @Nullable com.mojang.serialization.Codec
<T> protected final ResourceKey
<Registry<R>> -
构造器概要
构造器构造器说明Builder
(ResourceKey<Registry<R>> registryKey, ResourceLocation id, com.mojang.serialization.Codec<T> codec) -
方法概要
-
字段详细资料
-
registryKey
-
id
-
codec
-
networkCodec
-
mandatorySync
protected boolean mandatorySync
-
-
构造器详细资料
-
Builder
Builder(ResourceKey<Registry<R>> registryKey, ResourceLocation id, com.mojang.serialization.Codec<T> codec)
-
-
方法详细资料
-
synced
public DataMapType.Builder<T,R> synced(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.- 参数:
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- 返回:
- the builder instance
-
build
返回 a built data map type。- 返回:
- a built data map type
-