From 3ed914731f7699c7ac806f647fb008c435e0b680 Mon Sep 17 00:00:00 2001 From: jojo Date: Fri, 22 May 2020 17:40:15 +0200 Subject: [PATCH] Add FacingEnemy Math.toDegrees() --- FightSystem_API/src/de/steamwar/fightsystem/Config.java | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/FightSystem_API/src/de/steamwar/fightsystem/Config.java b/FightSystem_API/src/de/steamwar/fightsystem/Config.java index cf603f7..50d3fc2 100644 --- a/FightSystem_API/src/de/steamwar/fightsystem/Config.java +++ b/FightSystem_API/src/de/steamwar/fightsystem/Config.java @@ -250,10 +250,10 @@ public class Config { TeamRedPasteZ = TeamBluePasteZ + TeamBluetoReddistanceZ; World world = Bukkit.getWorlds().get(0); - double yaw = Math.atan2(TeamBluetoReddistanceZ, TeamBluetoReddistanceX); - double pitch = Math.atan2(Math.sqrt(TeamBluetoReddistanceZ * TeamBluetoReddistanceZ + TeamBluetoReddistanceX * TeamBluetoReddistanceX), TeamBluetoReddistanceY) + Math.PI; - double yawInverted = ((yaw + 90 + 180) * Math.PI) / 180; - double pitchInverted = ((90 - pitch) * Math.PI) / 180; + double yaw = Math.toDegrees(Math.atan2(TeamBluetoReddistanceZ, TeamBluetoReddistanceX)); + double pitch = Math.toDegrees(Math.atan2(Math.sqrt(TeamBluetoReddistanceZ * TeamBluetoReddistanceZ + TeamBluetoReddistanceX * TeamBluetoReddistanceX), TeamBluetoReddistanceY) + Math.PI); + double yawInverted = Math.toDegrees(((yaw + 90 + 180) * Math.PI) / 180); + double pitchInverted = Math.toDegrees(((90 - pitch) * Math.PI) / 180); TeamBlueSpawn = new Location(world, TeamBluePasteX + 0.5 + teamBlueSpawnOffsetX,