Class MappedRegistry<Mc,Adv>

java.lang.Object
net.kyori.adventure.platform.fabric.impl.MappedRegistry<Mc,Adv>
Type Parameters:
Mc - The Minecraft type
Adv - The Adventure type

public class MappedRegistry<Mc,Adv> extends Object
Represents a mapping between an enum-like set of values controlled by Minecraft, and an enum-like set of values controlled by Adventure.

Because these enums both refer to known constants, it is relatively easy to generate an automated mapping between the two of them. As the two enums represent the same set of values, it is required that any element that appears in one is present in the other, so mappings will never return null.

  • Method Details

    • toAdventure

      public Adv toAdventure(Mc mcItem)
      Given a Minecraft enum element, return the equivalent Adventure element.
      Parameters:
      mcItem - The Minecraft element
      Returns:
      The adventure equivalent.
    • toMinecraft

      public Mc toMinecraft(Adv advItem)
      Given an Adventure enum element, return the equivalent Minecraft element.
      Parameters:
      advItem - The Minecraft element
      Returns:
      The adventure equivalent.