Add FacingEnemy Rotation
Dieser Commit ist enthalten in:
Ursprung
aed114cda2
Commit
ee8e8113cb
@ -250,14 +250,25 @@ 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;
|
||||
|
||||
TeamBlueSpawn = new Location(world,
|
||||
TeamBluePasteX + 0.5 + teamBlueSpawnOffsetX,
|
||||
TeamBlueCornerY + 0.5 + teamBlueSpawnOffsetY,
|
||||
TeamBluePasteZ + 0.5 + teamBlueSpawnOffsetZ);
|
||||
TeamBlueSpawn.setYaw((float)yaw);
|
||||
TeamBlueSpawn.setPitch((float)pitch);
|
||||
|
||||
TeamRedSpawn = new Location(world,
|
||||
TeamRedPasteX + 0.5 - teamBlueSpawnOffsetX,
|
||||
TeamRedCornerY + 0.5 + teamBlueSpawnOffsetY,
|
||||
TeamRedPasteZ + 0.5 - teamBlueSpawnOffsetZ);
|
||||
TeamRedSpawn.setYaw((float)yawInverted);
|
||||
TeamRedSpawn.setPitch((float)pitchInverted);
|
||||
|
||||
SpecSpawn = new Location(world,
|
||||
TeamBluePasteX + TeamBluetoReddistanceX/2.0,
|
||||
TeamBlueCornerY + TeamBluetoReddistanceY/2.0 + SchemsizeY/2.0,
|
||||
|
In neuem Issue referenzieren
Einen Benutzer sperren