Module syntaxnbt

Class SNBTStringifyer

java.lang.Object
at.syntaxerror.syntaxnbt.internal.SNBTStringifyer

public class SNBTStringifyer extends Object
A utility class for stringifying NBT tags
Author:
SyntaxError404
  • Method Details

    • stringify

      public static String stringify(Tag<?> tag, boolean colored)
      Writes a tag to a string (SNBT format). If colored, the string will contain color codes (according to Minecraft's old chat color system using section signs ยง)
      Parameters:
      tag - tag to be stringifyed
      colored - whether the string should contain color codes
      Returns:
      the stringifyed compound tag
    • quote

      public static String quote(String string)
      Wrap a string in quotes (") and escape special characters, if necessary. If the string only consists of alphanumerical characters, it is returned without further modification.
      Parameters:
      string - the string to be quoted
      Returns:
      the quoted string