Optimise Dragon Escape

This commit is contained in:
Sam 2018-07-10 22:19:20 +01:00 committed by Alexander Meech
parent aa1c53eb31
commit 1687e48bcd
1 changed files with 9 additions and 27 deletions

View File

@ -10,17 +10,17 @@ import org.bukkit.util.Vector;
public class DragonEscapeData
{
public DragonEscape Host;
public EnderDragon Dragon;
public final DragonEscape Host;
public final EnderDragon Dragon;
public Location Target = null;
public Location Location = null;
public Location Target;
public Location Location;
public float Pitch = 0;
public Vector Velocity = new Vector(0,0,0);
private float Pitch;
public Vector Velocity;
public DragonEscapeData(DragonEscape host, EnderDragon dragon, Location target)
DragonEscapeData(DragonEscape host, EnderDragon dragon, Location target)
{
Host = host;
@ -41,25 +41,7 @@ public class DragonEscapeData
{
Turn();
//Speed
double speed = 0.20;
//speed += (System.currentTimeMillis() - Host.GetStateTime())/1000d * 0.001;
//Speed Distance Boost
/*
if (!Host.GetScores().isEmpty())
{
double score = Host.GetScore(Dragon);
double best = Host.GetScores().get(0).Score;
double lead = (best-score)/10000d;
speed += lead * 0.0025;
}
*/
speed = speed * Host.GetSpeedMult();
double speed = 0.2 * Host.GetSpeedMult();
Location.add(Velocity.clone().multiply(speed));
Location.add(0, -Pitch, 0);
@ -67,7 +49,7 @@ public class DragonEscapeData
Location.setPitch(-1 * Pitch);
Location.setYaw(180 + UtilAlg.GetYaw(Velocity));
Dragon.teleport(Location);
UtilEnt.setPosition(Dragon, Location);
}
private void Turn()