Interface InlineAPI


public interface InlineAPI
The common Inline API, mostly just for working with InlineData.
  • Field Details

    • INSTANCE

      static final InlineAPI INSTANCE
      Usable API Instance.
  • Method Details

    • addDataType

      void addDataType(InlineData.InlineDataType<?> type)
      Register an inline data type
      Parameters:
      type -
    • deserializeData

      <D extends InlineData<D>> D deserializeData(com.google.gson.JsonObject json)
      Parse data from json
      Parameters:
      json - serialized data
      Returns:
      data
    • serializeData

      <D extends InlineData<D>> com.google.gson.JsonObject serializeData(D data)
      Serialize data to json
      Parameters:
      data - data to serialize
      Returns:
      serialized data
    • addChatMatcher

      void addChatMatcher(InlineMatcher matcher)
      Register a server-side matcher to be used against chat with a MatchContext.ChatMatchContext
    • withSizeModifier

      net.minecraft.text.Style withSizeModifier(net.minecraft.text.Style style, double modifier)
      Attach a size modifier to this style. Generally this should be used for some data-holding style to tell the renderer to render it with a different size.
      Parameters:
      style - style to attach it to.
      modifier - size to scale it by. Ideally should be less than 2.
      Returns:
      a new style object with the given size modifier.