All Downloads are FREE. Search and download functionalities are using the official Maven repository.

net.minecraft.server.NBTReadLimiter Maven / Gradle / Ivy

There is a newer version: 2.4.0
Show newest version
package net.minecraft.server;

public class NBTReadLimiter {

  public static final NBTReadLimiter a = new NBTReadLimiter(0L) {
    public void a(long i) {
    }
  };
  private final long b;
  private long c;

  public NBTReadLimiter(long i) {
    this.b = i;
  }

  public void a(long i) {
    this.c += i / 8L;
    if (this.c > this.b) {
      throw new RuntimeException("Tried to read NBT tag that was too big; tried to allocate: " + this.c + "bytes where max allowed: " + this.b);
    }
  }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy