Code/net/minecraft/util/TickThrottler.java

26 lines
572 B
Java
Raw Permalink Normal View History

2025-07-01 06:20:03 +00:00
package net.minecraft.util;
public class TickThrottler {
private final int incrementStep;
private final int threshold;
private int count;
public TickThrottler(int p_365995_, int p_367862_) {
this.incrementStep = p_365995_;
this.threshold = p_367862_;
}
public void increment() {
this.count = this.count + this.incrementStep;
}
public void tick() {
if (this.count > 0) {
this.count--;
}
}
public boolean isUnderThreshold() {
return this.count < this.threshold;
}
}