SteamWar/BauSystem2.0
Archiviert
12
0

Fix DoubleF for Script System on higher TPS
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful

Signed-off-by: yoyosource <yoyosource@nidido.de>
Dieser Commit ist enthalten in:
yoyosource 2023-09-24 15:36:10 +02:00
Ursprung 06cc2bb35b
Commit cbe41f7e7f

Datei anzeigen

@ -57,7 +57,8 @@ public class EventListener implements Listener {
static { static {
Bukkit.getScheduler().runTaskTimer(BauSystem.getInstance(), () -> { Bukkit.getScheduler().runTaskTimer(BauSystem.getInstance(), () -> {
LAST_FS.entrySet().removeIf(entry -> TPSUtils.currentTick.get() - entry.getValue() > 4); long millis = System.currentTimeMillis();
LAST_FS.entrySet().removeIf(entry -> millis - entry.getValue() > 200);
}, 2, 2); }, 2, 2);
} }
@ -77,7 +78,7 @@ public class EventListener implements Listener {
if (LAST_FS.containsKey(event.getPlayer())) { if (LAST_FS.containsKey(event.getPlayer())) {
ScriptRunner.callEvent(event.getPlayer(), SteamWarGlobalLuaPlugin.EventType.DoubleSwap, LuaValue.NIL, event); ScriptRunner.callEvent(event.getPlayer(), SteamWarGlobalLuaPlugin.EventType.DoubleSwap, LuaValue.NIL, event);
} else { } else {
LAST_FS.put(event.getPlayer(), TPSUtils.currentTick.get()); LAST_FS.put(event.getPlayer(), System.currentTimeMillis());
} }
} }