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 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;
|
||||
|
||||
|
@ -40,26 +40,8 @@ public class DragonEscapeData
|
|||
public void Move()
|
||||
{
|
||||
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()
|
||||
|
|
Loading…
Reference in New Issue