diff options
Diffstat (limited to 'src/main/java/net/minecraft/server/EntityFallingSand.java')
-rw-r--r-- | src/main/java/net/minecraft/server/EntityFallingSand.java | 100 |
1 files changed, 50 insertions, 50 deletions
diff --git a/src/main/java/net/minecraft/server/EntityFallingSand.java b/src/main/java/net/minecraft/server/EntityFallingSand.java index f9a95a9b..250dcf5e 100644 --- a/src/main/java/net/minecraft/server/EntityFallingSand.java +++ b/src/main/java/net/minecraft/server/EntityFallingSand.java @@ -8,81 +8,81 @@ import org.bukkit.craftbukkit.entity.CraftFallingSand; public class EntityFallingSand extends Entity { public int a; - public int b; + public int b = 0; public EntityFallingSand(World world) { super(world); - b = 0; + // CraftBukkit start - CraftServer server = ((WorldServer) this.l).getServer(); + CraftServer server = ((WorldServer) this.world).getServer(); this.bukkitEntity = new CraftFallingSand(server, this); // CraftBukkit end } - public EntityFallingSand(World world, double d, double d1, double d2, int i) { - // CraftBukkit start - this(world); - // CraftBukkit end - a = i; + public EntityFallingSand(World world, double d0, double d1, double d2, int i) { + this(world); // CraftBukkit super->this so we assign the entity + + this.a = i; this.i = true; - a(0.98F, 0.98F); - H = J / 2.0F; - a(d, d1, d2); - s = 0.0D; - t = 0.0D; - u = 0.0D; - M = false; - m = d; - n = d1; - o = d2; + this.a(0.98F, 0.98F); + this.height = this.width / 2.0F; + this.a(d0, d1, d2); + this.motX = 0.0D; + this.motY = 0.0D; + this.motZ = 0.0D; + this.M = false; + this.lastX = d0; + this.lastY = d1; + this.lastZ = d2; } protected void a() {} public boolean c_() { - return !G; + return !this.dead; } public void b_() { - if (a == 0) { - q(); - return; - } - m = p; - n = q; - o = r; - b++; - t -= 0.039999999105930328D; - c(s, t, u); - s *= 0.98000001907348633D; - t *= 0.98000001907348633D; - u *= 0.98000001907348633D; - int i = MathHelper.b(p); - int j = MathHelper.b(q); - int k = MathHelper.b(r); + if (this.a == 0) { + this.q(); + } else { + this.lastX = this.locX; + this.lastY = this.locY; + this.lastZ = this.locZ; + ++this.b; + this.motY -= 0.03999999910593033D; + this.c(this.motX, this.motY, this.motZ); + this.motX *= 0.9800000190734863D; + this.motY *= 0.9800000190734863D; + this.motZ *= 0.9800000190734863D; + int i = MathHelper.b(this.locX); + int j = MathHelper.b(this.locY); + int k = MathHelper.b(this.locZ); - if (l.a(i, j, k) == a) { - l.e(i, j, k, 0); - } - if (A) { - s *= 0.69999998807907104D; - u *= 0.69999998807907104D; - t *= -0.5D; - q(); - if ((!l.a(a, i, j, k, true) || !l.e(i, j, k, a)) && !l.z) { - a(a, 1); + if (this.world.getTypeId(i, j, k) == this.a) { + this.world.e(i, j, k, 0); + } + + if (this.onGround) { + this.motX *= 0.699999988079071D; + this.motZ *= 0.699999988079071D; + this.motY *= -0.5D; + this.q(); + if ((!this.world.a(this.a, i, j, k, true) || !this.world.e(i, j, k, this.a)) && !this.world.isStatic) { + this.a(this.a, 1); + } + } else if (this.b > 100 && !this.world.isStatic) { + this.a(this.a, 1); + this.q(); } - } else if (b > 100 && !l.z) { - a(a, 1); - q(); } } protected void a(NBTTagCompound nbttagcompound) { - nbttagcompound.a("Tile", (byte) a); + nbttagcompound.a("Tile", (byte) this.a); } protected void b(NBTTagCompound nbttagcompound) { - a = nbttagcompound.b("Tile") & 0xff; + this.a = nbttagcompound.b("Tile") & 255; } } |