Class NbtOrderedStringFormatter

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

public class NbtOrderedStringFormatter extends Object implements NbtElementVisitor
Formats an NBT element as a multiline string where named elements inside of compound objects are sorted according to a defined ordering.
Mappings:
Namespace Name
named net/minecraft/nbt/visitor/NbtOrderedStringFormatter
intermediary net/minecraft/class_5625
official uq
  • Field Details

    • ENTRY_ORDER_OVERRIDES

      private static final Map<String,List<String>> ENTRY_ORDER_OVERRIDES
      Contains the names of elements which should appear before any other element in a compound object, even when they would otherwise appear later lexicographically. The list of elements which should be prioritized differs depending on the path of the compound object.
      Mappings:
      Namespace Name Mixin selector
      named ENTRY_ORDER_OVERRIDES Lnet/minecraft/nbt/visitor/NbtOrderedStringFormatter;ENTRY_ORDER_OVERRIDES:Ljava/util/Map;
      intermediary field_27820 Lnet/minecraft/class_5625;field_27820:Ljava/util/Map;
      official a Luq;a:Ljava/util/Map;
    • IGNORED_PATHS

      private static final Set<String> IGNORED_PATHS
      Contains paths for which the indentation prefix should not be prepended to the result.
      Mappings:
      Namespace Name Mixin selector
      named IGNORED_PATHS Lnet/minecraft/nbt/visitor/NbtOrderedStringFormatter;IGNORED_PATHS:Ljava/util/Set;
      intermediary field_27821 Lnet/minecraft/class_5625;field_27821:Ljava/util/Set;
      official b Luq;b:Ljava/util/Set;
    • SIMPLE_NAME

      private static final Pattern SIMPLE_NAME
      Mappings:
      Namespace Name Mixin selector
      named SIMPLE_NAME Lnet/minecraft/nbt/visitor/NbtOrderedStringFormatter;SIMPLE_NAME:Ljava/util/regex/Pattern;
      intermediary field_27822 Lnet/minecraft/class_5625;field_27822:Ljava/util/regex/Pattern;
      official c Luq;c:Ljava/util/regex/Pattern;
    • KEY_VALUE_SEPARATOR

      private static final String KEY_VALUE_SEPARATOR
      Mappings:
      Namespace Name Mixin selector
      named KEY_VALUE_SEPARATOR Lnet/minecraft/nbt/visitor/NbtOrderedStringFormatter;KEY_VALUE_SEPARATOR:Ljava/lang/String;
      intermediary field_27823 Lnet/minecraft/class_5625;field_27823:Ljava/lang/String;
      official d Luq;d:Ljava/lang/String;
    • ENTRY_SEPARATOR

      private static final String ENTRY_SEPARATOR
      Mappings:
      Namespace Name Mixin selector
      named ENTRY_SEPARATOR Lnet/minecraft/nbt/visitor/NbtOrderedStringFormatter;ENTRY_SEPARATOR:Ljava/lang/String;
      intermediary field_27824 Lnet/minecraft/class_5625;field_27824:Ljava/lang/String;
      official e Luq;e:Ljava/lang/String;
    • SQUARE_OPEN_BRACKET

      private static final String SQUARE_OPEN_BRACKET
      See Also:
      Mappings:
      Namespace Name Mixin selector
      named SQUARE_OPEN_BRACKET Lnet/minecraft/nbt/visitor/NbtOrderedStringFormatter;SQUARE_OPEN_BRACKET:Ljava/lang/String;
      intermediary field_33234 Lnet/minecraft/class_5625;field_33234:Ljava/lang/String;
      official f Luq;f:Ljava/lang/String;
    • SQUARE_CLOSE_BRACKET

      private static final String SQUARE_CLOSE_BRACKET
      See Also:
      Mappings:
      Namespace Name Mixin selector
      named SQUARE_CLOSE_BRACKET Lnet/minecraft/nbt/visitor/NbtOrderedStringFormatter;SQUARE_CLOSE_BRACKET:Ljava/lang/String;
      intermediary field_33235 Lnet/minecraft/class_5625;field_33235:Ljava/lang/String;
      official g Luq;g:Ljava/lang/String;
    • SEMICOLON

      private static final String SEMICOLON
      See Also:
      Mappings:
      Namespace Name Mixin selector
      named SEMICOLON Lnet/minecraft/nbt/visitor/NbtOrderedStringFormatter;SEMICOLON:Ljava/lang/String;
      intermediary field_33236 Lnet/minecraft/class_5625;field_33236:Ljava/lang/String;
      official h Luq;h:Ljava/lang/String;
    • SPACE

      private static final String SPACE
      See Also:
      Mappings:
      Namespace Name Mixin selector
      named SPACE Lnet/minecraft/nbt/visitor/NbtOrderedStringFormatter;SPACE:Ljava/lang/String;
      intermediary field_33237 Lnet/minecraft/class_5625;field_33237:Ljava/lang/String;
      official i Luq;i:Ljava/lang/String;
    • CURLY_OPEN_BRACKET

      private static final String CURLY_OPEN_BRACKET
      See Also:
      Mappings:
      Namespace Name Mixin selector
      named CURLY_OPEN_BRACKET Lnet/minecraft/nbt/visitor/NbtOrderedStringFormatter;CURLY_OPEN_BRACKET:Ljava/lang/String;
      intermediary field_33238 Lnet/minecraft/class_5625;field_33238:Ljava/lang/String;
      official j Luq;j:Ljava/lang/String;
    • CURLY_CLOSE_BRACKET

      private static final String CURLY_CLOSE_BRACKET
      See Also:
      Mappings:
      Namespace Name Mixin selector
      named CURLY_CLOSE_BRACKET Lnet/minecraft/nbt/visitor/NbtOrderedStringFormatter;CURLY_CLOSE_BRACKET:Ljava/lang/String;
      intermediary field_33239 Lnet/minecraft/class_5625;field_33239:Ljava/lang/String;
      official k Luq;k:Ljava/lang/String;
    • NEW_LINE

      private static final String NEW_LINE
      See Also:
      Mappings:
      Namespace Name Mixin selector
      named NEW_LINE Lnet/minecraft/nbt/visitor/NbtOrderedStringFormatter;NEW_LINE:Ljava/lang/String;
      intermediary field_33240 Lnet/minecraft/class_5625;field_33240:Ljava/lang/String;
      official l Luq;l:Ljava/lang/String;
    • prefix

      private final String prefix
      Mappings:
      Namespace Name Mixin selector
      named prefix Lnet/minecraft/nbt/visitor/NbtOrderedStringFormatter;prefix:Ljava/lang/String;
      intermediary field_27825 Lnet/minecraft/class_5625;field_27825:Ljava/lang/String;
      official m Luq;m:Ljava/lang/String;
    • indentationLevel

      private final int indentationLevel
      Mappings:
      Namespace Name Mixin selector
      named indentationLevel Lnet/minecraft/nbt/visitor/NbtOrderedStringFormatter;indentationLevel:I
      intermediary field_27826 Lnet/minecraft/class_5625;field_27826:I
      official n Luq;n:I
    • pathParts

      private final List<String> pathParts
      Mappings:
      Namespace Name Mixin selector
      named pathParts Lnet/minecraft/nbt/visitor/NbtOrderedStringFormatter;pathParts:Ljava/util/List;
      intermediary field_27827 Lnet/minecraft/class_5625;field_27827:Ljava/util/List;
      official o Luq;o:Ljava/util/List;
    • result

      private String result
      Mappings:
      Namespace Name Mixin selector
      named result Lnet/minecraft/nbt/visitor/NbtOrderedStringFormatter;result:Ljava/lang/String;
      intermediary field_27828 Lnet/minecraft/class_5625;field_27828:Ljava/lang/String;
      official p Luq;p:Ljava/lang/String;
  • Constructor Details

    • NbtOrderedStringFormatter

      public NbtOrderedStringFormatter()
    • NbtOrderedStringFormatter

      public NbtOrderedStringFormatter(String prefix, int indentationLevel, List<String> pathParts)
      Mappings:
      Namespace Name Mixin selector
      named <init> Lnet/minecraft/nbt/visitor/NbtOrderedStringFormatter;<init>(Ljava/lang/String;ILjava/util/List;)V
      intermediary <init> Lnet/minecraft/class_5625;<init>(Ljava/lang/String;ILjava/util/List;)V
      official <init> Luq;<init>(Ljava/lang/String;ILjava/util/List;)V
  • 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/NbtOrderedStringFormatter;apply(Lnet/minecraft/nbt/NbtElement;)Ljava/lang/String;
      intermediary method_32283 Lnet/minecraft/class_5625;method_32283(Lnet/minecraft/class_2520;)Ljava/lang/String;
      official a Luq;a(Luu;)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 Luy;a(Lus;)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 Luy;a(Ltv;)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 Luy;a(Lup;)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 Luy;a(Luc;)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 Luy;a(Luf;)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 Luy;a(Lua;)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 Luy;a(Lty;)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 Luy;a(Ltu;)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 Luy;a(Lub;)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 Luy;a(Lue;)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 Luy;a(Lud;)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 Luy;a(Ltx;)V
    • popPathPart

      private void popPathPart()
      Mappings:
      Namespace Name Mixin selector
      named popPathPart Lnet/minecraft/nbt/visitor/NbtOrderedStringFormatter;popPathPart()V
      intermediary method_32284 Lnet/minecraft/class_5625;method_32284()V
      official b Luq;b()V
    • pushPathPart

      private void pushPathPart(String part)
      Mappings:
      Namespace Name Mixin selector
      named pushPathPart Lnet/minecraft/nbt/visitor/NbtOrderedStringFormatter;pushPathPart(Ljava/lang/String;)V
      intermediary method_32285 Lnet/minecraft/class_5625;method_32285(Ljava/lang/String;)V
      official b Luq;b(Ljava/lang/String;)V
    • getSortedNames

      protected List<String> getSortedNames(NbtCompound compound)
      Mappings:
      Namespace Name Mixin selector
      named getSortedNames Lnet/minecraft/nbt/visitor/NbtOrderedStringFormatter;getSortedNames(Lnet/minecraft/nbt/NbtCompound;)Ljava/util/List;
      intermediary method_32286 Lnet/minecraft/class_5625;method_32286(Lnet/minecraft/class_2487;)Ljava/util/List;
      official b Luq;b(Ltx;)Ljava/util/List;
    • joinPath

      public String joinPath()
      Mappings:
      Namespace Name Mixin selector
      named joinPath Lnet/minecraft/nbt/visitor/NbtOrderedStringFormatter;joinPath()Ljava/lang/String;
      intermediary method_32280 Lnet/minecraft/class_5625;method_32280()Ljava/lang/String;
      official a Luq;a()Ljava/lang/String;
    • escapeName

      protected static String escapeName(String name)
      Mappings:
      Namespace Name Mixin selector
      named escapeName Lnet/minecraft/nbt/visitor/NbtOrderedStringFormatter;escapeName(Ljava/lang/String;)Ljava/lang/String;
      intermediary method_32281 Lnet/minecraft/class_5625;method_32281(Ljava/lang/String;)Ljava/lang/String;
      official a Luq;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 Luy;a(Ltz;)V