SteamWar/BauSystem2.0
Archiviert
12
0

Fix Off-Hand Item in Double Swap Hand
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful

Signed-off-by: yoyosource <yoyosource@nidido.de>
Dieser Commit ist enthalten in:
yoyosource 2023-09-26 09:52:54 +02:00
Ursprung 207953cb98
Commit 910762126f

Datei anzeigen

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