Class NbtTextFormatter

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

public class NbtTextFormatter extends Object implements NbtElementVisitor
Formats an NBT element into a colored, multiline Text representation suitable for human-readable displays.
Mappings:
Namespace Name
official qh
intermediary net/minecraft/class_5628
named net/minecraft/nbt/visitor/NbtTextFormatter
  • Field Details

    • LOGGER

      private static final org.slf4j.Logger LOGGER
      Mappings:
      Namespace Name Mixin selector
      official a Lqh;a:Lorg/slf4j/Logger;
      intermediary field_27831 Lnet/minecraft/class_5628;field_27831:Lorg/slf4j/Logger;
      named LOGGER Lnet/minecraft/nbt/visitor/NbtTextFormatter;LOGGER:Lorg/slf4j/Logger;
    • field_33271

      private static final int field_33271
      See Also:
      Mappings:
      Namespace Name Mixin selector
      official b Lqh;b:I
      intermediary field_33271 Lnet/minecraft/class_5628;field_33271:I
      named field_33271 Lnet/minecraft/nbt/visitor/NbtTextFormatter;field_33271:I
    • SINGLE_LINE_ELEMENT_TYPES

      private static final ByteCollection SINGLE_LINE_ELEMENT_TYPES
      Mappings:
      Namespace Name Mixin selector
      official c Lqh;c:Lit/unimi/dsi/fastutil/bytes/ByteCollection;
      intermediary field_27832 Lnet/minecraft/class_5628;field_27832:Lit/unimi/dsi/fastutil/bytes/ByteCollection;
      named SINGLE_LINE_ELEMENT_TYPES Lnet/minecraft/nbt/visitor/NbtTextFormatter;SINGLE_LINE_ELEMENT_TYPES:Lit/unimi/dsi/fastutil/bytes/ByteCollection;
    • NAME_COLOR

      private static final Formatting NAME_COLOR
      Mappings:
      Namespace Name Mixin selector
      official d Lqh;d:Lp;
      intermediary field_27833 Lnet/minecraft/class_5628;field_27833:Lnet/minecraft/class_124;
      named NAME_COLOR Lnet/minecraft/nbt/visitor/NbtTextFormatter;NAME_COLOR:Lnet/minecraft/util/Formatting;
    • STRING_COLOR

      private static final Formatting STRING_COLOR
      Mappings:
      Namespace Name Mixin selector
      official e Lqh;e:Lp;
      intermediary field_27834 Lnet/minecraft/class_5628;field_27834:Lnet/minecraft/class_124;
      named STRING_COLOR Lnet/minecraft/nbt/visitor/NbtTextFormatter;STRING_COLOR:Lnet/minecraft/util/Formatting;
    • NUMBER_COLOR

      private static final Formatting NUMBER_COLOR
      Mappings:
      Namespace Name Mixin selector
      official f Lqh;f:Lp;
      intermediary field_27835 Lnet/minecraft/class_5628;field_27835:Lnet/minecraft/class_124;
      named NUMBER_COLOR Lnet/minecraft/nbt/visitor/NbtTextFormatter;NUMBER_COLOR:Lnet/minecraft/util/Formatting;
    • TYPE_SUFFIX_COLOR

      private static final Formatting TYPE_SUFFIX_COLOR
      Mappings:
      Namespace Name Mixin selector
      official g Lqh;g:Lp;
      intermediary field_27836 Lnet/minecraft/class_5628;field_27836:Lnet/minecraft/class_124;
      named TYPE_SUFFIX_COLOR Lnet/minecraft/nbt/visitor/NbtTextFormatter;TYPE_SUFFIX_COLOR:Lnet/minecraft/util/Formatting;
    • SIMPLE_NAME

      private static final Pattern SIMPLE_NAME
      Mappings:
      Namespace Name Mixin selector
      official h Lqh;h:Ljava/util/regex/Pattern;
      intermediary field_27837 Lnet/minecraft/class_5628;field_27837:Ljava/util/regex/Pattern;
      named SIMPLE_NAME Lnet/minecraft/nbt/visitor/NbtTextFormatter;SIMPLE_NAME:Ljava/util/regex/Pattern;
    • KEY_VALUE_SEPARATOR

      private static final String KEY_VALUE_SEPARATOR
      Mappings:
      Namespace Name Mixin selector
      official i Lqh;i:Ljava/lang/String;
      intermediary field_27838 Lnet/minecraft/class_5628;field_27838:Ljava/lang/String;
      named KEY_VALUE_SEPARATOR Lnet/minecraft/nbt/visitor/NbtTextFormatter;KEY_VALUE_SEPARATOR:Ljava/lang/String;
    • ENTRY_SEPARATOR

      private static final String ENTRY_SEPARATOR
      Mappings:
      Namespace Name Mixin selector
      official j Lqh;j:Ljava/lang/String;
      intermediary field_27839 Lnet/minecraft/class_5628;field_27839:Ljava/lang/String;
      named ENTRY_SEPARATOR Lnet/minecraft/nbt/visitor/NbtTextFormatter;ENTRY_SEPARATOR:Ljava/lang/String;
    • SQUARE_OPEN_BRACKET

      private static final String SQUARE_OPEN_BRACKET
      See Also:
      Mappings:
      Namespace Name Mixin selector
      official k Lqh;k:Ljava/lang/String;
      intermediary field_33272 Lnet/minecraft/class_5628;field_33272:Ljava/lang/String;
      named SQUARE_OPEN_BRACKET Lnet/minecraft/nbt/visitor/NbtTextFormatter;SQUARE_OPEN_BRACKET:Ljava/lang/String;
    • SQUARE_CLOSE_BRACKET

      private static final String SQUARE_CLOSE_BRACKET
      See Also:
      Mappings:
      Namespace Name Mixin selector
      official l Lqh;l:Ljava/lang/String;
      intermediary field_33273 Lnet/minecraft/class_5628;field_33273:Ljava/lang/String;
      named SQUARE_CLOSE_BRACKET Lnet/minecraft/nbt/visitor/NbtTextFormatter;SQUARE_CLOSE_BRACKET:Ljava/lang/String;
    • SEMICOLON

      private static final String SEMICOLON
      See Also:
      Mappings:
      Namespace Name Mixin selector
      official m Lqh;m:Ljava/lang/String;
      intermediary field_33274 Lnet/minecraft/class_5628;field_33274:Ljava/lang/String;
      named SEMICOLON Lnet/minecraft/nbt/visitor/NbtTextFormatter;SEMICOLON:Ljava/lang/String;
    • SPACE

      private static final String SPACE
      See Also:
      Mappings:
      Namespace Name Mixin selector
      official n Lqh;n:Ljava/lang/String;
      intermediary field_33275 Lnet/minecraft/class_5628;field_33275:Ljava/lang/String;
      named SPACE Lnet/minecraft/nbt/visitor/NbtTextFormatter;SPACE:Ljava/lang/String;
    • CURLY_OPEN_BRACKET

      private static final String CURLY_OPEN_BRACKET
      See Also:
      Mappings:
      Namespace Name Mixin selector
      official o Lqh;o:Ljava/lang/String;
      intermediary field_33276 Lnet/minecraft/class_5628;field_33276:Ljava/lang/String;
      named CURLY_OPEN_BRACKET Lnet/minecraft/nbt/visitor/NbtTextFormatter;CURLY_OPEN_BRACKET:Ljava/lang/String;
    • CURLY_CLOSE_BRACKET

      private static final String CURLY_CLOSE_BRACKET
      See Also:
      Mappings:
      Namespace Name Mixin selector
      official p Lqh;p:Ljava/lang/String;
      intermediary field_33277 Lnet/minecraft/class_5628;field_33277:Ljava/lang/String;
      named CURLY_CLOSE_BRACKET Lnet/minecraft/nbt/visitor/NbtTextFormatter;CURLY_CLOSE_BRACKET:Ljava/lang/String;
    • NEW_LINE

      private static final String NEW_LINE
      See Also:
      Mappings:
      Namespace Name Mixin selector
      official q Lqh;q:Ljava/lang/String;
      intermediary field_33278 Lnet/minecraft/class_5628;field_33278:Ljava/lang/String;
      named NEW_LINE Lnet/minecraft/nbt/visitor/NbtTextFormatter;NEW_LINE:Ljava/lang/String;
    • prefix

      private final String prefix
      Mappings:
      Namespace Name Mixin selector
      official r Lqh;r:Ljava/lang/String;
      intermediary field_27840 Lnet/minecraft/class_5628;field_27840:Ljava/lang/String;
      named prefix Lnet/minecraft/nbt/visitor/NbtTextFormatter;prefix:Ljava/lang/String;
    • indentationLevel

      private final int indentationLevel
      Mappings:
      Namespace Name Mixin selector
      official s Lqh;s:I
      intermediary field_27841 Lnet/minecraft/class_5628;field_27841:I
      named indentationLevel Lnet/minecraft/nbt/visitor/NbtTextFormatter;indentationLevel:I
    • result

      private Text result
      Mappings:
      Namespace Name Mixin selector
      official t Lqh;t:Lrq;
      intermediary field_27842 Lnet/minecraft/class_5628;field_27842:Lnet/minecraft/class_2561;
      named result Lnet/minecraft/nbt/visitor/NbtTextFormatter;result:Lnet/minecraft/text/Text;
  • Constructor Details

    • NbtTextFormatter

      public NbtTextFormatter(String prefix, int indentationLevel)
      Mappings:
      Namespace Name Mixin selector
      official <init> Lqh;<init>(Ljava/lang/String;I)V
      intermediary <init> Lnet/minecraft/class_5628;<init>(Ljava/lang/String;I)V
      named <init> Lnet/minecraft/nbt/visitor/NbtTextFormatter;<init>(Ljava/lang/String;I)V
  • Method Details

    • apply

      public Text apply(NbtElement element)
      Returns the textified NBT element.
      Returns:
      the textified NBT element
      Mappings:
      Namespace Name Mixin selector
      official a Lqh;a(Lqc;)Lrq;
      intermediary method_32305 Lnet/minecraft/class_5628;method_32305(Lnet/minecraft/class_2520;)Lnet/minecraft/class_2561;
      named apply Lnet/minecraft/nbt/visitor/NbtTextFormatter;apply(Lnet/minecraft/nbt/NbtElement;)Lnet/minecraft/text/Text;
    • visitString

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

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

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

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

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

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

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

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

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

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

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

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

      protected static Text escapeName(String name)
      Mappings:
      Namespace Name Mixin selector
      official a Lqh;a(Ljava/lang/String;)Lrq;
      intermediary method_32304 Lnet/minecraft/class_5628;method_32304(Ljava/lang/String;)Lnet/minecraft/class_2561;
      named escapeName Lnet/minecraft/nbt/visitor/NbtTextFormatter;escapeName(Ljava/lang/String;)Lnet/minecraft/text/Text;
    • visitEnd

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