Update NMS + Use PaperLib for teleportAsync

This commit is contained in:
2020-08-30 19:13:46 -05:00
parent c61f7e78fd
commit 43b266f17d
17 changed files with 57 additions and 41 deletions

View File

@ -1,5 +1,6 @@
package me.totalfreedom.totalfreedommod.world;
import io.papermc.lib.PaperLib;
import lombok.Getter;
import me.totalfreedom.totalfreedommod.FreedomService;
import me.totalfreedom.totalfreedommod.util.FLog;
@ -49,7 +50,7 @@ public abstract class CustomWorld extends FreedomService
{
try
{
player.teleport(getWorld().getSpawnLocation());
PaperLib.teleportAsync(player, getWorld().getSpawnLocation());
}
catch (Exception ex)
{

View File

@ -1,5 +1,6 @@
package me.totalfreedom.totalfreedommod.world;
import io.papermc.lib.PaperLib;
import me.totalfreedom.totalfreedommod.FreedomService;
import me.totalfreedom.totalfreedommod.config.ConfigEntry;
import me.totalfreedom.totalfreedommod.util.FUtil;
@ -127,7 +128,7 @@ public class WorldManager extends FreedomService
if (player.getWorld().getName().equalsIgnoreCase(targetWorld))
{
playerMsg(player, "Going to main world.", ChatColor.GRAY);
player.teleport(Bukkit.getWorlds().get(0).getSpawnLocation());
PaperLib.teleportAsync(player, Bukkit.getWorlds().get(0).getSpawnLocation());
return;
}
@ -136,12 +137,11 @@ public class WorldManager extends FreedomService
if (world.getName().equalsIgnoreCase(targetWorld))
{
playerMsg(player, "Going to world: " + targetWorld, ChatColor.GRAY);
player.teleport(world.getSpawnLocation());
PaperLib.teleportAsync(player, world.getSpawnLocation());
return;
}
}
playerMsg(player, "World " + targetWorld + " not found.", ChatColor.GRAY);
}
}