Class NbtSizeTracker

java.lang.Object
net.minecraft.nbt.NbtSizeTracker

public class NbtSizeTracker extends Object
Tracks the size of NBT elements in bytes and in depth. Throws NbtSizeValidationException if the tracked element becomes larger than maxBytes or if the depth exceeds maxDepth during addition.
Mappings:
Namespace Name
named net/minecraft/nbt/NbtSizeTracker
intermediary net/minecraft/class_2505
official vg
  • Field Details

    • DEFAULT_MAX_DEPTH

      private static final int DEFAULT_MAX_DEPTH
      See Also:
      Mappings:
      Namespace Name Mixin selector
      named DEFAULT_MAX_DEPTH Lnet/minecraft/nbt/NbtSizeTracker;DEFAULT_MAX_DEPTH:I
      intermediary field_46208 Lnet/minecraft/class_2505;field_46208:I
      official a Lvg;a:I
    • maxBytes

      private final long maxBytes
      Mappings:
      Namespace Name Mixin selector
      named maxBytes Lnet/minecraft/nbt/NbtSizeTracker;maxBytes:J
      intermediary field_11557 Lnet/minecraft/class_2505;field_11557:J
      official b Lvg;b:J
    • allocatedBytes

      private long allocatedBytes
      Mappings:
      Namespace Name Mixin selector
      named allocatedBytes Lnet/minecraft/nbt/NbtSizeTracker;allocatedBytes:J
      intermediary field_11555 Lnet/minecraft/class_2505;field_11555:J
      official c Lvg;c:J
    • maxDepth

      private final int maxDepth
      Mappings:
      Namespace Name Mixin selector
      named maxDepth Lnet/minecraft/nbt/NbtSizeTracker;maxDepth:I
      intermediary field_46209 Lnet/minecraft/class_2505;field_46209:I
      official d Lvg;d:I
    • depth

      private int depth
      Mappings:
      Namespace Name Mixin selector
      named depth Lnet/minecraft/nbt/NbtSizeTracker;depth:I
      intermediary field_46210 Lnet/minecraft/class_2505;field_46210:I
      official e Lvg;e:I
  • Constructor Details

    • NbtSizeTracker

      public NbtSizeTracker(long maxBytes, int maxDepth)
      Mappings:
      Namespace Name Mixin selector
      named <init> Lnet/minecraft/nbt/NbtSizeTracker;<init>(JI)V
      intermediary <init> Lnet/minecraft/class_2505;<init>(JI)V
      official <init> Lvg;<init>(JI)V
  • Method Details

    • of

      public static NbtSizeTracker of(long maxBytes)
      Mappings:
      Namespace Name Mixin selector
      named of Lnet/minecraft/nbt/NbtSizeTracker;of(J)Lnet/minecraft/nbt/NbtSizeTracker;
      intermediary method_53899 Lnet/minecraft/class_2505;method_53899(J)Lnet/minecraft/class_2505;
      official a Lvg;a(J)Lvg;
    • ofUnlimitedBytes

      public static NbtSizeTracker ofUnlimitedBytes()
      Mappings:
      Namespace Name Mixin selector
      named ofUnlimitedBytes Lnet/minecraft/nbt/NbtSizeTracker;ofUnlimitedBytes()Lnet/minecraft/nbt/NbtSizeTracker;
      intermediary method_53898 Lnet/minecraft/class_2505;method_53898()Lnet/minecraft/class_2505;
      official a Lvg;a()Lvg;
    • add

      public void add(long multiplier, long bytes)
      Mappings:
      Namespace Name Mixin selector
      named add Lnet/minecraft/nbt/NbtSizeTracker;add(JJ)V
      intermediary method_53908 Lnet/minecraft/class_2505;method_53908(JJ)V
      official a Lvg;a(JJ)V
    • add

      public void add(long bytes)
      Mappings:
      Namespace Name Mixin selector
      named add Lnet/minecraft/nbt/NbtSizeTracker;add(J)V
      intermediary method_48004 Lnet/minecraft/class_2505;method_48004(J)V
      official b Lvg;b(J)V
    • pushStack

      public void pushStack()
      Mappings:
      Namespace Name Mixin selector
      named pushStack Lnet/minecraft/nbt/NbtSizeTracker;pushStack()V
      intermediary method_53900 Lnet/minecraft/class_2505;method_53900()V
      official b Lvg;b()V
    • popStack

      public void popStack()
      Mappings:
      Namespace Name Mixin selector
      named popStack Lnet/minecraft/nbt/NbtSizeTracker;popStack()V
      intermediary method_53901 Lnet/minecraft/class_2505;method_53901()V
      official c Lvg;c()V
    • getAllocatedBytes

      public long getAllocatedBytes()
      Mappings:
      Namespace Name Mixin selector
      named getAllocatedBytes Lnet/minecraft/nbt/NbtSizeTracker;getAllocatedBytes()J
      intermediary method_47987 Lnet/minecraft/class_2505;method_47987()J
      official d Lvg;d()J
    • getDepth

      public int getDepth()
      Mappings:
      Namespace Name Mixin selector
      named getDepth Lnet/minecraft/nbt/NbtSizeTracker;getDepth()I
      intermediary method_53902 Lnet/minecraft/class_2505;method_53902()I
      official e Lvg;e()I