Fix Folia Teleportation (#349)

This commit is contained in:
Sofiane H. Djerbi 2023-04-04 02:15:16 +02:00 committed by GitHub
parent f706bcf38e
commit f2934fd876
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -4,6 +4,7 @@ import java.util.Arrays;
import java.util.HashSet;
import java.util.Set;
import net.coreprotect.config.ConfigHandler;
import org.bukkit.GameMode;
import org.bukkit.Location;
import org.bukkit.Material;
@ -78,7 +79,11 @@ public class Teleport {
double oldY = location.getY();
location.setY(checkY);
if (ConfigHandler.isFolia) {
player.teleportAsync(location);
} else {
player.teleport(location);
}
if (!enforceTeleport) {
// Only send a message if the player was moved by at least 1 block