Package net.minecraft.nbt
Class NbtString
java.lang.Object
net.minecraft.nbt.NbtString
- All Implemented Interfaces:
NbtElement
Represents an NBT string. Its type is 0x8.
Instances are immutable.
- Mappings:
Namespace Name named net/minecraft/nbt/NbtStringintermediary net/minecraft/class_2519official uw
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static final charprivate static final charprivate static final NbtStringprivate static final charprivate static final charprivate static final intprivate final StringFields inherited from interface net.minecraft.nbt.NbtElement
BYTE_ARRAY_TYPE, BYTE_TYPE, COMPOUND_TYPE, DOUBLE_TYPE, END_TYPE, field_33246, field_33247, field_33248, field_33249, FLOAT_TYPE, INT_ARRAY_TYPE, INT_TYPE, LIST_TYPE, LONG_ARRAY_TYPE, LONG_TYPE, MAX_DEPTH, NUMBER_TYPE, SHORT_TYPE, STRING_TYPE -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaccept(NbtElementVisitor visitor) asString()Returns the NBT's string representation.copy()Returns an NBT element of equal value that won't change with this element.doAccept(NbtScanner visitor) booleanstatic StringReturns the string quoted with quotes and backslashes escaped.Returns the NBT type definition of this NBT element.intbytegetType()Returns the type of this NBT element.inthashCode()static NbtStringReturns the NBT string fromvalue.static voidtoString()voidwrite(DataOutput output) Writes the NBT element tooutput.Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface net.minecraft.nbt.NbtElement
accept
-
Field Details
-
SIZE
private static final int SIZE- See Also:
- Mappings:
Namespace Name Mixin selector named SIZELnet/minecraft/nbt/NbtString;SIZE:Iintermediary field_41729Lnet/minecraft/class_2519;field_41729:Iofficial bLuw;b:I
-
TYPE
- Mappings:
Namespace Name Mixin selector named TYPELnet/minecraft/nbt/NbtString;TYPE:Lnet/minecraft/nbt/NbtType;intermediary field_21045Lnet/minecraft/class_2519;field_21045:Lnet/minecraft/class_4614;official aLuw;a:Lva;
-
EMPTY
- Mappings:
Namespace Name Mixin selector named EMPTYLnet/minecraft/nbt/NbtString;EMPTY:Lnet/minecraft/nbt/NbtString;intermediary field_21046Lnet/minecraft/class_2519;field_21046:Lnet/minecraft/class_2519;official cLuw;c:Luw;
-
DOUBLE_QUOTE
private static final char DOUBLE_QUOTE- See Also:
- Mappings:
Namespace Name Mixin selector named DOUBLE_QUOTELnet/minecraft/nbt/NbtString;DOUBLE_QUOTE:Cintermediary field_33242Lnet/minecraft/class_2519;field_33242:Cofficial wLuw;w:C
-
SINGLE_QUOTE
private static final char SINGLE_QUOTE- See Also:
- Mappings:
Namespace Name Mixin selector named SINGLE_QUOTELnet/minecraft/nbt/NbtString;SINGLE_QUOTE:Cintermediary field_33243Lnet/minecraft/class_2519;field_33243:Cofficial xLuw;x:C
-
BACKSLASH
private static final char BACKSLASH- See Also:
- Mappings:
Namespace Name Mixin selector named BACKSLASHLnet/minecraft/nbt/NbtString;BACKSLASH:Cintermediary field_33244Lnet/minecraft/class_2519;field_33244:Cofficial yLuw;y:C
-
NULL
private static final char NULL- See Also:
- Mappings:
Namespace Name Mixin selector named NULLLnet/minecraft/nbt/NbtString;NULL:Cintermediary field_33245Lnet/minecraft/class_2519;field_33245:Cofficial zLuw;z:C
-
value
- Mappings:
Namespace Name Mixin selector named valueLnet/minecraft/nbt/NbtString;value:Ljava/lang/String;intermediary field_11590Lnet/minecraft/class_2519;field_11590:Ljava/lang/String;official ALuw;A:Ljava/lang/String;
-
-
Constructor Details
-
NbtString
- Mappings:
Namespace Name Mixin selector named <init>Lnet/minecraft/nbt/NbtString;<init>(Ljava/lang/String;)Vintermediary <init>Lnet/minecraft/class_2519;<init>(Ljava/lang/String;)Vofficial <init>Luw;<init>(Ljava/lang/String;)V
-
-
Method Details
-
skip
- Throws:
IOException- Mappings:
Namespace Name Mixin selector named skipLnet/minecraft/nbt/NbtString;skip(Ljava/io/DataInput;)Vintermediary method_39875Lnet/minecraft/class_2519;method_39875(Ljava/io/DataInput;)Vofficial aLuw;a(Ljava/io/DataInput;)V
-
of
Returns the NBT string fromvalue.- Returns:
- the NBT string from
value - Mappings:
Namespace Name Mixin selector named ofLnet/minecraft/nbt/NbtString;of(Ljava/lang/String;)Lnet/minecraft/nbt/NbtString;intermediary method_23256Lnet/minecraft/class_2519;method_23256(Ljava/lang/String;)Lnet/minecraft/class_2519;official aLuw;a(Ljava/lang/String;)Luw;
-
write
Writes the NBT element tooutput.- Specified by:
writein interfaceNbtElement- Throws:
IOException- API Note:
- This is a low-level method for serializing NBT elements; consider using
NbtIo,NbtOps, orPacketByteBuf.writeNbt(net.minecraft.nbt.NbtElement)instead. - Mappings:
Namespace Name Mixin selector named writeLnet/minecraft/nbt/NbtElement;write(Ljava/io/DataOutput;)Vintermediary method_10713Lnet/minecraft/class_2520;method_10713(Ljava/io/DataOutput;)Vofficial aLuy;a(Ljava/io/DataOutput;)V
-
getSizeInBytes
public int getSizeInBytes()- Specified by:
getSizeInBytesin interfaceNbtElement- Mappings:
Namespace Name Mixin selector named getSizeInBytesLnet/minecraft/nbt/NbtElement;getSizeInBytes()Iintermediary method_47988Lnet/minecraft/class_2520;method_47988()Iofficial aLuy;a()I
-
getType
public byte getType()Returns the type of this NBT element.- Specified by:
getTypein interfaceNbtElement- Returns:
- the type of this NBT element
- Mappings:
Namespace Name Mixin selector named getTypeLnet/minecraft/nbt/NbtElement;getType()Bintermediary method_10711Lnet/minecraft/class_2520;method_10711()Bofficial bLuy;b()B
-
getNbtType
Returns the NBT type definition of this NBT element.- Specified by:
getNbtTypein interfaceNbtElement- Returns:
- the NBT type definition of this NBT element
- Mappings:
Namespace Name Mixin selector named getNbtTypeLnet/minecraft/nbt/NbtElement;getNbtType()Lnet/minecraft/nbt/NbtType;intermediary method_23258Lnet/minecraft/class_2520;method_23258()Lnet/minecraft/class_4614;official cLuy;c()Lva;
-
toString
- Specified by:
toStringin interfaceNbtElement- Overrides:
toStringin classObject
-
copy
Description copied from interface:NbtElementReturns an NBT element of equal value that won't change with this element.- Specified by:
copyin interfaceNbtElement- Returns:
- an NBT element of equal value that won't change with this element
- Mappings:
Namespace Name Mixin selector named copyLnet/minecraft/nbt/NbtString;copy()Lnet/minecraft/nbt/NbtString;intermediary method_10705Lnet/minecraft/class_2519;method_10705()Lnet/minecraft/class_2519;official eLuw;e()Luw;
-
equals
-
hashCode
public int hashCode() -
asString
Returns the NBT's string representation.- Specified by:
asStringin interfaceNbtElement- Returns:
- the NBT's string representation
- Implementation Note:
- By default, this returns the same result as
StringNbtWriter.NbtStringwill return its string value instead. - Mappings:
Namespace Name Mixin selector named asStringLnet/minecraft/nbt/NbtElement;asString()Ljava/lang/String;intermediary method_10714Lnet/minecraft/class_2520;method_10714()Ljava/lang/String;official s_Luy;s_()Ljava/lang/String;
-
accept
- Specified by:
acceptin interfaceNbtElement- Mappings:
Namespace Name Mixin selector named acceptLnet/minecraft/nbt/NbtElement;accept(Lnet/minecraft/nbt/visitor/NbtElementVisitor;)Vintermediary method_32289Lnet/minecraft/class_2520;method_32289(Lnet/minecraft/class_5627;)Vofficial aLuy;a(Lvc;)V
-
escape
Returns the string quoted with quotes and backslashes escaped.- Returns:
- the string quoted with quotes and backslashes escaped
- Implementation Note:
- If
valuecontains one of the singlequote or the double quote, it tries to use the other quotes to quote the string. If both appear, then the quote that appeared later will be used to quote the string. If neither of them appears, this uses a double quote. For example, the stringIt's a "Tiny Potato"!will be escaped as"It's a \"Tiny Potato\"!", while the stringIt is a "Tiny Potato"!will be escaped as'It is a "Tiny Potato"!'. - Mappings:
Namespace Name Mixin selector named escapeLnet/minecraft/nbt/NbtString;escape(Ljava/lang/String;)Ljava/lang/String;intermediary method_10706Lnet/minecraft/class_2519;method_10706(Ljava/lang/String;)Ljava/lang/String;official bLuw;b(Ljava/lang/String;)Ljava/lang/String;
-
doAccept
- Specified by:
doAcceptin interfaceNbtElement- Mappings:
Namespace Name Mixin selector named doAcceptLnet/minecraft/nbt/NbtElement;doAccept(Lnet/minecraft/nbt/scanner/NbtScanner;)Lnet/minecraft/nbt/scanner/NbtScanner$Result;intermediary method_39850Lnet/minecraft/class_2520;method_39850(Lnet/minecraft/class_6836;)Lnet/minecraft/class_6836$class_6838;official aLuy;a(Luv;)Luv$b;
-