SteamWar/BauSystem2.0
Archiviert
12
0

Update TPSLimitCommand

Signed-off-by: yoyosource <yoyosource@nidido.de>
Dieser Commit ist enthalten in:
yoyosource 2021-07-09 20:17:36 +02:00
Ursprung 2b4c310179
Commit 909c21415d
2 geänderte Dateien mit 2 neuen und 2 gelöschten Zeilen

Datei anzeigen

@ -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);

Datei anzeigen

@ -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));