mirror of
https://github.com/KAMKEEL/CustomNPC-Plus.git
synced 2026-11-12 02:37:27 +00:00
NPCs properly stay floating when not navigating and in the air.
This commit is contained in:
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) {
|
||||
|
||||
Reference in new issue
Block a user