Package net.minecraft.nbt
Class NbtSizeTracker
java.lang.Object
net.minecraft.nbt.NbtSizeTracker
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 official swintermediary net/minecraft/class_2505named net/minecraft/nbt/NbtSizeTracker
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate longprivate static final intprivate intprivate final longprivate final int -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidadd(long bytes) voidadd(long multiplier, long bytes) longintgetDepth()static NbtSizeTrackerof(long maxBytes) static NbtSizeTrackervoidpopStack()void
-
Field Details
-
DEFAULT_MAX_DEPTH
private static final int DEFAULT_MAX_DEPTH- See Also:
- Mappings:
Namespace Name Mixin selector official aLsw;a:Iintermediary field_46208Lnet/minecraft/class_2505;field_46208:Inamed DEFAULT_MAX_DEPTHLnet/minecraft/nbt/NbtSizeTracker;DEFAULT_MAX_DEPTH:I
-
maxBytes
private final long maxBytes- Mappings:
Namespace Name Mixin selector official bLsw;b:Jintermediary field_11557Lnet/minecraft/class_2505;field_11557:Jnamed maxBytesLnet/minecraft/nbt/NbtSizeTracker;maxBytes:J
-
allocatedBytes
private long allocatedBytes- Mappings:
Namespace Name Mixin selector official cLsw;c:Jintermediary field_11555Lnet/minecraft/class_2505;field_11555:Jnamed allocatedBytesLnet/minecraft/nbt/NbtSizeTracker;allocatedBytes:J
-
maxDepth
private final int maxDepth- Mappings:
Namespace Name Mixin selector official dLsw;d:Iintermediary field_46209Lnet/minecraft/class_2505;field_46209:Inamed maxDepthLnet/minecraft/nbt/NbtSizeTracker;maxDepth:I
-
depth
private int depth- Mappings:
Namespace Name Mixin selector official eLsw;e:Iintermediary field_46210Lnet/minecraft/class_2505;field_46210:Inamed depthLnet/minecraft/nbt/NbtSizeTracker;depth:I
-
-
Constructor Details
-
NbtSizeTracker
public NbtSizeTracker(long maxBytes, int maxDepth) - Mappings:
Namespace Name Mixin selector official <init>Lsw;<init>(JI)Vintermediary <init>Lnet/minecraft/class_2505;<init>(JI)Vnamed <init>Lnet/minecraft/nbt/NbtSizeTracker;<init>(JI)V
-
-
Method Details
-
of
- Mappings:
Namespace Name Mixin selector official aLsw;a(J)Lsw;intermediary method_53899Lnet/minecraft/class_2505;method_53899(J)Lnet/minecraft/class_2505;named ofLnet/minecraft/nbt/NbtSizeTracker;of(J)Lnet/minecraft/nbt/NbtSizeTracker;
-
ofUnlimitedBytes
- Mappings:
Namespace Name Mixin selector official aLsw;a()Lsw;intermediary method_53898Lnet/minecraft/class_2505;method_53898()Lnet/minecraft/class_2505;named ofUnlimitedBytesLnet/minecraft/nbt/NbtSizeTracker;ofUnlimitedBytes()Lnet/minecraft/nbt/NbtSizeTracker;
-
add
public void add(long multiplier, long bytes) - Mappings:
Namespace Name Mixin selector official aLsw;a(JJ)Vintermediary method_53908Lnet/minecraft/class_2505;method_53908(JJ)Vnamed addLnet/minecraft/nbt/NbtSizeTracker;add(JJ)V
-
add
public void add(long bytes) - Mappings:
Namespace Name Mixin selector official bLsw;b(J)Vintermediary method_48004Lnet/minecraft/class_2505;method_48004(J)Vnamed addLnet/minecraft/nbt/NbtSizeTracker;add(J)V
-
pushStack
public void pushStack()- Mappings:
Namespace Name Mixin selector official bLsw;b()Vintermediary method_53900Lnet/minecraft/class_2505;method_53900()Vnamed pushStackLnet/minecraft/nbt/NbtSizeTracker;pushStack()V
-
popStack
public void popStack()- Mappings:
Namespace Name Mixin selector official cLsw;c()Vintermediary method_53901Lnet/minecraft/class_2505;method_53901()Vnamed popStackLnet/minecraft/nbt/NbtSizeTracker;popStack()V
-
getAllocatedBytes
public long getAllocatedBytes()- Mappings:
Namespace Name Mixin selector official dLsw;d()Jintermediary method_47987Lnet/minecraft/class_2505;method_47987()Jnamed getAllocatedBytesLnet/minecraft/nbt/NbtSizeTracker;getAllocatedBytes()J
-
getDepth
public int getDepth()- Mappings:
Namespace Name Mixin selector official eLsw;e()Iintermediary method_53902Lnet/minecraft/class_2505;method_53902()Inamed getDepthLnet/minecraft/nbt/NbtSizeTracker;getDepth()I
-