Optimise Dragon Escape
This commit is contained in:
parent
aa1c53eb31
commit
1687e48bcd
|
@ -10,17 +10,17 @@ import org.bukkit.util.Vector;
|
||||||
|
|
||||||
public class DragonEscapeData
|
public class DragonEscapeData
|
||||||
{
|
{
|
||||||
public DragonEscape Host;
|
|
||||||
|
|
||||||
public EnderDragon Dragon;
|
public final DragonEscape Host;
|
||||||
|
public final EnderDragon Dragon;
|
||||||
|
|
||||||
public Location Target = null;
|
public Location Target;
|
||||||
public Location Location = null;
|
public Location Location;
|
||||||
|
|
||||||
public float Pitch = 0;
|
private float Pitch;
|
||||||
public Vector Velocity = new Vector(0,0,0);
|
public Vector Velocity;
|
||||||
|
|
||||||
public DragonEscapeData(DragonEscape host, EnderDragon dragon, Location target)
|
DragonEscapeData(DragonEscape host, EnderDragon dragon, Location target)
|
||||||
{
|
{
|
||||||
Host = host;
|
Host = host;
|
||||||
|
|
||||||
|
@ -41,25 +41,7 @@ public class DragonEscapeData
|
||||||
{
|
{
|
||||||
Turn();
|
Turn();
|
||||||
|
|
||||||
//Speed
|
double speed = 0.2 * Host.GetSpeedMult();
|
||||||
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();
|
|
||||||
|
|
||||||
Location.add(Velocity.clone().multiply(speed));
|
Location.add(Velocity.clone().multiply(speed));
|
||||||
Location.add(0, -Pitch, 0);
|
Location.add(0, -Pitch, 0);
|
||||||
|
@ -67,7 +49,7 @@ public class DragonEscapeData
|
||||||
Location.setPitch(-1 * Pitch);
|
Location.setPitch(-1 * Pitch);
|
||||||
Location.setYaw(180 + UtilAlg.GetYaw(Velocity));
|
Location.setYaw(180 + UtilAlg.GetYaw(Velocity));
|
||||||
|
|
||||||
Dragon.teleport(Location);
|
UtilEnt.setPosition(Dragon, Location);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void Turn()
|
private void Turn()
|
||||||
|
|
Loading…
Reference in New Issue