Adjust teleportation logic to set correct direction for player-facing location

This commit is contained in:
akastijn 2026-06-21 23:56:16 +02:00
parent 10a6103f32
commit dd060bce48

View File

@ -66,7 +66,10 @@ public class PlayerTeleporterService implements RoundListener {
double angleRadians = Math.toRadians(angleDegrees);
double x = center.getX() + radius * Math.cos(angleRadians);
double z = center.getZ() + radius * Math.sin(angleRadians);
Location location = new Location(center.getWorld(), x, center.getY(), z);
location.setDirection(center.toVector().subtract(location.toVector()));
usedLocations.computeIfAbsent(destination, k -> new HashSet<>()).add(location);
return location;
}