Package net.minecraft.nbt
Class StringNbtReader
java.lang.Object
net.minecraft.nbt.StringNbtReader
A class for reading a stringified NBT.
- API Note:
- Methods in this class throw
CommandSyntaxExceptionto indicate syntax errors within the NBT representation. - Mappings:
Namespace Name official tlintermediary net/minecraft/class_2522named net/minecraft/nbt/StringNbtReader
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final com.mojang.brigadier.exceptions.DynamicCommandExceptionTypestatic final com.mojang.brigadier.exceptions.Dynamic2CommandExceptionTypeprivate static final Patternstatic final charstatic final charprivate static final Patternprivate static final Patternstatic final com.mojang.brigadier.exceptions.SimpleCommandExceptionTypestatic final com.mojang.brigadier.exceptions.SimpleCommandExceptionTypeprivate static final Patternprivate static final Patternprivate static final charstatic final com.mojang.brigadier.exceptions.Dynamic2CommandExceptionTypeprivate static final Patternprivate final com.mojang.brigadier.StringReaderprivate static final charprivate static final Patternprivate static final charprivate static final charstatic final com.mojang.serialization.Codec<NbtCompound>static final com.mojang.brigadier.exceptions.SimpleCommandExceptionType -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate voidexpect(char c) static NbtCompoundReturns the NBT compound parsed from thestring.protected NbtElementReturns the parsed NBT compound.Returns the parsed NBT element.protected NbtElementprivate NbtElementprivate NbtElementprivate NbtElementparsePrimitive(String input) private boolean(package private) NbtCompoundprotected String
-
Field Details
-
TRAILING
public static final com.mojang.brigadier.exceptions.SimpleCommandExceptionType TRAILING- Mappings:
Namespace Name Mixin selector official aLtl;a:Lcom/mojang/brigadier/exceptions/SimpleCommandExceptionType;intermediary field_11602Lnet/minecraft/class_2522;field_11602:Lcom/mojang/brigadier/exceptions/SimpleCommandExceptionType;named TRAILINGLnet/minecraft/nbt/StringNbtReader;TRAILING:Lcom/mojang/brigadier/exceptions/SimpleCommandExceptionType;
-
EXPECTED_KEY
public static final com.mojang.brigadier.exceptions.SimpleCommandExceptionType EXPECTED_KEY- Mappings:
Namespace Name Mixin selector official bLtl;b:Lcom/mojang/brigadier/exceptions/SimpleCommandExceptionType;intermediary field_11608Lnet/minecraft/class_2522;field_11608:Lcom/mojang/brigadier/exceptions/SimpleCommandExceptionType;named EXPECTED_KEYLnet/minecraft/nbt/StringNbtReader;EXPECTED_KEY:Lcom/mojang/brigadier/exceptions/SimpleCommandExceptionType;
-
EXPECTED_VALUE
public static final com.mojang.brigadier.exceptions.SimpleCommandExceptionType EXPECTED_VALUE- Mappings:
Namespace Name Mixin selector official cLtl;c:Lcom/mojang/brigadier/exceptions/SimpleCommandExceptionType;intermediary field_11605Lnet/minecraft/class_2522;field_11605:Lcom/mojang/brigadier/exceptions/SimpleCommandExceptionType;named EXPECTED_VALUELnet/minecraft/nbt/StringNbtReader;EXPECTED_VALUE:Lcom/mojang/brigadier/exceptions/SimpleCommandExceptionType;
-
LIST_MIXED
public static final com.mojang.brigadier.exceptions.Dynamic2CommandExceptionType LIST_MIXED- Mappings:
Namespace Name Mixin selector official dLtl;d:Lcom/mojang/brigadier/exceptions/Dynamic2CommandExceptionType;intermediary field_11603Lnet/minecraft/class_2522;field_11603:Lcom/mojang/brigadier/exceptions/Dynamic2CommandExceptionType;named LIST_MIXEDLnet/minecraft/nbt/StringNbtReader;LIST_MIXED:Lcom/mojang/brigadier/exceptions/Dynamic2CommandExceptionType;
-
ARRAY_MIXED
public static final com.mojang.brigadier.exceptions.Dynamic2CommandExceptionType ARRAY_MIXED- Mappings:
Namespace Name Mixin selector official eLtl;e:Lcom/mojang/brigadier/exceptions/Dynamic2CommandExceptionType;intermediary field_11597Lnet/minecraft/class_2522;field_11597:Lcom/mojang/brigadier/exceptions/Dynamic2CommandExceptionType;named ARRAY_MIXEDLnet/minecraft/nbt/StringNbtReader;ARRAY_MIXED:Lcom/mojang/brigadier/exceptions/Dynamic2CommandExceptionType;
-
ARRAY_INVALID
public static final com.mojang.brigadier.exceptions.DynamicCommandExceptionType ARRAY_INVALID- Mappings:
Namespace Name Mixin selector official fLtl;f:Lcom/mojang/brigadier/exceptions/DynamicCommandExceptionType;intermediary field_11604Lnet/minecraft/class_2522;field_11604:Lcom/mojang/brigadier/exceptions/DynamicCommandExceptionType;named ARRAY_INVALIDLnet/minecraft/nbt/StringNbtReader;ARRAY_INVALID:Lcom/mojang/brigadier/exceptions/DynamicCommandExceptionType;
-
COMMA
public static final char COMMA- See Also:
- Mappings:
Namespace Name Mixin selector official gLtl;g:Cintermediary field_33265Lnet/minecraft/class_2522;field_33265:Cnamed COMMALnet/minecraft/nbt/StringNbtReader;COMMA:C
-
COLON
public static final char COLON- See Also:
- Mappings:
Namespace Name Mixin selector official hLtl;h:Cintermediary field_33266Lnet/minecraft/class_2522;field_33266:Cnamed COLONLnet/minecraft/nbt/StringNbtReader;COLON:C
-
SQUARE_OPEN_BRACKET
private static final char SQUARE_OPEN_BRACKET- See Also:
- Mappings:
Namespace Name Mixin selector official jLtl;j:Cintermediary field_33267Lnet/minecraft/class_2522;field_33267:Cnamed SQUARE_OPEN_BRACKETLnet/minecraft/nbt/StringNbtReader;SQUARE_OPEN_BRACKET:C
-
SQUARE_CLOSE_BRACKET
private static final char SQUARE_CLOSE_BRACKET- See Also:
- Mappings:
Namespace Name Mixin selector official kLtl;k:Cintermediary field_33268Lnet/minecraft/class_2522;field_33268:Cnamed SQUARE_CLOSE_BRACKETLnet/minecraft/nbt/StringNbtReader;SQUARE_CLOSE_BRACKET:C
-
RIGHT_CURLY_BRACKET
private static final char RIGHT_CURLY_BRACKET- See Also:
- Mappings:
Namespace Name Mixin selector official lLtl;l:Cintermediary field_33269Lnet/minecraft/class_2522;field_33269:Cnamed RIGHT_CURLY_BRACKETLnet/minecraft/nbt/StringNbtReader;RIGHT_CURLY_BRACKET:C
-
LEFT_CURLY_BRACKET
private static final char LEFT_CURLY_BRACKET- See Also:
- Mappings:
Namespace Name Mixin selector official mLtl;m:Cintermediary field_33270Lnet/minecraft/class_2522;field_33270:Cnamed LEFT_CURLY_BRACKETLnet/minecraft/nbt/StringNbtReader;LEFT_CURLY_BRACKET:C
-
DOUBLE_PATTERN_IMPLICIT
- Mappings:
Namespace Name Mixin selector official nLtl;n:Ljava/util/regex/Pattern;intermediary field_11607Lnet/minecraft/class_2522;field_11607:Ljava/util/regex/Pattern;named DOUBLE_PATTERN_IMPLICITLnet/minecraft/nbt/StringNbtReader;DOUBLE_PATTERN_IMPLICIT:Ljava/util/regex/Pattern;
-
DOUBLE_PATTERN
- Mappings:
Namespace Name Mixin selector official oLtl;o:Ljava/util/regex/Pattern;intermediary field_11600Lnet/minecraft/class_2522;field_11600:Ljava/util/regex/Pattern;named DOUBLE_PATTERNLnet/minecraft/nbt/StringNbtReader;DOUBLE_PATTERN:Ljava/util/regex/Pattern;
-
FLOAT_PATTERN
- Mappings:
Namespace Name Mixin selector official pLtl;p:Ljava/util/regex/Pattern;intermediary field_11596Lnet/minecraft/class_2522;field_11596:Ljava/util/regex/Pattern;named FLOAT_PATTERNLnet/minecraft/nbt/StringNbtReader;FLOAT_PATTERN:Ljava/util/regex/Pattern;
-
BYTE_PATTERN
- Mappings:
Namespace Name Mixin selector official qLtl;q:Ljava/util/regex/Pattern;intermediary field_11606Lnet/minecraft/class_2522;field_11606:Ljava/util/regex/Pattern;named BYTE_PATTERNLnet/minecraft/nbt/StringNbtReader;BYTE_PATTERN:Ljava/util/regex/Pattern;
-
LONG_PATTERN
- Mappings:
Namespace Name Mixin selector official rLtl;r:Ljava/util/regex/Pattern;intermediary field_11609Lnet/minecraft/class_2522;field_11609:Ljava/util/regex/Pattern;named LONG_PATTERNLnet/minecraft/nbt/StringNbtReader;LONG_PATTERN:Ljava/util/regex/Pattern;
-
SHORT_PATTERN
- Mappings:
Namespace Name Mixin selector official sLtl;s:Ljava/util/regex/Pattern;intermediary field_11601Lnet/minecraft/class_2522;field_11601:Ljava/util/regex/Pattern;named SHORT_PATTERNLnet/minecraft/nbt/StringNbtReader;SHORT_PATTERN:Ljava/util/regex/Pattern;
-
INT_PATTERN
- Mappings:
Namespace Name Mixin selector official tLtl;t:Ljava/util/regex/Pattern;intermediary field_11599Lnet/minecraft/class_2522;field_11599:Ljava/util/regex/Pattern;named INT_PATTERNLnet/minecraft/nbt/StringNbtReader;INT_PATTERN:Ljava/util/regex/Pattern;
-
STRINGIFIED_CODEC
- Mappings:
Namespace Name Mixin selector official iLtl;i:Lcom/mojang/serialization/Codec;intermediary field_45952Lnet/minecraft/class_2522;field_45952:Lcom/mojang/serialization/Codec;named STRINGIFIED_CODECLnet/minecraft/nbt/StringNbtReader;STRINGIFIED_CODEC:Lcom/mojang/serialization/Codec;
-
reader
private final com.mojang.brigadier.StringReader reader- Mappings:
Namespace Name Mixin selector official uLtl;u:Lcom/mojang/brigadier/StringReader;intermediary field_11598Lnet/minecraft/class_2522;field_11598:Lcom/mojang/brigadier/StringReader;named readerLnet/minecraft/nbt/StringNbtReader;reader:Lcom/mojang/brigadier/StringReader;
-
-
Constructor Details
-
StringNbtReader
public StringNbtReader(com.mojang.brigadier.StringReader reader) - Mappings:
Namespace Name Mixin selector official <init>Ltl;<init>(Lcom/mojang/brigadier/StringReader;)Vintermediary <init>Lnet/minecraft/class_2522;<init>(Lcom/mojang/brigadier/StringReader;)Vnamed <init>Lnet/minecraft/nbt/StringNbtReader;<init>(Lcom/mojang/brigadier/StringReader;)V
-
-
Method Details
-
parse
public static NbtCompound parse(String string) throws com.mojang.brigadier.exceptions.CommandSyntaxException Returns the NBT compound parsed from thestring.- Returns:
- the NBT compound parsed from the
string - Throws:
com.mojang.brigadier.exceptions.CommandSyntaxException- if the reader detects a syntax error (including trailing strings)- Mappings:
Namespace Name Mixin selector official aLtl;a(Ljava/lang/String;)Lsn;intermediary method_10718Lnet/minecraft/class_2522;method_10718(Ljava/lang/String;)Lnet/minecraft/class_2487;named parseLnet/minecraft/nbt/StringNbtReader;parse(Ljava/lang/String;)Lnet/minecraft/nbt/NbtCompound;
-
readCompound
- Throws:
com.mojang.brigadier.exceptions.CommandSyntaxException- Mappings:
Namespace Name Mixin selector official aLtl;a()Lsn;intermediary method_10721Lnet/minecraft/class_2522;method_10721()Lnet/minecraft/class_2487;named readCompoundLnet/minecraft/nbt/StringNbtReader;readCompound()Lnet/minecraft/nbt/NbtCompound;
-
readString
- Throws:
com.mojang.brigadier.exceptions.CommandSyntaxException- Mappings:
Namespace Name Mixin selector official bLtl;b()Ljava/lang/String;intermediary method_10725Lnet/minecraft/class_2522;method_10725()Ljava/lang/String;named readStringLnet/minecraft/nbt/StringNbtReader;readString()Ljava/lang/String;
-
parseElementPrimitive
protected NbtElement parseElementPrimitive() throws com.mojang.brigadier.exceptions.CommandSyntaxException- Throws:
com.mojang.brigadier.exceptions.CommandSyntaxException- Mappings:
Namespace Name Mixin selector official cLtl;c()Ltk;intermediary method_10722Lnet/minecraft/class_2522;method_10722()Lnet/minecraft/class_2520;named parseElementPrimitiveLnet/minecraft/nbt/StringNbtReader;parseElementPrimitive()Lnet/minecraft/nbt/NbtElement;
-
parsePrimitive
- Mappings:
Namespace Name Mixin selector official bLtl;b(Ljava/lang/String;)Ltk;intermediary method_10731Lnet/minecraft/class_2522;method_10731(Ljava/lang/String;)Lnet/minecraft/class_2520;named parsePrimitiveLnet/minecraft/nbt/StringNbtReader;parsePrimitive(Ljava/lang/String;)Lnet/minecraft/nbt/NbtElement;
-
parseElement
Returns the parsed NBT element.- Returns:
- the parsed NBT element
- Throws:
com.mojang.brigadier.exceptions.CommandSyntaxException- if the reader detects a syntax error- Mappings:
Namespace Name Mixin selector official dLtl;d()Ltk;intermediary method_10723Lnet/minecraft/class_2522;method_10723()Lnet/minecraft/class_2520;named parseElementLnet/minecraft/nbt/StringNbtReader;parseElement()Lnet/minecraft/nbt/NbtElement;
-
parseArray
- Throws:
com.mojang.brigadier.exceptions.CommandSyntaxException- Mappings:
Namespace Name Mixin selector official eLtl;e()Ltk;intermediary method_10717Lnet/minecraft/class_2522;method_10717()Lnet/minecraft/class_2520;named parseArrayLnet/minecraft/nbt/StringNbtReader;parseArray()Lnet/minecraft/nbt/NbtElement;
-
parseCompound
Returns the parsed NBT compound.- Returns:
- the parsed NBT compound
- Throws:
com.mojang.brigadier.exceptions.CommandSyntaxException- if the reader detects a syntax error- Mappings:
Namespace Name Mixin selector official fLtl;f()Lsn;intermediary method_10727Lnet/minecraft/class_2522;method_10727()Lnet/minecraft/class_2487;named parseCompoundLnet/minecraft/nbt/StringNbtReader;parseCompound()Lnet/minecraft/nbt/NbtCompound;
-
parseList
- Throws:
com.mojang.brigadier.exceptions.CommandSyntaxException- Mappings:
Namespace Name Mixin selector official gLtl;g()Ltk;intermediary method_10729Lnet/minecraft/class_2522;method_10729()Lnet/minecraft/class_2520;named parseListLnet/minecraft/nbt/StringNbtReader;parseList()Lnet/minecraft/nbt/NbtElement;
-
parseElementPrimitiveArray
private NbtElement parseElementPrimitiveArray() throws com.mojang.brigadier.exceptions.CommandSyntaxException- Throws:
com.mojang.brigadier.exceptions.CommandSyntaxException- Mappings:
Namespace Name Mixin selector official hLtl;h()Ltk;intermediary method_10726Lnet/minecraft/class_2522;method_10726()Lnet/minecraft/class_2520;named parseElementPrimitiveArrayLnet/minecraft/nbt/StringNbtReader;parseElementPrimitiveArray()Lnet/minecraft/nbt/NbtElement;
-
readArray
private <T extends Number> List<T> readArray(NbtType<?> arrayTypeReader, NbtType<?> typeReader) throws com.mojang.brigadier.exceptions.CommandSyntaxException - Throws:
com.mojang.brigadier.exceptions.CommandSyntaxException- Mappings:
Namespace Name Mixin selector official aLtl;a(Ltm;Ltm;)Ljava/util/List;intermediary method_10728Lnet/minecraft/class_2522;method_10728(Lnet/minecraft/class_4614;Lnet/minecraft/class_4614;)Ljava/util/List;named readArrayLnet/minecraft/nbt/StringNbtReader;readArray(Lnet/minecraft/nbt/NbtType;Lnet/minecraft/nbt/NbtType;)Ljava/util/List;
-
readComma
private boolean readComma()- Mappings:
Namespace Name Mixin selector official iLtl;i()Zintermediary method_10716Lnet/minecraft/class_2522;method_10716()Znamed readCommaLnet/minecraft/nbt/StringNbtReader;readComma()Z
-
expect
private void expect(char c) throws com.mojang.brigadier.exceptions.CommandSyntaxException - Throws:
com.mojang.brigadier.exceptions.CommandSyntaxException- Mappings:
Namespace Name Mixin selector official aLtl;a(C)Vintermediary method_10719Lnet/minecraft/class_2522;method_10719(C)Vnamed expectLnet/minecraft/nbt/StringNbtReader;expect(C)V
-