Record Class NbtTreeNode

java.lang.Object
java.lang.Record
net.minecraft.nbt.scanner.NbtTreeNode
Record Components:
depth - the depth of the node, starting from 1
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 Details

  • 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

      public NbtTreeNode(int int2, Map<String,NbtType<?>> map, Map<String,NbtTreeNode> map2)
  • Method Details

    • createRoot

      public static NbtTreeNode 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

      public void add(NbtScanQuery query)
      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

      public boolean isTypeEqual(NbtType<?> type, String key)
      Returns whether the queried type for the key key matches type.
      Returns:
      whether the queried type for the key key matches type
      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

      public final String 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.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • 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.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object object)
      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 with Objects::equals(Object,Object); primitive components are compared with '=='.
      Specified by:
      equals in class Record
      Parameters:
      object - the object with which to compare
      Returns:
      true if this object is the same as the object argument; false otherwise.
    • depth

      public int depth()
      Returns the value of the depth record component.
      Returns:
      the value of the depth record component
    • selectedFields

      public Map<String,NbtType<?>> selectedFields()
      Returns the value of the selectedFields record component.
      Returns:
      the value of the selectedFields record component
    • fieldsToRecurse

      public Map<String,NbtTreeNode> fieldsToRecurse()
      Returns the value of the fieldsToRecurse record component.
      Returns:
      the value of the fieldsToRecurse record component