SteamWar/FightSystem
Archiviert
13
1

Add FacingEnemy Math.toDegrees()

Dieser Commit ist enthalten in:
jojo 2020-05-22 17:40:15 +02:00
Ursprung ee8e8113cb
Commit 3ed914731f

Datei anzeigen

@ -250,10 +250,10 @@ public class Config {
TeamRedPasteZ = TeamBluePasteZ + TeamBluetoReddistanceZ; TeamRedPasteZ = TeamBluePasteZ + TeamBluetoReddistanceZ;
World world = Bukkit.getWorlds().get(0); World world = Bukkit.getWorlds().get(0);
double yaw = Math.atan2(TeamBluetoReddistanceZ, TeamBluetoReddistanceX); double yaw = Math.toDegrees(Math.atan2(TeamBluetoReddistanceZ, TeamBluetoReddistanceX));
double pitch = Math.atan2(Math.sqrt(TeamBluetoReddistanceZ * TeamBluetoReddistanceZ + TeamBluetoReddistanceX * TeamBluetoReddistanceX), TeamBluetoReddistanceY) + Math.PI; double pitch = Math.toDegrees(Math.atan2(Math.sqrt(TeamBluetoReddistanceZ * TeamBluetoReddistanceZ + TeamBluetoReddistanceX * TeamBluetoReddistanceX), TeamBluetoReddistanceY) + Math.PI);
double yawInverted = ((yaw + 90 + 180) * Math.PI) / 180; double yawInverted = Math.toDegrees(((yaw + 90 + 180) * Math.PI) / 180);
double pitchInverted = ((90 - pitch) * Math.PI) / 180; double pitchInverted = Math.toDegrees(((90 - pitch) * Math.PI) / 180);
TeamBlueSpawn = new Location(world, TeamBlueSpawn = new Location(world,
TeamBluePasteX + 0.5 + teamBlueSpawnOffsetX, TeamBluePasteX + 0.5 + teamBlueSpawnOffsetX,