Class StringNbtWriter

java.lang.Object
net.minecraft.nbt.visitor.StringNbtWriter
All Implemented Interfaces:
NbtElementVisitor

public class StringNbtWriter extends Object implements NbtElementVisitor
A simple converter to turn NBT into single-line SNBT. The output may be parsed back into binary NBT.
Mappings:
Namespace Name
named net/minecraft/nbt/visitor/StringNbtWriter
intermediary net/minecraft/class_5626
official vt
  • Field Details

    • SIMPLE_NAME

      private static final Pattern SIMPLE_NAME
      Mappings:
      Namespace Name Mixin selector
      named SIMPLE_NAME Lnet/minecraft/nbt/visitor/StringNbtWriter;SIMPLE_NAME:Ljava/util/regex/Pattern;
      intermediary field_27829 Lnet/minecraft/class_5626;field_27829:Ljava/util/regex/Pattern;
      official a Lvt;a:Ljava/util/regex/Pattern;
    • result

      private final StringBuilder result
      Mappings:
      Namespace Name Mixin selector
      named result Lnet/minecraft/nbt/visitor/StringNbtWriter;result:Ljava/lang/StringBuilder;
      intermediary field_27830 Lnet/minecraft/class_5626;field_27830:Ljava/lang/StringBuilder;
      official b Lvt;b:Ljava/lang/StringBuilder;
  • Constructor Details

    • StringNbtWriter

      public StringNbtWriter()
  • Method Details

    • apply

      public String apply(NbtElement element)
      Returns the stringified NBT element.
      Returns:
      the stringified NBT element
      Mappings:
      Namespace Name Mixin selector
      named apply Lnet/minecraft/nbt/visitor/StringNbtWriter;apply(Lnet/minecraft/nbt/NbtElement;)Ljava/lang/String;
      intermediary method_32288 Lnet/minecraft/class_5626;method_32288(Lnet/minecraft/class_2520;)Ljava/lang/String;
      official a Lvt;a(Lvu;)Ljava/lang/String;
    • visitString

      public void visitString(NbtString element)
      Specified by:
      visitString in interface NbtElementVisitor
      Mappings:
      Namespace Name Mixin selector
      named visitString Lnet/minecraft/nbt/visitor/NbtElementVisitor;visitString(Lnet/minecraft/nbt/NbtString;)V
      intermediary method_32302 Lnet/minecraft/class_5627;method_32302(Lnet/minecraft/class_2519;)V
      official a Lvy;a(Lvs;)V
    • visitByte

      public void visitByte(NbtByte element)
      Specified by:
      visitByte in interface NbtElementVisitor
      Mappings:
      Namespace Name Mixin selector
      named visitByte Lnet/minecraft/nbt/visitor/NbtElementVisitor;visitByte(Lnet/minecraft/nbt/NbtByte;)V
      intermediary method_32291 Lnet/minecraft/class_5627;method_32291(Lnet/minecraft/class_2481;)V
      official a Lvy;a(Luv;)V
    • visitShort

      public void visitShort(NbtShort element)
      Specified by:
      visitShort in interface NbtElementVisitor
      Mappings:
      Namespace Name Mixin selector
      named visitShort Lnet/minecraft/nbt/visitor/NbtElementVisitor;visitShort(Lnet/minecraft/nbt/NbtShort;)V
      intermediary method_32301 Lnet/minecraft/class_5627;method_32301(Lnet/minecraft/class_2516;)V
      official a Lvy;a(Lvp;)V
    • visitInt

      public void visitInt(NbtInt element)
      Specified by:
      visitInt in interface NbtElementVisitor
      Mappings:
      Namespace Name Mixin selector
      named visitInt Lnet/minecraft/nbt/visitor/NbtElementVisitor;visitInt(Lnet/minecraft/nbt/NbtInt;)V
      intermediary method_32297 Lnet/minecraft/class_5627;method_32297(Lnet/minecraft/class_2497;)V
      official a Lvy;a(Lvc;)V
    • visitLong

      public void visitLong(NbtLong element)
      Specified by:
      visitLong in interface NbtElementVisitor
      Mappings:
      Namespace Name Mixin selector
      named visitLong Lnet/minecraft/nbt/visitor/NbtElementVisitor;visitLong(Lnet/minecraft/nbt/NbtLong;)V
      intermediary method_32300 Lnet/minecraft/class_5627;method_32300(Lnet/minecraft/class_2503;)V
      official a Lvy;a(Lvf;)V
    • visitFloat

      public void visitFloat(NbtFloat element)
      Specified by:
      visitFloat in interface NbtElementVisitor
      Mappings:
      Namespace Name Mixin selector
      named visitFloat Lnet/minecraft/nbt/visitor/NbtElementVisitor;visitFloat(Lnet/minecraft/nbt/NbtFloat;)V
      intermediary method_32295 Lnet/minecraft/class_5627;method_32295(Lnet/minecraft/class_2494;)V
      official a Lvy;a(Lva;)V
    • visitDouble

      public void visitDouble(NbtDouble element)
      Specified by:
      visitDouble in interface NbtElementVisitor
      Mappings:
      Namespace Name Mixin selector
      named visitDouble Lnet/minecraft/nbt/visitor/NbtElementVisitor;visitDouble(Lnet/minecraft/nbt/NbtDouble;)V
      intermediary method_32293 Lnet/minecraft/class_5627;method_32293(Lnet/minecraft/class_2489;)V
      official a Lvy;a(Luy;)V
    • visitByteArray

      public void visitByteArray(NbtByteArray element)
      Specified by:
      visitByteArray in interface NbtElementVisitor
      Mappings:
      Namespace Name Mixin selector
      named visitByteArray Lnet/minecraft/nbt/visitor/NbtElementVisitor;visitByteArray(Lnet/minecraft/nbt/NbtByteArray;)V
      intermediary method_32290 Lnet/minecraft/class_5627;method_32290(Lnet/minecraft/class_2479;)V
      official a Lvy;a(Luu;)V
    • visitIntArray

      public void visitIntArray(NbtIntArray element)
      Specified by:
      visitIntArray in interface NbtElementVisitor
      Mappings:
      Namespace Name Mixin selector
      named visitIntArray Lnet/minecraft/nbt/visitor/NbtElementVisitor;visitIntArray(Lnet/minecraft/nbt/NbtIntArray;)V
      intermediary method_32296 Lnet/minecraft/class_5627;method_32296(Lnet/minecraft/class_2495;)V
      official a Lvy;a(Lvb;)V
    • visitLongArray

      public void visitLongArray(NbtLongArray element)
      Specified by:
      visitLongArray in interface NbtElementVisitor
      Mappings:
      Namespace Name Mixin selector
      named visitLongArray Lnet/minecraft/nbt/visitor/NbtElementVisitor;visitLongArray(Lnet/minecraft/nbt/NbtLongArray;)V
      intermediary method_32299 Lnet/minecraft/class_5627;method_32299(Lnet/minecraft/class_2501;)V
      official a Lvy;a(Lve;)V
    • visitList

      public void visitList(NbtList element)
      Specified by:
      visitList in interface NbtElementVisitor
      Mappings:
      Namespace Name Mixin selector
      named visitList Lnet/minecraft/nbt/visitor/NbtElementVisitor;visitList(Lnet/minecraft/nbt/NbtList;)V
      intermediary method_32298 Lnet/minecraft/class_5627;method_32298(Lnet/minecraft/class_2499;)V
      official a Lvy;a(Lvd;)V
    • visitCompound

      public void visitCompound(NbtCompound compound)
      Specified by:
      visitCompound in interface NbtElementVisitor
      Mappings:
      Namespace Name Mixin selector
      named visitCompound Lnet/minecraft/nbt/visitor/NbtElementVisitor;visitCompound(Lnet/minecraft/nbt/NbtCompound;)V
      intermediary method_32292 Lnet/minecraft/class_5627;method_32292(Lnet/minecraft/class_2487;)V
      official a Lvy;a(Lux;)V
    • escapeName

      protected static String escapeName(String name)
      Mappings:
      Namespace Name Mixin selector
      named escapeName Lnet/minecraft/nbt/visitor/StringNbtWriter;escapeName(Ljava/lang/String;)Ljava/lang/String;
      intermediary method_32287 Lnet/minecraft/class_5626;method_32287(Ljava/lang/String;)Ljava/lang/String;
      official a Lvt;a(Ljava/lang/String;)Ljava/lang/String;
    • visitEnd

      public void visitEnd(NbtEnd element)
      Specified by:
      visitEnd in interface NbtElementVisitor
      Mappings:
      Namespace Name Mixin selector
      named visitEnd Lnet/minecraft/nbt/visitor/NbtElementVisitor;visitEnd(Lnet/minecraft/nbt/NbtEnd;)V
      intermediary method_32294 Lnet/minecraft/class_5627;method_32294(Lnet/minecraft/class_2491;)V
      official a Lvy;a(Luz;)V