geforkt von Mirrors/FastAsyncWorldEdit
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) {
|
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 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()
|
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(
|
this.player.setLocationAndRotation(
|
||||||
loc,
|
loc,
|
||||||
new Vector3d(
|
new Vector3d(
|
||||||
-xz * Math.sin(yawR),
|
pitch,
|
||||||
-Math.sin(pitchR),
|
yaw,
|
||||||
xz * Math.cos(yawR)
|
0
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
Laden…
In neuem Issue referenzieren
Einen Benutzer sperren