Class NbtOrderedStringFormatter

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

public class NbtOrderedStringFormatter
extends Object
implements NbtTagVisitor
Formats an NBT tag as a multiline string where named tags inside of compounds are sorted according to a defined ordering.
Mappings:
Namespace Name
official nf
intermediary net/minecraft/class_5625
named net/minecraft/nbt/visitor/NbtOrderedStringFormatter
  • Field Details

    • ENTRY_ORDER_OVERRIDES

      private static final Map<String,​List<String>> ENTRY_ORDER_OVERRIDES
      Contains the names of tags which should appear before any other tag in a compound, even when they would otherwise appear later lexicographically. The list of tags which should be prioritized differs depending on the path of the compound.
      Mappings:
      Namespace Name Mixin selector
      official a Lnf;a:Ljava/util/Map;
      intermediary field_27820 Lnet/minecraft/class_5625;field_27820:Ljava/util/Map;
      named ENTRY_ORDER_OVERRIDES Lnet/minecraft/nbt/visitor/NbtOrderedStringFormatter;ENTRY_ORDER_OVERRIDES: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
      official b Lnf;b:Ljava/util/Set;
      intermediary field_27821 Lnet/minecraft/class_5625;field_27821:Ljava/util/Set;
      named IGNORED_PATHS Lnet/minecraft/nbt/visitor/NbtOrderedStringFormatter;IGNORED_PATHS:Ljava/util/Set;
    • SIMPLE_NAME

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

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

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

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

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

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

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

    • NbtOrderedStringFormatter

      public NbtOrderedStringFormatter()
    • NbtOrderedStringFormatter

      public NbtOrderedStringFormatter​(String prefix, int indentationLevel, List<String> pathParts)
      Mappings:
      Namespace Name Mixin selector
      official <init> Lnf;<init>(Ljava/lang/String;ILjava/util/List;)V
      intermediary <init> Lnet/minecraft/class_5625;<init>(Ljava/lang/String;ILjava/util/List;)V
      named <init> Lnet/minecraft/nbt/visitor/NbtOrderedStringFormatter;<init>(Ljava/lang/String;ILjava/util/List;)V
  • Method Details

    • apply

      public String apply​(Tag tag)
      Mappings:
      Namespace Name Mixin selector
      official a Lnf;a(Lni;)Ljava/lang/String;
      intermediary method_32283 Lnet/minecraft/class_5625;method_32283(Lnet/minecraft/class_2520;)Ljava/lang/String;
      named apply Lnet/minecraft/nbt/visitor/NbtOrderedStringFormatter;apply(Lnet/minecraft/nbt/Tag;)Ljava/lang/String;
    • 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
    • popPathPart

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

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

      protected List<String> getSortedNames​(CompoundTag tag)
      Mappings:
      Namespace Name Mixin selector
      official b Lnf;b(Lmq;)Ljava/util/List;
      intermediary method_32286 Lnet/minecraft/class_5625;method_32286(Lnet/minecraft/class_2487;)Ljava/util/List;
      named getSortedNames Lnet/minecraft/nbt/visitor/NbtOrderedStringFormatter;getSortedNames(Lnet/minecraft/nbt/CompoundTag;)Ljava/util/List;
    • joinPath

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

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