Interface MapHolder<K,V>

All Known Subinterfaces:
MapHolder.Typed<K,V,M>

public interface MapHolder<K,V>
  • Method Details

    • fromBaseMapCodec

      static <K, V, C extends com.mojang.serialization.codecs.BaseMapCodec<K, V> & com.mojang.serialization.Codec<Map<K, V>>> com.mojang.serialization.Codec<MapHolder<K,V>> fromBaseMapCodec(C baseMapCodec)
      Used for elements where it could either be deserialized from a MapKey or an actual Map object.
      Type Parameters:
      K - Key object
      V - Value object
      C - Base codec
      Parameters:
      baseMapCodec - Base codec, must implement both BaseMapCodec and Codec
      Returns:
      The codec which supplies de/serialization of maps to MapHolder
    • unwrapKeyOrThrow

      default MapKey<K,V> unwrapKeyOrThrow()
    • getKey

      default Optional<MapKey<K,V>> getKey()
    • unwrapKey

      @Nullable @Nullable MapKey<K,V> unwrapKey()
    • getMap

      Map<K,V> getMap()
    • isRequired

      boolean isRequired(K key)
    • isBound

      boolean isBound()
    • simpleWrapper

      static <K, V> MapHolder<K,V> simpleWrapper(Map<K,V> map)