Use TeleportUtils
This commit is contained in:
parent
37d327bcb6
commit
9fe91fe22c
@ -2,6 +2,7 @@ package fr.xephi.authme.listener;
|
||||
import fr.xephi.authme.AuthMe;
|
||||
import fr.xephi.authme.api.v3.AuthMeApi;
|
||||
import fr.xephi.authme.settings.properties.SecuritySettings;
|
||||
import fr.xephi.authme.util.TeleportUtils;
|
||||
import org.bukkit.Location;
|
||||
import org.bukkit.Material;
|
||||
import org.bukkit.World;
|
||||
@ -50,7 +51,7 @@ public class LoginLocationFixListener implements Listener {
|
||||
boolean solved = false;
|
||||
for (BlockFace face : faces) {
|
||||
if (JoinBlock.getRelative(face).getType().equals(Material.AIR) && JoinBlock.getRelative(face).getRelative(BlockFace.UP).getType().equals(Material.AIR)) {
|
||||
player.teleport(JoinBlock.getRelative(face).getLocation().add(0.5, 0.1, 0.5));
|
||||
TeleportUtils.teleport(player, JoinBlock.getRelative(face).getLocation().add(0.5, 0.1, 0.5));
|
||||
solved = true;
|
||||
break;
|
||||
}
|
||||
@ -77,12 +78,12 @@ public class LoginLocationFixListener implements Listener {
|
||||
if (JoinBlock.getRelative(BlockFace.DOWN).getType().equals(Material.LAVA)) {
|
||||
JoinBlock.getRelative(BlockFace.DOWN).setType(Material.DIRT);
|
||||
}
|
||||
player.teleport(JoinBlock.getLocation().add(0.5, 0.1, 0.5));
|
||||
TeleportUtils.teleport(player, JoinBlock.getLocation().add(0.5, 0.1, 0.5));
|
||||
player.sendMessage("§a你被埋住了, 坐标已修正, 下次下线之前请小心!");
|
||||
break;
|
||||
}
|
||||
if (i == MaxHeight) {
|
||||
player.teleport(JoinBlock.getLocation().add(0.5, 1.1, 0.5));
|
||||
TeleportUtils.teleport(player, JoinBlock.getLocation().add(0.5, 1.1, 0.5));
|
||||
player.sendMessage("§a你被埋住了, 坐标无法修正, 只好送你去了最高点, 自求多福吧少年~");
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user