修复了 back 逻辑可能存在错误的问题
Some checks failed
Java CI-CD with Maven / build (push) Has been cancelled

This commit is contained in:
zhangyuheng 2024-05-12 00:06:42 +08:00
parent c4e22963d6
commit b828ef1f7a
2 changed files with 3 additions and 4 deletions

View File

@ -6,7 +6,7 @@
<groupId>cn.lunadeer</groupId>
<artifactId>EssentialsD</artifactId>
<version>1.18.11</version>
<version>1.18.12</version>
<packaging>jar</packaging>
<name>EssentialsD</name>

View File

@ -151,16 +151,15 @@ public class TeleportManager {
/**
* 把玩家传送到指定位置 并更新上次传送的位置
* 需要使用 schedule 传送
*
* @param player 玩家
* @param location 位置
*/
private void doTeleportSafely(Player player, Location location) {
public void doTeleportSafely(Player player, Location location) {
location.getWorld().getChunkAtAsyncUrgently(location).thenAccept((chunk) -> {
updateLastTpLocation(player);
location.setY(chunk.getWorld().getHighestBlockYAt(location) + 1);
player.teleportAsync(location, PlayerTeleportEvent.TeleportCause.PLUGIN);
_last_tp_location.put(player.getUniqueId(), location);
});
}