blob: 0a5fc3e7077a5ce45e6cbb50c4df94a969cf3b60 [file] [log] [blame] [raw]
package net.querz.io;
public interface MaxDepthIO {
default int decrementMaxDepth(int maxDepth) {
if (maxDepth < 0) {
throw new IllegalArgumentException("negative maximum depth is not allowed");
} else if (maxDepth == 0) {
throw new MaxDepthReachedException("reached maximum depth of NBT structure");
}
return --maxDepth;
}
}