Package net.minecraft.nbt.scanner
Record Class NbtTreeNode
java.lang.Object
java.lang.Record
net.minecraft.nbt.scanner.NbtTreeNode
- Record Components:
depth
- the depth of the node, starting from1
selectedFields
- the keys to select ("leaves")fieldsToRecurse
- The keys to check recursively ("branches")
public record NbtTreeNode(int depth, Map<String,NbtType<?>> selectedFields, Map<String,NbtTreeNode> fieldsToRecurse)
extends Record
The tree node for representing NBT.
- Mappings:
Namespace Name named net/minecraft/nbt/scanner/NbtTreeNode
intermediary net/minecraft/class_6842
official vh
named depth
intermediary comp_315
official a
named selectedFields
intermediary comp_323
official b
named fieldsToRecurse
intermediary comp_317
official c
-
Field Summary
Modifier and TypeFieldDescriptionprivate final int
The field for thedepth
record component.private final Map
<String, NbtTreeNode> The field for thefieldsToRecurse
record component.The field for theselectedFields
record component. -
Constructor Summary
ModifierConstructorDescriptionprivate
NbtTreeNode
(int depth) NbtTreeNode
(int int2, Map<String, NbtType<?>> map, Map<String, NbtTreeNode> map2) -
Method Summary
Modifier and TypeMethodDescriptionvoid
add
(NbtScanQuery query) static NbtTreeNode
Returns the root node.int
depth()
Returns the value of thedepth
record component.final boolean
Indicates whether some other object is "equal to" this one.Returns the value of thefieldsToRecurse
record component.final int
hashCode()
Returns a hash code value for this object.boolean
isTypeEqual
(NbtType<?> type, String key) Returns whether the queried type for the keykey
matchestype
.Returns the value of theselectedFields
record component.final String
toString()
Returns a string representation of this record class.
-
Field Details
-
depth
private final int depthThe field for thedepth
record component. -
selectedFields
The field for theselectedFields
record component. -
fieldsToRecurse
The field for thefieldsToRecurse
record component.
-
-
Constructor Details
-
NbtTreeNode
private NbtTreeNode(int depth) - Mappings:
Namespace Name Mixin selector named <init>
Lnet/minecraft/nbt/scanner/NbtTreeNode;<init>(I)V
intermediary <init>
Lnet/minecraft/class_6842;<init>(I)V
official <init>
Lvh;<init>(I)V
-
NbtTreeNode
-
-
Method Details
-
createRoot
Returns the root node.- Returns:
- the root node
- Implementation Note:
- The root node has the depth of
1
. - Mappings:
Namespace Name Mixin selector named createRoot
Lnet/minecraft/nbt/scanner/NbtTreeNode;createRoot()Lnet/minecraft/nbt/scanner/NbtTreeNode;
intermediary method_40060
Lnet/minecraft/class_6842;method_40060()Lnet/minecraft/class_6842;
official a
Lvh;a()Lvh;
-
add
- Mappings:
Namespace Name Mixin selector named add
Lnet/minecraft/nbt/scanner/NbtTreeNode;add(Lnet/minecraft/nbt/scanner/NbtScanQuery;)V
intermediary method_39881
Lnet/minecraft/class_6842;method_39881(Lnet/minecraft/class_6843;)V
official a
Lvh;a(Lvg;)V
-
isTypeEqual
Returns whether the queried type for the keykey
matchestype
.- Returns:
- whether the queried type for the key
key
matchestype
- Mappings:
Namespace Name Mixin selector named isTypeEqual
Lnet/minecraft/nbt/scanner/NbtTreeNode;isTypeEqual(Lnet/minecraft/nbt/NbtType;Ljava/lang/String;)Z
intermediary method_40061
Lnet/minecraft/class_6842;method_40061(Lnet/minecraft/class_4614;Ljava/lang/String;)Z
official a
Lvh;a(Luz;Ljava/lang/String;)Z
-
toString
Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components. -
hashCode
public final int hashCode()Returns a hash code value for this object. The value is derived from the hash code of each of the record components. -
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. Reference components are compared withObjects::equals(Object,Object)
; primitive components are compared with '=='. -
depth
public int depth()Returns the value of thedepth
record component.- Returns:
- the value of the
depth
record component
-
selectedFields
Returns the value of theselectedFields
record component.- Returns:
- the value of the
selectedFields
record component
-
fieldsToRecurse
Returns the value of thefieldsToRecurse
record component.- Returns:
- the value of the
fieldsToRecurse
record component
-