mirror of
https://github.com/sekwah41/Advanced-Portals.git
synced 2024-09-27 14:52:59 +02:00
Update Listeners.java
This commit is contained in:
parent
1cba807351
commit
77096a931c
@ -89,7 +89,20 @@ public class Listeners implements Listener {
|
|||||||
|
|
||||||
@EventHandler
|
@EventHandler
|
||||||
public void onJoinEvent(PlayerJoinEvent event) {
|
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)
|
@EventHandler(priority = EventPriority.HIGHEST, ignoreCancelled = true)
|
||||||
|
Loading…
Reference in New Issue
Block a user