Convert newer API from radians to degrees.

This commit is contained in:
sk89q
2014-07-15 20:10:14 -07:00
parent 9b5c112e5c
commit 9feafcfc30
12 changed files with 36 additions and 35 deletions

View File

@ -65,8 +65,8 @@ class ForgeEntity implements Entity {
@Override
public Location getLocation() {
Vector position = new Vector(entity.posX, entity.posY, entity.posZ);
float yaw = (float) Math.toRadians(entity.rotationYaw);
float pitch = (float) Math.toRadians(entity.rotationPitch);
float yaw = entity.rotationYaw;
float pitch = entity.rotationPitch;
return new Location(ForgeAdapter.adapt(entity.worldObj), position, yaw, pitch);
}

View File

@ -63,8 +63,8 @@ public class ForgePlayer extends AbstractPlayerActor {
return new Location(
ForgeWorldEdit.inst.getWorld(this.player.worldObj),
position,
(float) Math.toRadians(this.player.cameraYaw),
(float) Math.toRadians(this.player.cameraPitch));
this.player.cameraYaw,
this.player.cameraPitch);
}
public WorldVector getPosition() {

View File

@ -414,7 +414,7 @@ public class ForgeWorld extends AbstractWorld {
createdEntity.readFromNBT(tag);
}
createdEntity.setLocationAndAngles(location.getX(), location.getY(), location.getZ(), (float) Math.toDegrees(location.getYaw()), (float) Math.toDegrees(location.getPitch()));
createdEntity.setLocationAndAngles(location.getX(), location.getY(), location.getZ(), location.getYaw(), location.getPitch());
world.spawnEntityInWorld(createdEntity);
return new ForgeEntity(createdEntity);