velocity lag accounting for stuff
This commit is contained in:
@@ -120,7 +120,7 @@ public class Bot extends EntityPlayer {
|
|||||||
this.velocity = vector;
|
this.velocity = vector;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void addVelocity(Vector vector) {
|
public void addVelocity(Vector vector) { // This can cause lag?
|
||||||
try {
|
try {
|
||||||
velocity.checkFinite();
|
velocity.checkFinite();
|
||||||
} catch (IllegalArgumentException e) {
|
} catch (IllegalArgumentException e) {
|
||||||
@@ -277,12 +277,12 @@ public class Bot extends EntityPlayer {
|
|||||||
jump(new Vector(0, 0.5, 0));
|
jump(new Vector(0, 0.5, 0));
|
||||||
}
|
}
|
||||||
|
|
||||||
public void attack(org.bukkit.entity.Entity entity) { // TODO botfight fix
|
public void attack(org.bukkit.entity.Entity entity) {
|
||||||
faceLocation(entity.getLocation());
|
faceLocation(entity.getLocation());
|
||||||
punch();
|
punch();
|
||||||
|
|
||||||
if (entity instanceof Damageable) {
|
if (entity instanceof Damageable) {
|
||||||
((Damageable) entity).damage(2, getBukkitEntity());
|
((Damageable) entity).damage(2, getBukkitEntity()); // fist damage is 0.25
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -462,7 +462,7 @@ public class LegacyAgent extends Agent {
|
|||||||
vector.multiply(0.1);
|
vector.multiply(0.1);
|
||||||
vector.setY(0.5);
|
vector.setY(0.5);
|
||||||
|
|
||||||
npc.addVelocity(vector);
|
npc.setVelocity(npc.getVelocity().add(vector));
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -485,7 +485,7 @@ public class LegacyAgent extends Agent {
|
|||||||
vector.multiply(0.1);
|
vector.multiply(0.1);
|
||||||
vector.setY(0);
|
vector.setY(0);
|
||||||
|
|
||||||
npc.addVelocity(vector);
|
npc.setVelocity(npc.getVelocity().add(vector));
|
||||||
}
|
}
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
|
|||||||
Reference in New Issue
Block a user