类 DataMapType.Builder<T,R>

java.lang.Object
net.neoforged.neoforge.registries.datamaps.DataMapType.Builder<T,R>
类型参数:
T - the type of the data
R - 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.
  • 字段详细资料

    • registryKey

      protected final ResourceKey<Registry<R>> registryKey
    • id

      protected final ResourceLocation id
    • codec

      protected final com.mojang.serialization.Codec<T> codec
    • networkCodec

      @Nullable protected @Nullable com.mojang.serialization.Codec<T> networkCodec
    • mandatorySync

      protected boolean mandatorySync
  • 构造器详细资料

  • 方法详细资料

    • 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 values
      mandatory - if true, clients that do not support this data map will not be able to connect to the server
      返回:
      the builder instance
    • build

      public DataMapType<R,T> build()
      返回 a built data map type。
      返回:
      a built data map type