Class FacetComponentFlattener


  • @Internal
    public final class FacetComponentFlattener
    extends java.lang.Object
    A provider for component flatteners that uses the Facet system to access implementation details.
    Since:
    4.0.0
    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
      static interface  FacetComponentFlattener.Translator<V>
      An interface to the game's own translation system.
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static <V> net.kyori.adventure.text.flattener.ComponentFlattener get​(V instance, java.util.Collection<? extends FacetComponentFlattener.Translator<V>> candidates)
      Create a new flattener, picking an applicable translator.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Method Detail

      • get

        public static <V> net.kyori.adventure.text.flattener.ComponentFlattener get​(V instance,
                                                                                    java.util.Collection<? extends FacetComponentFlattener.Translator<V>> candidates)
        Create a new flattener, picking an applicable translator.

        If no translators are available, keys will be passed through untransformed.

        Type Parameters:
        V - instance type
        Parameters:
        instance - the game/server instance
        candidates - potential facets
        Returns:
        a new flattener
        Since:
        4.0.0