Changed for better support for paperspigot

This commit is contained in:
Sekwah 2020-09-23 10:06:05 +01:00
parent d84ec0bd3e
commit d104da907f
No known key found for this signature in database
GPG Key ID: C3BE2E6C861A461A
3 changed files with 9 additions and 19 deletions

View File

@ -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)) {

View File

@ -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)

View File

@ -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
);
}*/
}
}
}