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 data
R - the registry the data is for
VR - 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>
  • Field Details

  • Constructor Details

  • Method Details

    • remover

      public <VR1 extends DataMapValueRemover<R, T>> AdvancedDataMapType.Builder<T,R,VR1> remover(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,VR> 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.
      Overrides:
      synced in class DataMapType.Builder<T,R>
      Parameters:
      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
      Returns:
      the builder instance
    • build

      public AdvancedDataMapType<R,T,VR> build()
      Returns a built advanced data map type.
      Overrides:
      build in class DataMapType.Builder<T,R>
      Returns:
      a built advanced data map type