Class NbtNodeAdapter

    • Method Detail

      • tagToNode

        public static void tagToNode​(Tag tag,
                                     ConfigurationNode node)
                              throws IOException
        Given a tag, convert it to a node.

        Depending on the configuration of the provided node, the conversion may lose some data when roundtripped back. For example, array tags may be converted to lists if the node provided does not support arrays.

        Parameters:
        tag - the tag to convert
        node - the node to populate
        Throws:
        IOException - if invalid tags are provided
        Since:
        1.0.0
      • nodeToTag

        public static Tag nodeToTag​(ConfigurationNode node)
                             throws IOException
        Convert a node to tag. Because NBT is strongly typed and does not permit lists with mixed types, some configuration nodes will not be convertible to Tags.
        Parameters:
        node - the configuration node
        Returns:
        the converted tag object
        Throws:
        IOException - if an IO error occurs while converting the tag
        Since:
        1.0.0
      • createEmptyNode

        public static ConfigurationNode createEmptyNode()
        Create an empty node with options appropriate for handling NBT data.
        Returns:
        the new node
        Since:
        1.0.0