Package net.minecraft.nbt.visitor
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.-
Field Summary
Fields Modifier and Type Field Description private static String
ENTRY_SEPARATOR
private int
indentationLevel
private static String
KEY_VALUE_SEPARATOR
private static Logger
LOGGER
private static Formatting
NAME_COLOR
private static Formatting
NUMBER_COLOR
private String
prefix
private Text
result
private static Pattern
SIMPLE_NAME
private static ByteCollection
SINGLE_LINE_ELEMENT_TYPES
private static Formatting
STRING_COLOR
private static Formatting
TYPE_SUFFIX_COLOR
-
Constructor Summary
Constructors Constructor Description NbtTextFormatter(String prefix, int indentationLevel)
-
Method Summary
Modifier and Type Method Description Text
apply(Tag tag)
protected static Text
escapeName(String name)
void
visitByteArrayTag(ByteArrayTag tag)
void
visitByteTag(ByteTag tag)
void
visitCompoundTag(CompoundTag tag)
void
visitDoubleTag(DoubleTag tag)
void
visitEndTag(EndTag tag)
void
visitFloatTag(FloatTag tag)
void
visitIntArrayTag(IntArrayTag tag)
void
visitIntTag(IntTag tag)
void
visitListTag(ListTag tag)
void
visitLongArrayTag(LongArrayTag tag)
void
visitLongTag(LongTag tag)
void
visitShortTag(ShortTag tag)
void
visitStringTag(StringTag tag)
-
Field Details
-
LOGGER
-
SINGLE_LINE_ELEMENT_TYPES
-
NAME_COLOR
-
STRING_COLOR
-
NUMBER_COLOR
-
TYPE_SUFFIX_COLOR
-
SIMPLE_NAME
-
KEY_VALUE_SEPARATOR
-
ENTRY_SEPARATOR
-
prefix
-
indentationLevel
private final int indentationLevel -
result
-
-
Constructor Details
-
NbtTextFormatter
-
-
Method Details
-
apply
-
visitStringTag
- Specified by:
visitStringTag
in interfaceNbtTagVisitor
-
visitByteTag
- Specified by:
visitByteTag
in interfaceNbtTagVisitor
-
visitShortTag
- Specified by:
visitShortTag
in interfaceNbtTagVisitor
-
visitIntTag
- Specified by:
visitIntTag
in interfaceNbtTagVisitor
-
visitLongTag
- Specified by:
visitLongTag
in interfaceNbtTagVisitor
-
visitFloatTag
- Specified by:
visitFloatTag
in interfaceNbtTagVisitor
-
visitDoubleTag
- Specified by:
visitDoubleTag
in interfaceNbtTagVisitor
-
visitByteArrayTag
- Specified by:
visitByteArrayTag
in interfaceNbtTagVisitor
-
visitIntArrayTag
- Specified by:
visitIntArrayTag
in interfaceNbtTagVisitor
-
visitLongArrayTag
- Specified by:
visitLongArrayTag
in interfaceNbtTagVisitor
-
visitListTag
- Specified by:
visitListTag
in interfaceNbtTagVisitor
-
visitCompoundTag
- Specified by:
visitCompoundTag
in interfaceNbtTagVisitor
-
escapeName
-
visitEndTag
- Specified by:
visitEndTag
in interfaceNbtTagVisitor
-