diff options
Diffstat (limited to 'src/main/java/net/minecraft/server/EntityHanging.java')
-rw-r--r-- | src/main/java/net/minecraft/server/EntityHanging.java | 51 |
1 files changed, 21 insertions, 30 deletions
diff --git a/src/main/java/net/minecraft/server/EntityHanging.java b/src/main/java/net/minecraft/server/EntityHanging.java index f697d851..af64f750 100644 --- a/src/main/java/net/minecraft/server/EntityHanging.java +++ b/src/main/java/net/minecraft/server/EntityHanging.java @@ -20,8 +20,6 @@ public abstract class EntityHanging extends Entity { public EntityHanging(World world) { super(world); - this.e = 0; - this.direction = 0; this.height = 0.0F; this.a(0.5F, 0.5F); } @@ -39,7 +37,7 @@ public abstract class EntityHanging extends Entity { this.direction = i; this.lastYaw = this.yaw = (float) (i * 90); float f = (float) this.d(); - float f1 = (float) this.g(); + float f1 = (float) this.e(); float f2 = (float) this.d(); if (i != 2 && i != 0) { @@ -74,33 +72,36 @@ public abstract class EntityHanging extends Entity { } if (i == 2) { - f3 -= this.b(this.d()); + f3 -= this.c(this.d()); } if (i == 1) { - f5 += this.b(this.d()); + f5 += this.c(this.d()); } if (i == 0) { - f3 += this.b(this.d()); + f3 += this.c(this.d()); } if (i == 3) { - f5 -= this.b(this.d()); + f5 -= this.c(this.d()); } - f4 += this.b(this.g()); + f4 += this.c(this.e()); this.setPosition((double) f3, (double) f4, (double) f5); float f7 = -0.03125F; this.boundingBox.b((double) (f3 - f - f7), (double) (f4 - f1 - f7), (double) (f5 - f2 - f7), (double) (f3 + f + f7), (double) (f4 + f1 + f7), (double) (f5 + f2 + f7)); } - private float b(int i) { + private float c(int i) { return i == 32 ? 0.5F : (i == 64 ? 0.5F : 0.0F); } public void l_() { + this.lastX = this.locX; + this.lastY = this.locY; + this.lastZ = this.locZ; if (this.e++ == 100 && !this.world.isStatic) { this.e = 0; if (!this.dead && !this.survives()) { @@ -132,7 +133,7 @@ public abstract class EntityHanging extends Entity { // CraftBukkit end this.die(); - this.h(); + this.b((Entity) null); } } } @@ -142,7 +143,7 @@ public abstract class EntityHanging extends Entity { return false; } else { int i = Math.max(1, this.d() / 16); - int j = Math.max(1, this.g() / 16); + int j = Math.max(1, this.e() / 16); int k = this.x; int l = this.y; int i1 = this.z; @@ -163,7 +164,7 @@ public abstract class EntityHanging extends Entity { i1 = MathHelper.floor(this.locZ - (double) ((float) this.d() / 32.0F)); } - l = MathHelper.floor(this.locY - (double) ((float) this.g() / 32.0F)); + l = MathHelper.floor(this.locY - (double) ((float) this.e() / 32.0F)); for (int j1 = 0; j1 < i; ++j1) { for (int k1 = 0; k1 < j; ++k1) { @@ -202,11 +203,11 @@ public abstract class EntityHanging extends Entity { return true; } - public boolean j(Entity entity) { - return entity instanceof EntityHuman ? this.damageEntity(DamageSource.playerAttack((EntityHuman) entity), 0) : false; + public boolean i(Entity entity) { + return entity instanceof EntityHuman ? this.damageEntity(DamageSource.playerAttack((EntityHuman) entity), 0.0F) : false; } - public boolean damageEntity(DamageSource damagesource, int i) { + public boolean damageEntity(DamageSource damagesource, float f) { if (this.isInvulnerable()) { return false; } else { @@ -239,17 +240,7 @@ public abstract class EntityHanging extends Entity { this.die(); this.J(); - EntityHuman entityhuman = null; - - if (damagesource.getEntity() instanceof EntityHuman) { - entityhuman = (EntityHuman) damagesource.getEntity(); - } - - if (entityhuman != null && entityhuman.abilities.canInstantlyBuild) { - return true; - } - - this.h(); + this.b(damagesource.getEntity()); } return true; @@ -261,14 +252,14 @@ public abstract class EntityHanging extends Entity { if (dead) return; // CraftBukkit this.die(); - this.h(); + this.b((Entity) null); } } public void g(double d0, double d1, double d2) { if (false && !this.world.isStatic && !this.dead && d0 * d0 + d1 * d1 + d2 * d2 > 0.0D) { // CraftBukkit - not needed this.die(); - this.h(); + this.b((Entity) null); } } @@ -325,7 +316,7 @@ public abstract class EntityHanging extends Entity { public abstract int d(); - public abstract int g(); + public abstract int e(); - public abstract void h(); + public abstract void b(Entity entity); } |