This commit is contained in:
HaHaWTH 2023-11-19 12:04:46 +08:00
parent fcec8e41a2
commit 22b8b6bf64

View File

@ -5,22 +5,6 @@ import org.bukkit.entity.Player;
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
//
//public class TeleportUtils {
// public static void teleport(Player player, Location location) {
// try {
// Class<?> paperClass = Class.forName("com.destroystokyo.paper.PaperConfig");
// // Paper API is loaded, use teleportAsync
// Method teleportAsyncMethod = player.getClass().getMethod("teleportAsync", Location.class);
// teleportAsyncMethod.setAccessible(true);
// teleportAsyncMethod.invoke(player, location);
// } catch (ClassNotFoundException | InvocationTargetException | NoSuchMethodException | IllegalAccessException e) {
// // Paper API is not loaded, use normal teleport
// player.teleport(location);
// }
// }
//}
public class TeleportUtils {
private static Method teleportAsyncMethod;