Mirror von
https://github.com/IntellectualSites/FastAsyncWorldEdit.git
synchronisiert 2024-11-03 01:50:07 +01:00
Fixed Sponge implementation player rotations
Dieser Commit ist enthalten in:
Ursprung
f09fff9491
Commit
222ba33aa4
@ -35,8 +35,7 @@ final class SpongeAdapter {
|
||||
|
||||
public static Location adapt(org.spongepowered.api.world.Location<org.spongepowered.api.world.World> loc, Vector3d rot) {
|
||||
Vector position = new Vector(loc.getX(), loc.getY(), loc.getZ());
|
||||
Vector dir = new Vector(rot.getX(), rot.getY(), rot.getZ());
|
||||
|
||||
return new Location(SpongeAdapter.adapt(loc.getExtent()), position, dir);
|
||||
return new Location(SpongeAdapter.adapt(loc.getExtent()), position, (float) rot.getY(), (float) rot.getX());
|
||||
}
|
||||
}
|
||||
|
@ -148,16 +148,12 @@ public class SpongePlayer extends AbstractPlayerActor {
|
||||
this.player.getWorld(), pos.getX(), pos.getY(), pos.getZ()
|
||||
);
|
||||
|
||||
double yawR = Math.toRadians(yaw);
|
||||
double pitchR = Math.toRadians(pitch);
|
||||
double xz = Math.cos(pitch);
|
||||
|
||||
this.player.setLocationAndRotation(
|
||||
loc,
|
||||
new Vector3d(
|
||||
-xz * Math.sin(yawR),
|
||||
-Math.sin(pitchR),
|
||||
xz * Math.cos(yawR)
|
||||
pitch,
|
||||
yaw,
|
||||
0
|
||||
)
|
||||
);
|
||||
}
|
||||
|
Laden…
In neuem Issue referenzieren
Einen Benutzer sperren