NPCs properly stay floating when not navigating and in the air.

This commit is contained in:
luisc committed 2021-12-08 04:41:41 -06:00
1 parent 2147bd00d0
commit c2564de470
3 files changed
+5 -13

No files matched your search

@@ -460,14 +460,14 @@ public class ScriptEntity<T extends Entity> implements IEntity {
@Override
public void knockback(int power, float direction){
float v = direction * (float)Math.PI / 180.0F;
entity.velocityChanged = true;
entity.addVelocity(-MathHelper.sin(v) * (float)power, 0.1D + power * 0.04f, MathHelper.cos(v) * (float)power);
entity.velocityChanged = true;
}
public void knockback(int xpower, int ypower, int zpower, float direction){
float v = direction * (float)Math.PI / 180.0F;
entity.velocityChanged = true;
entity.addVelocity(-MathHelper.sin(v) * (float)xpower, 0.1D + ypower * 0.04f, MathHelper.cos(v) * (float)zpower);
entity.velocityChanged = true;
}
public void setImmune(int ticks) {