Adjust teleportation logic to set correct direction for player-facing location
This commit is contained in:
parent
10a6103f32
commit
dd060bce48
|
|
@ -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;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user