SteamWar/BauSystem2.0
Archiviert
12
0

QOL #203

Zusammengeführt
YoyoNow hat 44 Commits von QOL nach master 2023-10-06 14:59:48 +02:00 zusammengeführt
Nur Änderungen aus Commit 910762126f werden angezeigt - Alle Commits anzeigen

Datei anzeigen

@ -59,7 +59,7 @@ public class EventListener implements Listener {
Bukkit.getScheduler().runTaskTimer(BauSystem.getInstance(), () -> { Bukkit.getScheduler().runTaskTimer(BauSystem.getInstance(), () -> {
long millis = System.currentTimeMillis(); long millis = System.currentTimeMillis();
LAST_FS.entrySet().removeIf(entry -> millis - entry.getValue() > 200); LAST_FS.entrySet().removeIf(entry -> millis - entry.getValue() > 200);
}, 2, 2); }, 1, 1);
} }
@EventHandler(priority = EventPriority.MONITOR) @EventHandler(priority = EventPriority.MONITOR)
@ -76,7 +76,9 @@ public class EventListener implements Listener {
@EventHandler(priority = EventPriority.HIGH) @EventHandler(priority = EventPriority.HIGH)
public void onPlayerSwapHandItems(PlayerSwapHandItemsEvent event) { public void onPlayerSwapHandItems(PlayerSwapHandItemsEvent event) {
if (LAST_FS.containsKey(event.getPlayer())) { if (LAST_FS.containsKey(event.getPlayer())) {
Bukkit.getScheduler().runTaskLater(BauSystem.getInstance(), () -> {
ScriptRunner.callEvent(event.getPlayer(), SteamWarGlobalLuaPlugin.EventType.DoubleSwap, LuaValue.NIL, event); ScriptRunner.callEvent(event.getPlayer(), SteamWarGlobalLuaPlugin.EventType.DoubleSwap, LuaValue.NIL, event);
}, 1);
} else { } else {
LAST_FS.put(event.getPlayer(), System.currentTimeMillis()); LAST_FS.put(event.getPlayer(), System.currentTimeMillis());
} }