Fork of Poseidon providing Bukkit #1060 to older Beta versions (b1.0-b1.7.3)
at develop 72 lines 2.1 kB view raw
1package net.minecraft.server; 2 3public class EntityFlying extends EntityLiving { 4 5 public EntityFlying(World world) { 6 super(world); 7 } 8 9 protected void a(float f) { 10 } 11 12 public void a(float f, float f1) { 13 if (this.ad()) { 14 this.a(f, f1, 0.02F); 15 this.move(this.motX, this.motY, this.motZ); 16 this.motX *= 0.800000011920929D; 17 this.motY *= 0.800000011920929D; 18 this.motZ *= 0.800000011920929D; 19 } else if (this.ae()) { 20 this.a(f, f1, 0.02F); 21 this.move(this.motX, this.motY, this.motZ); 22 this.motX *= 0.5D; 23 this.motY *= 0.5D; 24 this.motZ *= 0.5D; 25 } else { 26 float f2 = 0.91F; 27 28 if (this.onGround) { 29 f2 = 0.54600006F; 30 int i = this.world.getTypeId(MathHelper.floor(this.locX), MathHelper.floor(this.boundingBox.b) - 1, MathHelper.floor(this.locZ)); 31 32 if (i > 0) { 33 f2 = Block.byId[i].frictionFactor * 0.91F; 34 } 35 } 36 37 float f3 = 0.16277136F / (f2 * f2 * f2); 38 39 this.a(f, f1, this.onGround ? 0.1F * f3 : 0.02F); 40 f2 = 0.91F; 41 if (this.onGround) { 42 f2 = 0.54600006F; 43 int j = this.world.getTypeId(MathHelper.floor(this.locX), MathHelper.floor(this.boundingBox.b) - 1, MathHelper.floor(this.locZ)); 44 45 if (j > 0) { 46 f2 = Block.byId[j].frictionFactor * 0.91F; 47 } 48 } 49 50 this.move(this.motX, this.motY, this.motZ); 51 this.motX *= (double) f2; 52 this.motY *= (double) f2; 53 this.motZ *= (double) f2; 54 } 55 56 this.an = this.ao; 57 double d0 = this.locX - this.lastX; 58 double d1 = this.locZ - this.lastZ; 59 float f4 = MathHelper.a(d0 * d0 + d1 * d1) * 4.0F; 60 61 if (f4 > 1.0F) { 62 f4 = 1.0F; 63 } 64 65 this.ao += (f4 - this.ao) * 0.4F; 66 this.ap += this.ao; 67 } 68 69 public boolean p() { 70 return false; 71 } 72}