Class NbtTextFormatter

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

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

    • LOGGER

      private static final Logger LOGGER
      Mappings:
      Namespace Name Mixin selector
      official a Lnn;a:Lorg/apache/logging/log4j/Logger;
      intermediary field_27831 Lnet/minecraft/class_5628;field_27831:Lorg/apache/logging/log4j/Logger;
      named LOGGER Lnet/minecraft/nbt/visitor/NbtTextFormatter;LOGGER:Lorg/apache/logging/log4j/Logger;
    • SINGLE_LINE_ELEMENT_TYPES

      private static final ByteCollection SINGLE_LINE_ELEMENT_TYPES
      Mappings:
      Namespace Name Mixin selector
      official b Lnn;b: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 c Lnn;c:Lk;
      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 d Lnn;d:Lk;
      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 e Lnn;e:Lk;
      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 f Lnn;f:Lk;
      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 g Lnn;g: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 h Lnn;h: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 i Lnn;i: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;
    • prefix

      private final String prefix
      Mappings:
      Namespace Name Mixin selector
      official j Lnn;j: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 k Lnn;k: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 l Lnn;l:Loi;
      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> Lnn;<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​(Tag tag)
      Mappings:
      Namespace Name Mixin selector
      official a Lnn;a(Lni;)Loi;
      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/Tag;)Lnet/minecraft/text/Text;
    • visitStringTag

      public void visitStringTag​(StringTag tag)
      Specified by:
      visitStringTag in interface NbtTagVisitor
      Mappings:
      Namespace Name Mixin selector
      official a Lnm;a(Lng;)V
      intermediary method_32302 Lnet/minecraft/class_5627;method_32302(Lnet/minecraft/class_2519;)V
      named visitStringTag Lnet/minecraft/nbt/visitor/NbtTagVisitor;visitStringTag(Lnet/minecraft/nbt/StringTag;)V
    • visitByteTag

      public void visitByteTag​(ByteTag tag)
      Specified by:
      visitByteTag in interface NbtTagVisitor
      Mappings:
      Namespace Name Mixin selector
      official a Lnm;a(Lmo;)V
      intermediary method_32291 Lnet/minecraft/class_5627;method_32291(Lnet/minecraft/class_2481;)V
      named visitByteTag Lnet/minecraft/nbt/visitor/NbtTagVisitor;visitByteTag(Lnet/minecraft/nbt/ByteTag;)V
    • visitShortTag

      public void visitShortTag​(ShortTag tag)
      Specified by:
      visitShortTag in interface NbtTagVisitor
      Mappings:
      Namespace Name Mixin selector
      official a Lnm;a(Lne;)V
      intermediary method_32301 Lnet/minecraft/class_5627;method_32301(Lnet/minecraft/class_2516;)V
      named visitShortTag Lnet/minecraft/nbt/visitor/NbtTagVisitor;visitShortTag(Lnet/minecraft/nbt/ShortTag;)V
    • visitIntTag

      public void visitIntTag​(IntTag tag)
      Specified by:
      visitIntTag in interface NbtTagVisitor
      Mappings:
      Namespace Name Mixin selector
      official a Lnm;a(Lmv;)V
      intermediary method_32297 Lnet/minecraft/class_5627;method_32297(Lnet/minecraft/class_2497;)V
      named visitIntTag Lnet/minecraft/nbt/visitor/NbtTagVisitor;visitIntTag(Lnet/minecraft/nbt/IntTag;)V
    • visitLongTag

      public void visitLongTag​(LongTag tag)
      Specified by:
      visitLongTag in interface NbtTagVisitor
      Mappings:
      Namespace Name Mixin selector
      official a Lnm;a(Lmy;)V
      intermediary method_32300 Lnet/minecraft/class_5627;method_32300(Lnet/minecraft/class_2503;)V
      named visitLongTag Lnet/minecraft/nbt/visitor/NbtTagVisitor;visitLongTag(Lnet/minecraft/nbt/LongTag;)V
    • visitFloatTag

      public void visitFloatTag​(FloatTag tag)
      Specified by:
      visitFloatTag in interface NbtTagVisitor
      Mappings:
      Namespace Name Mixin selector
      official a Lnm;a(Lmt;)V
      intermediary method_32295 Lnet/minecraft/class_5627;method_32295(Lnet/minecraft/class_2494;)V
      named visitFloatTag Lnet/minecraft/nbt/visitor/NbtTagVisitor;visitFloatTag(Lnet/minecraft/nbt/FloatTag;)V
    • visitDoubleTag

      public void visitDoubleTag​(DoubleTag tag)
      Specified by:
      visitDoubleTag in interface NbtTagVisitor
      Mappings:
      Namespace Name Mixin selector
      official a Lnm;a(Lmr;)V
      intermediary method_32293 Lnet/minecraft/class_5627;method_32293(Lnet/minecraft/class_2489;)V
      named visitDoubleTag Lnet/minecraft/nbt/visitor/NbtTagVisitor;visitDoubleTag(Lnet/minecraft/nbt/DoubleTag;)V
    • visitByteArrayTag

      public void visitByteArrayTag​(ByteArrayTag tag)
      Specified by:
      visitByteArrayTag in interface NbtTagVisitor
      Mappings:
      Namespace Name Mixin selector
      official a Lnm;a(Lmn;)V
      intermediary method_32290 Lnet/minecraft/class_5627;method_32290(Lnet/minecraft/class_2479;)V
      named visitByteArrayTag Lnet/minecraft/nbt/visitor/NbtTagVisitor;visitByteArrayTag(Lnet/minecraft/nbt/ByteArrayTag;)V
    • visitIntArrayTag

      public void visitIntArrayTag​(IntArrayTag tag)
      Specified by:
      visitIntArrayTag in interface NbtTagVisitor
      Mappings:
      Namespace Name Mixin selector
      official a Lnm;a(Lmu;)V
      intermediary method_32296 Lnet/minecraft/class_5627;method_32296(Lnet/minecraft/class_2495;)V
      named visitIntArrayTag Lnet/minecraft/nbt/visitor/NbtTagVisitor;visitIntArrayTag(Lnet/minecraft/nbt/IntArrayTag;)V
    • visitLongArrayTag

      public void visitLongArrayTag​(LongArrayTag tag)
      Specified by:
      visitLongArrayTag in interface NbtTagVisitor
      Mappings:
      Namespace Name Mixin selector
      official a Lnm;a(Lmx;)V
      intermediary method_32299 Lnet/minecraft/class_5627;method_32299(Lnet/minecraft/class_2501;)V
      named visitLongArrayTag Lnet/minecraft/nbt/visitor/NbtTagVisitor;visitLongArrayTag(Lnet/minecraft/nbt/LongArrayTag;)V
    • visitListTag

      public void visitListTag​(ListTag tag)
      Specified by:
      visitListTag in interface NbtTagVisitor
      Mappings:
      Namespace Name Mixin selector
      official a Lnm;a(Lmw;)V
      intermediary method_32298 Lnet/minecraft/class_5627;method_32298(Lnet/minecraft/class_2499;)V
      named visitListTag Lnet/minecraft/nbt/visitor/NbtTagVisitor;visitListTag(Lnet/minecraft/nbt/ListTag;)V
    • visitCompoundTag

      public void visitCompoundTag​(CompoundTag tag)
      Specified by:
      visitCompoundTag in interface NbtTagVisitor
      Mappings:
      Namespace Name Mixin selector
      official a Lnm;a(Lmq;)V
      intermediary method_32292 Lnet/minecraft/class_5627;method_32292(Lnet/minecraft/class_2487;)V
      named visitCompoundTag Lnet/minecraft/nbt/visitor/NbtTagVisitor;visitCompoundTag(Lnet/minecraft/nbt/CompoundTag;)V
    • escapeName

      protected static Text escapeName​(String name)
      Mappings:
      Namespace Name Mixin selector
      official a Lnn;a(Ljava/lang/String;)Loi;
      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;
    • visitEndTag

      public void visitEndTag​(EndTag tag)
      Specified by:
      visitEndTag in interface NbtTagVisitor
      Mappings:
      Namespace Name Mixin selector
      official a Lnm;a(Lms;)V
      intermediary method_32294 Lnet/minecraft/class_5627;method_32294(Lnet/minecraft/class_2491;)V
      named visitEndTag Lnet/minecraft/nbt/visitor/NbtTagVisitor;visitEndTag(Lnet/minecraft/nbt/EndTag;)V