Class NbtAccounter

java.lang.Object
net.minecraft.nbt.NbtAccounter

public class NbtAccounter extends Object
  • Field Details

    • DEFAULT_NBT_QUOTA

      public static final int DEFAULT_NBT_QUOTA
      See Also:
    • UNCOMPRESSED_NBT_QUOTA

      public static final int UNCOMPRESSED_NBT_QUOTA
      See Also:
    • MAX_STACK_DEPTH

      private static final int MAX_STACK_DEPTH
      See Also:
    • quota

      private final long quota
    • usage

      private long usage
    • maxDepth

      private final int maxDepth
    • depth

      private int depth
  • Constructor Details

    • NbtAccounter

      public NbtAccounter(long pQuota, int pMaxDepth)
  • Method Details

    • create

      public static NbtAccounter create(long pQuota)
    • defaultQuota

      public static NbtAccounter defaultQuota()
    • uncompressedQuota

      public static NbtAccounter uncompressedQuota()
    • unlimitedHeap

      public static NbtAccounter unlimitedHeap()
    • accountBytes

      public void accountBytes(long pBytesPerItem, long pItems)
    • accountBytes

      public void accountBytes(long pBytes)
      Adds the bytes to the current number of read bytes. If the number of bytes is greater than the stored quota, an exception will occur.
      Throws:
      RuntimeException - if the number of usage bytes exceed the number of quota bytes
    • pushDepth

      public void pushDepth()
    • popDepth

      public void popDepth()
    • readUTF

      public String readUTF(String data)
    • getUsage

      public long getUsage()
    • getDepth

      public int getDepth()