mirror of
https://github.com/sekwah41/Advanced-Portals.git
synced 2025-02-04 22:41:37 +01:00
Update Listeners.java
This commit is contained in:
parent
1cba807351
commit
77096a931c
@ -89,7 +89,20 @@ public class Listeners implements Listener {
|
||||
|
||||
@EventHandler
|
||||
public void onJoinEvent(PlayerJoinEvent event) {
|
||||
Portal.joinCooldown.put(event.getPlayer().getName(), System.currentTimeMillis());
|
||||
Player player = event.getPlayer();
|
||||
|
||||
Portal.joinCooldown.put(player.getName(), System.currentTimeMillis());
|
||||
|
||||
String uuid = player.getUniqueId().toString();
|
||||
|
||||
if (plugin.PlayerDestiMap.containsKey(uuid)) {
|
||||
plugin.getServer().getScheduler().scheduleSyncDelayedTask(plugin, () -> {
|
||||
Destination.warp(player, plugin.PlayerDestiMap.get(uuid), false, true);
|
||||
plugin.PlayerDestiMap.remove(uuid);
|
||||
|
||||
}, 1L);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@EventHandler(priority = EventPriority.HIGHEST, ignoreCancelled = true)
|
||||
|
Loading…
Reference in New Issue
Block a user