Interface CacheMetaDynamicOps<T>

Type Parameters:
T - the type decoded from and encoded to
All Superinterfaces:
com.mojang.serialization.DynamicOps<T>
All Known Implementing Classes:
CacheMetaJsonOps

public interface CacheMetaDynamicOps<T> extends com.mojang.serialization.DynamicOps<T>
A DynamicOps that can hold data of various sorts, accessible by codecs, representing a context the encoding or decoding is occurring in.
  • Method Summary

    Modifier and Type
    Method
    Description
    <D> @Nullable D
    getData(Class<? super D> clazz)
     
    <D> void
    putData(Class<? super D> clazz, @Nullable D data)
    Attach the provided data to the provided class key in the metadata-providing context this object represents.

    Methods inherited from interface com.mojang.serialization.DynamicOps

    compressMaps, convertList, convertMap, convertTo, createBoolean, createByte, createByteList, createDouble, createFloat, createInt, createIntList, createList, createLong, createLongList, createMap, createMap, createNumeric, createShort, createString, empty, emptyList, emptyMap, get, getBooleanValue, getByteBuffer, getGeneric, getIntStream, getList, getLongStream, getMap, getMapEntries, getMapValues, getNumberValue, getNumberValue, getStream, getStringValue, listBuilder, mapBuilder, mergeToList, mergeToList, mergeToMap, mergeToMap, mergeToMap, mergeToPrimitive, remove, set, update, updateGeneric, withDecoder, withEncoder, withParser
  • Method Details

    • getData

      <D> @Nullable D getData(Class<? super D> clazz)
      Returns:
      data associated with the provided class, or null if there is none
    • putData

      <D> void putData(Class<? super D> clazz, @Nullable D data)
      Attach the provided data to the provided class key in the metadata-providing context this object represents.
      Type Parameters:
      D - the type of data to attach
      Parameters:
      clazz - the class to use as a key
      data - the data to attach