3
0
Mirror von https://github.com/IntellectualSites/FastAsyncWorldEdit.git synchronisiert 2024-11-20 09:50:06 +01:00

Fix compass tool

Dieser Commit ist enthalten in:
Phillipp Glanz 2023-04-03 18:39:27 +02:00
Ursprung 9a3f3e7528
Commit ac7bee4f9d
Es konnte kein GPG-Schlüssel zu dieser Signatur gefunden werden

Datei anzeigen

@ -21,6 +21,7 @@ package com.sk89q.worldedit.bukkit;
import com.fastasyncworldedit.core.configuration.Caption;
import com.fastasyncworldedit.core.configuration.Settings;
import com.fastasyncworldedit.core.util.FoliaSupport;
import com.fastasyncworldedit.core.util.TaskManager;
import com.sk89q.util.StringUtil;
import com.sk89q.wepif.VaultResolver;
@ -70,6 +71,7 @@ import java.util.Locale;
import java.util.Map;
import java.util.UUID;
import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.ExecutionException;
public class BukkitPlayer extends AbstractPlayerActor {
@ -240,7 +242,22 @@ public class BukkitPlayer extends AbstractPlayerActor {
}
org.bukkit.World finalWorld = world;
//FAWE end
// TODO async teleport?
if (FoliaSupport.isFolia()) {
return TaskManager.taskManager().syncWith(() -> {
try {
return player.teleportAsync(new Location(
finalWorld,
pos.getX(),
pos.getY(),
pos.getZ(),
yaw,
pitch
)).get();
} catch (InterruptedException | ExecutionException e) {
throw new RuntimeException(e);
}
}, this);
}
return TaskManager.taskManager().syncWith(() -> player.teleport(new Location(
finalWorld,
pos.getX(),