mirror of
https://github.com/sekwah41/Advanced-Portals.git
synced 2024-11-25 12:06:17 +01:00
Changed for better support for paperspigot
This commit is contained in:
parent
d84ec0bd3e
commit
d104da907f
@ -54,7 +54,6 @@ public class AdvancedPortalsCommand implements CommandExecutor, TabCompleter {
|
||||
@SuppressWarnings("deprecation")
|
||||
@Override
|
||||
public boolean onCommand(CommandSender sender, Command cmd, String command, String[] args) {
|
||||
// System.out.printf("%s %s %s %s%n", sender, cmd, command, args );
|
||||
ConfigAccessor config = new ConfigAccessor(plugin, "config.yml");
|
||||
ConfigAccessor portalConfig = new ConfigAccessor(plugin, "portals.yml");
|
||||
if (!(sender instanceof Player)) {
|
||||
|
@ -95,14 +95,10 @@ public class Listeners implements Listener {
|
||||
|
||||
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);
|
||||
|
||||
}*/
|
||||
if (plugin.PlayerDestiMap.containsKey(uuid)) {
|
||||
Destination.warp(player, plugin.PlayerDestiMap.get(uuid), false, true);
|
||||
plugin.PlayerDestiMap.remove(uuid);
|
||||
}
|
||||
}
|
||||
|
||||
@EventHandler(priority = EventPriority.HIGHEST, ignoreCancelled = true)
|
||||
|
@ -35,23 +35,18 @@ public class PluginMessageReceiver implements PluginMessageListener {
|
||||
|
||||
Player targetPlayer = this.plugin.getServer().getPlayer(UUID.fromString(bungeeUUID));
|
||||
|
||||
|
||||
Player finalTargetPlayer = targetPlayer;
|
||||
Destination.warp(finalTargetPlayer, targetDestination, false, true);
|
||||
|
||||
/*if (targetPlayer != null) {
|
||||
Player finalTargetPlayer = targetPlayer;
|
||||
Destination.warp(finalTargetPlayer, targetDestination, false, true);
|
||||
if (targetPlayer != null) {
|
||||
Destination.warp(targetPlayer, targetDestination, false, true);
|
||||
|
||||
}
|
||||
else {
|
||||
plugin.PlayerDestiMap.put(bungeeUUID, targetDestination);
|
||||
|
||||
plugin.getServer().getScheduler().scheduleSyncDelayedTask(plugin, () ->
|
||||
plugin.PlayerDestiMap.remove(bungeeUUID),
|
||||
20L*10
|
||||
plugin.PlayerDestiMap.remove(bungeeUUID),
|
||||
20L * 10
|
||||
);
|
||||
}*/
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user