Class BungeeComponentSerializer

    • Method Detail

      • isNative

        public static boolean isNative()
        Gets whether the component serializer has native support.

        Even if this is false, the serializer will still work.

        Returns:
        if there is native support
        Since:
        4.0.0
      • get

        public static BungeeComponentSerializer get()
        Gets a component serializer.
        Returns:
        a component serializer
        Since:
        4.0.0
      • legacy

        public static BungeeComponentSerializer legacy()
        Gets a component serializer, with color downsampling.
        Returns:
        a component serializer
        Since:
        4.0.0
      • of

        public static BungeeComponentSerializer of​(GsonComponentSerializer serializer,
                                                   LegacyComponentSerializer legacySerializer)
        Create a component serializer with custom serialization properties.
        Parameters:
        serializer - The serializer creating a JSON representation of the component
        legacySerializer - The serializer creating a representation of the component with legacy formatting codes
        Returns:
        a new serializer
        Since:
        4.0.0
      • inject

        public static boolean inject​(com.google.gson.Gson existing)
        Inject Adventure's adapter serializer into an existing Gson instance.

        This is primarily for internal use, but may be useful if interfacing with existing libraries that maintain their own Gson instances.

        Parameters:
        existing - gson instance
        Returns:
        true if injection was successful
        Since:
        4.0.0