Update TPSLimitCommand
Signed-off-by: yoyosource <yoyosource@nidido.de>
Dieser Commit ist enthalten in:
Ursprung
2b4c310179
Commit
909c21415d
@ -72,7 +72,7 @@ public class TPSLimitCommand extends SWCommand implements Enable {
|
||||
}
|
||||
|
||||
@Register
|
||||
public void valueCommand(Player p, double tpsLimitDouble) {
|
||||
public void valueCommand(Player p, /*@DoubleRange(min = 0.5, max = 60)*/ double tpsLimitDouble) {
|
||||
if (!permissionCheck(p)) return;
|
||||
if (tpsLimitDouble < 0.5 || tpsLimitDouble > (TPSWarpUtils.isWarpAllowed() ? 60 : 20)) {
|
||||
sendInvalidArgumentMessage(p);
|
||||
|
@ -38,6 +38,7 @@ public class TPSLimitUtils {
|
||||
private BukkitTask tpsLimiter = null;
|
||||
|
||||
void tpsLimiter() {
|
||||
if (tpsLimiter != null) tpsLimiter.cancel();
|
||||
double delay = 20 / currentTPSLimit;
|
||||
int loops = (int) Math.ceil(delay);
|
||||
long sleepDelay = (long) (50 * delay) / loops;
|
||||
@ -48,7 +49,6 @@ public class TPSLimitUtils {
|
||||
tpsLimiter.cancel();
|
||||
tpsLimiter = null;
|
||||
} else {
|
||||
if (tpsLimiter != null) return;
|
||||
tpsLimiter = Bukkit.getScheduler().runTaskTimer(BauSystem.getInstance(), () -> {
|
||||
VersionedRunnable.call(new VersionedRunnable(() -> TPSLimit_15.createTickCache(WORLD), 15));
|
||||
|
||||
|
In neuem Issue referenzieren
Einen Benutzer sperren