Class MapType.BaseBuilder<K,V>

java.lang.Object
dev.dhyces.trimmed.api.maps.types.MapType.BaseBuilder<K,V>
Direct Known Subclasses:
AdvancedMapType.Builder, SimpleMapType.Builder
Enclosing interface:
MapType<K,V>

public abstract static class MapType.BaseBuilder<K,V> extends Object
  • Field Details

    • keyResolver

      protected final KeyResolver<K> keyResolver
    • valueCodec

      protected final com.mojang.serialization.Codec<V> valueCodec
    • valueStreamCodec

      @Nullable protected @Nullable net.minecraft.network.codec.StreamCodec<net.minecraft.network.RegistryFriendlyByteBuf,V> valueStreamCodec
    • dataPackSynced

      protected boolean dataPackSynced
  • Constructor Details

    • BaseBuilder

      protected BaseBuilder(KeyResolver<K> keyResolver, com.mojang.serialization.Codec<V> valueCodec)
  • Method Details

    • dataPackSynced

      public MapType.BaseBuilder<K,V> dataPackSynced()
      For asset pack maps, this will delay parsing of the maps until after data packs are synced to the client. For data pack maps, use networkCodec(StreamCodec).
      Returns:
      this builder
    • networkCodec

      public MapType.BaseBuilder<K,V> networkCodec(net.minecraft.network.codec.StreamCodec<net.minecraft.network.RegistryFriendlyByteBuf,V> valueCodec)
      For data pack maps, this will setup syncing to clients. This is unused for asset pack maps.
      Returns:
      this builder
    • networked

      public MapType.BaseBuilder<K,V> networked()
      For data pack maps, this will setup syncing to clients using the regular codecs for networking. This is unused for asset pack maps.
      Returns:
      this builder
    • build

      public abstract <T extends MapType<K, V>> T build()