velocity lag accounting for stuff

This commit is contained in:
batchprogrammer314
2021-07-16 03:59:24 -05:00
parent 2406653af8
commit d37d063c88
2 changed files with 5 additions and 5 deletions

View File

@@ -120,7 +120,7 @@ public class Bot extends EntityPlayer {
this.velocity = vector;
}
public void addVelocity(Vector vector) {
public void addVelocity(Vector vector) { // This can cause lag?
try {
velocity.checkFinite();
} catch (IllegalArgumentException e) {
@@ -277,12 +277,12 @@ public class Bot extends EntityPlayer {
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());
punch();
if (entity instanceof Damageable) {
((Damageable) entity).damage(2, getBukkitEntity());
((Damageable) entity).damage(2, getBukkitEntity()); // fist damage is 0.25
}
}

View File

@@ -462,7 +462,7 @@ public class LegacyAgent extends Agent {
vector.multiply(0.1);
vector.setY(0.5);
npc.addVelocity(vector);
npc.setVelocity(npc.getVelocity().add(vector));
return true;
}
}
@@ -485,7 +485,7 @@ public class LegacyAgent extends Agent {
vector.multiply(0.1);
vector.setY(0);
npc.addVelocity(vector);
npc.setVelocity(npc.getVelocity().add(vector));
}
return true;