diff options
author | Nate Mortensen <nate.richard.mortensen@gmail.com> | 2013-07-01 06:03:00 -0500 |
---|---|---|
committer | Wesley Wolfe <weswolf@aol.com> | 2013-07-01 12:10:06 -0500 |
commit | 6c09066e224ac85b8a6464eaf8f53edfeb4beda4 (patch) | |
tree | 573e05f4b148cb1891a1d3839175e501e6257442 /src/main/java/net/minecraft/server/EntityGhast.java | |
parent | f887b76a259e12468b28d82d1eced93f0b73bd6d (diff) | |
download | craftbukkit-6c09066e224ac85b8a6464eaf8f53edfeb4beda4.tar craftbukkit-6c09066e224ac85b8a6464eaf8f53edfeb4beda4.tar.gz craftbukkit-6c09066e224ac85b8a6464eaf8f53edfeb4beda4.tar.lz craftbukkit-6c09066e224ac85b8a6464eaf8f53edfeb4beda4.tar.xz craftbukkit-6c09066e224ac85b8a6464eaf8f53edfeb4beda4.zip |
Update CraftBukkit to 1.6.1
Diffstat (limited to 'src/main/java/net/minecraft/server/EntityGhast.java')
-rw-r--r-- | src/main/java/net/minecraft/server/EntityGhast.java | 113 |
1 files changed, 53 insertions, 60 deletions
diff --git a/src/main/java/net/minecraft/server/EntityGhast.java b/src/main/java/net/minecraft/server/EntityGhast.java index f18a9246..be3922a2 100644 --- a/src/main/java/net/minecraft/server/EntityGhast.java +++ b/src/main/java/net/minecraft/server/EntityGhast.java @@ -8,33 +8,32 @@ import org.bukkit.event.entity.EntityTargetEvent; public class EntityGhast extends EntityFlying implements IMonster { - public int b = 0; - public double c; - public double d; - public double e; - private Entity target = null; - private int i = 0; - public int f = 0; - public int g = 0; + public int h; + public double i; + public double j; + public double bn; + private Entity target; + private int br; + public int bo; + public int bp; private int explosionPower = 1; public EntityGhast(World world) { super(world); - this.texture = "/mob/ghast.png"; this.a(4.0F, 4.0F); this.fireProof = true; - this.be = 5; + this.b = 5; } - public boolean damageEntity(DamageSource damagesource, int i) { + public boolean damageEntity(DamageSource damagesource, float f) { if (this.isInvulnerable()) { return false; } else if ("fireball".equals(damagesource.n()) && damagesource.getEntity() instanceof EntityHuman) { - super.damageEntity(damagesource, 1000); + super.damageEntity(damagesource, 1000.0F); ((EntityHuman) damagesource.getEntity()).a((Statistic) AchievementList.y); return true; } else { - return super.damageEntity(damagesource, i); + return super.damageEntity(damagesource, f); } } @@ -43,46 +42,40 @@ public class EntityGhast extends EntityFlying implements IMonster { this.datawatcher.a(16, Byte.valueOf((byte) 0)); } - public int getMaxHealth() { - return 10; + protected void ax() { + super.ax(); + this.a(GenericAttributes.a).a(10.0D); } - public void l_() { - super.l_(); - byte b0 = this.datawatcher.getByte(16); - - this.texture = b0 == 1 ? "/mob/ghast_fire.png" : "/mob/ghast.png"; - } - - protected void bq() { + protected void bh() { if (!this.world.isStatic && this.world.difficulty == 0) { this.die(); } - this.bn(); - this.f = this.g; - double d0 = this.c - this.locX; - double d1 = this.d - this.locY; - double d2 = this.e - this.locZ; + this.bk(); + this.bo = this.bp; + double d0 = this.i - this.locX; + double d1 = this.j - this.locY; + double d2 = this.bn - this.locZ; double d3 = d0 * d0 + d1 * d1 + d2 * d2; if (d3 < 1.0D || d3 > 3600.0D) { - this.c = this.locX + (double) ((this.random.nextFloat() * 2.0F - 1.0F) * 16.0F); - this.d = this.locY + (double) ((this.random.nextFloat() * 2.0F - 1.0F) * 16.0F); - this.e = this.locZ + (double) ((this.random.nextFloat() * 2.0F - 1.0F) * 16.0F); + this.i = this.locX + (double) ((this.random.nextFloat() * 2.0F - 1.0F) * 16.0F); + this.j = this.locY + (double) ((this.random.nextFloat() * 2.0F - 1.0F) * 16.0F); + this.bn = this.locZ + (double) ((this.random.nextFloat() * 2.0F - 1.0F) * 16.0F); } - if (this.b-- <= 0) { - this.b += this.random.nextInt(5) + 2; + if (this.h-- <= 0) { + this.h += this.random.nextInt(5) + 2; d3 = (double) MathHelper.sqrt(d3); - if (this.a(this.c, this.d, this.e, d3)) { + if (this.a(this.i, this.j, this.bn, d3)) { this.motX += d0 / d3 * 0.1D; this.motY += d1 / d3 * 0.1D; this.motZ += d2 / d3 * 0.1D; } else { - this.c = this.locX; - this.d = this.locY; - this.e = this.locZ; + this.i = this.locX; + this.j = this.locY; + this.bn = this.locZ; } } @@ -101,7 +94,7 @@ public class EntityGhast extends EntityFlying implements IMonster { // CraftBukkit end } - if (this.target == null || this.i-- <= 0) { + if (this.target == null || this.br-- <= 0) { // CraftBukkit start Entity target = this.world.findNearbyVulnerablePlayer(this, 100.0D); if (target != null) { @@ -119,7 +112,7 @@ public class EntityGhast extends EntityFlying implements IMonster { // CraftBukkit end if (this.target != null) { - this.i = 20; + this.br = 20; } } @@ -130,41 +123,41 @@ public class EntityGhast extends EntityFlying implements IMonster { double d6 = this.target.boundingBox.b + (double) (this.target.length / 2.0F) - (this.locY + (double) (this.length / 2.0F)); double d7 = this.target.locZ - this.locZ; - this.ay = this.yaw = -((float) Math.atan2(d5, d7)) * 180.0F / 3.1415927F; - if (this.n(this.target)) { - if (this.g == 10) { + this.aN = this.yaw = -((float) Math.atan2(d5, d7)) * 180.0F / 3.1415927F; + if (this.o(this.target)) { + if (this.bp == 10) { this.world.a((EntityHuman) null, 1007, (int) this.locX, (int) this.locY, (int) this.locZ, 0); } - ++this.g; - if (this.g == 20) { + ++this.bp; + if (this.bp == 20) { this.world.a((EntityHuman) null, 1008, (int) this.locX, (int) this.locY, (int) this.locZ, 0); EntityLargeFireball entitylargefireball = new EntityLargeFireball(this.world, this, d5, d6, d7); // CraftBukkit - set yield when setting explosionpower entitylargefireball.yield = entitylargefireball.e = this.explosionPower; double d8 = 4.0D; - Vec3D vec3d = this.i(1.0F); + Vec3D vec3d = this.j(1.0F); entitylargefireball.locX = this.locX + vec3d.c * d8; entitylargefireball.locY = this.locY + (double) (this.length / 2.0F) + 0.5D; entitylargefireball.locZ = this.locZ + vec3d.e * d8; this.world.addEntity(entitylargefireball); - this.g = -40; + this.bp = -40; } - } else if (this.g > 0) { - --this.g; + } else if (this.bp > 0) { + --this.bp; } } else { - this.ay = this.yaw = -((float) Math.atan2(this.motX, this.motZ)) * 180.0F / 3.1415927F; - if (this.g > 0) { - --this.g; + this.aN = this.yaw = -((float) Math.atan2(this.motX, this.motZ)) * 180.0F / 3.1415927F; + if (this.bp > 0) { + --this.bp; } } if (!this.world.isStatic) { byte b0 = this.datawatcher.getByte(16); - byte b1 = (byte) (this.g > 10 ? 1 : 0); + byte b1 = (byte) (this.bp > 10 ? 1 : 0); if (b0 != b1) { this.datawatcher.watch(16, Byte.valueOf(b1)); @@ -173,9 +166,9 @@ public class EntityGhast extends EntityFlying implements IMonster { } private boolean a(double d0, double d1, double d2, double d3) { - double d4 = (this.c - this.locX) / d3; - double d5 = (this.d - this.locY) / d3; - double d6 = (this.e - this.locZ) / d3; + double d4 = (this.i - this.locX) / d3; + double d5 = (this.j - this.locY) / d3; + double d6 = (this.bn - this.locZ) / d3; AxisAlignedBB axisalignedbb = this.boundingBox.clone(); for (int i = 1; (double) i < d3; ++i) { @@ -188,15 +181,15 @@ public class EntityGhast extends EntityFlying implements IMonster { return true; } - protected String bb() { + protected String r() { return "mob.ghast.moan"; } - protected String bc() { + protected String aK() { return "mob.ghast.scream"; } - protected String bd() { + protected String aL() { return "mob.ghast.death"; } @@ -225,7 +218,7 @@ public class EntityGhast extends EntityFlying implements IMonster { // CraftBukkit end } - protected float ba() { + protected float aW() { return 10.0F; } @@ -233,7 +226,7 @@ public class EntityGhast extends EntityFlying implements IMonster { return this.random.nextInt(20) == 0 && super.canSpawn() && this.world.difficulty > 0; } - public int by() { + public int br() { return 1; } |