Interface JavaRegistryReader.Context

All Superinterfaces:
JavaRegistryProvider.Provider
All Known Implementing Classes:
RegistryEntryContext
Enclosing interface:
JavaRegistryReader<T>

public static interface JavaRegistryReader.Context extends JavaRegistryProvider.Provider
Provides a registry entry (serialised to NBT), and a JavaRegistryProvider.
  • Method Details

    • data

      Object data()
      Returns:
      the registry entry to parse, serialised to NBT
    • dataAsMap

      default org.cloudburstmc.nbt.NbtMap dataAsMap()
      Note that this unsafely casts the data to an NbtMap, only use if you're sure the data is a compound tag.
      Returns:
      the registry entry, cast to an NbtMap
    • parseDescription

      default net.kyori.adventure.text.Component parseDescription()
      Attempts to use dataAsMap() to get this registry entry as an NbtMap, and then tries to parse the "description" key into a Component, using MessageTranslator.componentFromNbtTag(Object). If the key did not exist, an empty component is returned.
      Returns:
      the "description" key from this entry, parsed as a Component