diff options
Diffstat (limited to 'src/main/java/net/minecraft/server/EntityEnderDragon.java')
-rw-r--r-- | src/main/java/net/minecraft/server/EntityEnderDragon.java | 114 |
1 files changed, 57 insertions, 57 deletions
diff --git a/src/main/java/net/minecraft/server/EntityEnderDragon.java b/src/main/java/net/minecraft/server/EntityEnderDragon.java index 066ee78c..7d2cf37e 100644 --- a/src/main/java/net/minecraft/server/EntityEnderDragon.java +++ b/src/main/java/net/minecraft/server/EntityEnderDragon.java @@ -25,20 +25,20 @@ public class EntityEnderDragon extends EntityLiving implements IComplex { public EntityComplexPart h; public EntityComplexPart i; public EntityComplexPart j; - public EntityComplexPart bI; public EntityComplexPart bJ; public EntityComplexPart bK; - public float bL = 0.0F; + public EntityComplexPart bL; public float bM = 0.0F; - public boolean bN = false; + public float bN = 0.0F; public boolean bO = false; - private Entity bR; - public int bP = 0; - public EntityEnderCrystal bQ = null; + public boolean bP = false; + private Entity bS; + public int bQ = 0; + public EntityEnderCrystal bR = null; public EntityEnderDragon(World world) { super(world); - this.children = new EntityComplexPart[] { this.g = new EntityComplexPart(this, "head", 6.0F, 6.0F), this.h = new EntityComplexPart(this, "body", 8.0F, 8.0F), this.i = new EntityComplexPart(this, "tail", 4.0F, 4.0F), this.j = new EntityComplexPart(this, "tail", 4.0F, 4.0F), this.bI = new EntityComplexPart(this, "tail", 4.0F, 4.0F), this.bJ = new EntityComplexPart(this, "wing", 4.0F, 4.0F), this.bK = new EntityComplexPart(this, "wing", 4.0F, 4.0F)}; + this.children = new EntityComplexPart[] { this.g = new EntityComplexPart(this, "head", 6.0F, 6.0F), this.h = new EntityComplexPart(this, "body", 8.0F, 8.0F), this.i = new EntityComplexPart(this, "tail", 4.0F, 4.0F), this.j = new EntityComplexPart(this, "tail", 4.0F, 4.0F), this.bJ = new EntityComplexPart(this, "tail", 4.0F, 4.0F), this.bK = new EntityComplexPart(this, "wing", 4.0F, 4.0F), this.bL = new EntityComplexPart(this, "wing", 4.0F, 4.0F)}; this.setHealth(this.getMaxHealth()); this.texture = "/mob/enderdragon/ender.png"; this.a(16.0F, 8.0F); @@ -84,14 +84,14 @@ public class EntityEnderDragon extends EntityLiving implements IComplex { if (!this.world.isStatic) { this.datawatcher.watch(16, Integer.valueOf(this.health)); } else { - f = MathHelper.cos(this.bM * 3.1415927F * 2.0F); - f1 = MathHelper.cos(this.bL * 3.1415927F * 2.0F); + f = MathHelper.cos(this.bN * 3.1415927F * 2.0F); + f1 = MathHelper.cos(this.bM * 3.1415927F * 2.0F); if (f1 <= -0.3F && f >= -0.3F) { - this.world.b(this.locX, this.locY, this.locZ, "mob.enderdragon.wings", 5.0F, 0.8F + this.random.nextFloat() * 0.3F); + this.world.a(this.locX, this.locY, this.locZ, "mob.enderdragon.wings", 5.0F, 0.8F + this.random.nextFloat() * 0.3F, false); } } - this.bL = this.bM; + this.bM = this.bN; float f2; if (this.health <= 0) { @@ -103,10 +103,10 @@ public class EntityEnderDragon extends EntityLiving implements IComplex { this.h(); f = 0.2F / (MathHelper.sqrt(this.motX * this.motX + this.motZ * this.motZ) * 10.0F + 1.0F); f *= (float) Math.pow(2.0D, this.motY); - if (this.bO) { - this.bM += f * 0.5F; + if (this.bP) { + this.bN += f * 0.5F; } else { - this.bM += f; + this.bN += f; } this.yaw = MathHelper.g(this.yaw); @@ -130,14 +130,14 @@ public class EntityEnderDragon extends EntityLiving implements IComplex { float f3; if (this.world.isStatic) { - if (this.bs > 0) { - d0 = this.locX + (this.bt - this.locX) / (double) this.bs; - d1 = this.locY + (this.bu - this.locY) / (double) this.bs; - d2 = this.locZ + (this.bv - this.locZ) / (double) this.bs; + if (this.bt > 0) { + d0 = this.locX + (this.bt - this.locX) / (double) this.bt; + d1 = this.locY + (this.bu - this.locY) / (double) this.bt; + d2 = this.locZ + (this.bv - this.locZ) / (double) this.bt; d3 = MathHelper.g(this.bw - (double) this.yaw); - this.yaw = (float) ((double) this.yaw + d3 / (double) this.bs); - this.pitch = (float) ((double) this.pitch + (this.bx - (double) this.pitch) / (double) this.bs); - --this.bs; + this.yaw = (float) ((double) this.yaw + d3 / (double) this.bt); + this.pitch = (float) ((double) this.pitch + (this.bx - (double) this.pitch) / (double) this.bt); + --this.bt; this.setPosition(d0, d1, d2); this.b(this.yaw, this.pitch); } @@ -146,9 +146,9 @@ public class EntityEnderDragon extends EntityLiving implements IComplex { d1 = this.b - this.locY; d2 = this.c - this.locZ; d3 = d0 * d0 + d1 * d1 + d2 * d2; - if (this.bR != null) { - this.a = this.bR.locX; - this.c = this.bR.locZ; + if (this.bS != null) { + this.a = this.bS.locX; + this.c = this.bS.locZ; double d4 = this.a - this.locX; double d5 = this.c - this.locZ; double d6 = Math.sqrt(d4 * d4 + d5 * d5); @@ -158,13 +158,13 @@ public class EntityEnderDragon extends EntityLiving implements IComplex { d7 = 10.0D; } - this.b = this.bR.boundingBox.b + d7; + this.b = this.bS.boundingBox.b + d7; } else { this.a += this.random.nextGaussian() * 2.0D; this.c += this.random.nextGaussian() * 2.0D; } - if (this.bN || d3 < 100.0D || d3 > 22500.0D || this.positionChanged || this.G) { + if (this.bO || d3 < 100.0D || d3 > 22500.0D || this.positionChanged || this.G) { this.i(); } @@ -199,7 +199,7 @@ public class EntityEnderDragon extends EntityLiving implements IComplex { f4 = 0.0F; } - this.bD *= 0.8F; + this.bE *= 0.8F; float f5 = MathHelper.sqrt(this.motX * this.motX + this.motZ * this.motZ) * 1.0F + 1.0F; double d10 = Math.sqrt(this.motX * this.motX + this.motZ * this.motZ) * 1.0D + 1.0D; @@ -207,13 +207,13 @@ public class EntityEnderDragon extends EntityLiving implements IComplex { d10 = 40.0D; } - this.bD = (float) ((double) this.bD + d9 * (0.699999988079071D / d10 / (double) f5)); - this.yaw += this.bD * 0.1F; + this.bE = (float) ((double) this.bE + d9 * (0.699999988079071D / d10 / (double) f5)); + this.yaw += this.bE * 0.1F; float f6 = (float) (2.0D / (d10 + 1.0D)); float f7 = 0.06F; this.a(0.0F, -1.0F, f7 * (f4 * f6 + (1.0F - f6))); - if (this.bO) { + if (this.bP) { this.move(this.motX * 0.800000011920929D, this.motY * 0.800000011920929D, this.motZ * 0.800000011920929D); } else { this.move(this.motX, this.motY, this.motZ); @@ -228,17 +228,17 @@ public class EntityEnderDragon extends EntityLiving implements IComplex { this.motY *= 0.9100000262260437D; } - this.aw = this.yaw; + this.ax = this.yaw; this.g.width = this.g.length = 3.0F; this.i.width = this.i.length = 2.0F; this.j.width = this.j.length = 2.0F; - this.bI.width = this.bI.length = 2.0F; + this.bJ.width = this.bJ.length = 2.0F; this.h.length = 3.0F; this.h.width = 5.0F; - this.bJ.length = 2.0F; - this.bJ.width = 4.0F; - this.bK.length = 3.0F; + this.bK.length = 2.0F; this.bK.width = 4.0F; + this.bL.length = 3.0F; + this.bL.width = 4.0F; f1 = (float) (this.a(5, 1.0F)[1] - this.a(10, 1.0F)[1]) * 10.0F / 180.0F * 3.1415927F; f2 = MathHelper.cos(f1); float f9 = -MathHelper.sin(f1); @@ -248,21 +248,21 @@ public class EntityEnderDragon extends EntityLiving implements IComplex { this.h.j_(); this.h.setPositionRotation(this.locX + (double) (f11 * 0.5F), this.locY, this.locZ - (double) (f12 * 0.5F), 0.0F, 0.0F); - this.bJ.j_(); - this.bJ.setPositionRotation(this.locX + (double) (f12 * 4.5F), this.locY + 2.0D, this.locZ + (double) (f11 * 4.5F), 0.0F, 0.0F); this.bK.j_(); - this.bK.setPositionRotation(this.locX - (double) (f12 * 4.5F), this.locY + 2.0D, this.locZ - (double) (f11 * 4.5F), 0.0F, 0.0F); + this.bK.setPositionRotation(this.locX + (double) (f12 * 4.5F), this.locY + 2.0D, this.locZ + (double) (f11 * 4.5F), 0.0F, 0.0F); + this.bL.j_(); + this.bL.setPositionRotation(this.locX - (double) (f12 * 4.5F), this.locY + 2.0D, this.locZ - (double) (f11 * 4.5F), 0.0F, 0.0F); if (!this.world.isStatic && this.hurtTicks == 0) { - this.a(this.world.getEntities(this, this.bJ.boundingBox.grow(4.0D, 2.0D, 4.0D).d(0.0D, -2.0D, 0.0D))); this.a(this.world.getEntities(this, this.bK.boundingBox.grow(4.0D, 2.0D, 4.0D).d(0.0D, -2.0D, 0.0D))); + this.a(this.world.getEntities(this, this.bL.boundingBox.grow(4.0D, 2.0D, 4.0D).d(0.0D, -2.0D, 0.0D))); this.b(this.world.getEntities(this, this.g.boundingBox.grow(1.0D, 1.0D, 1.0D))); } double[] adouble = this.a(5, 1.0F); double[] adouble1 = this.a(0, 1.0F); - f3 = MathHelper.sin(this.yaw * 3.1415927F / 180.0F - this.bD * 0.01F); - float f13 = MathHelper.cos(this.yaw * 3.1415927F / 180.0F - this.bD * 0.01F); + f3 = MathHelper.sin(this.yaw * 3.1415927F / 180.0F - this.bE * 0.01F); + float f13 = MathHelper.cos(this.yaw * 3.1415927F / 180.0F - this.bE * 0.01F); this.g.j_(); this.g.setPositionRotation(this.locX + (double) (f3 * 5.5F * f2), this.locY + (adouble1[1] - adouble[1]) * 1.0D + (double) (f9 * 5.5F), this.locZ - (double) (f13 * 5.5F * f2), 0.0F, 0.0F); @@ -279,7 +279,7 @@ public class EntityEnderDragon extends EntityLiving implements IComplex { } if (j == 2) { - entitycomplexpart = this.bI; + entitycomplexpart = this.bJ; } double[] adouble2 = this.a(12 + j * 2, 1.0F); @@ -300,13 +300,13 @@ public class EntityEnderDragon extends EntityLiving implements IComplex { } private void h() { - if (this.bQ != null) { - if (this.bQ.dead) { + if (this.bR != null) { + if (this.bR.dead) { if (!this.world.isStatic) { this.a(this.g, DamageSource.EXPLOSION, 10); } - this.bQ = null; + this.bR = null; } else if (this.ticksLived % 10 == 0 && this.health < this.getMaxHealth()) { // CraftBukkit start EntityRegainHealthEvent event = new EntityRegainHealthEvent(this.getBukkitEntity(), 1, EntityRegainHealthEvent.RegainReason.ENDER_CRYSTAL); @@ -336,7 +336,7 @@ public class EntityEnderDragon extends EntityLiving implements IComplex { } } - this.bQ = entityendercrystal; + this.bR = entityendercrystal; } } @@ -382,9 +382,9 @@ public class EntityEnderDragon extends EntityLiving implements IComplex { } private void i() { - this.bN = false; + this.bO = false; if (this.random.nextInt(2) == 0 && !this.world.players.isEmpty()) { - this.bR = (Entity) this.world.players.get(this.random.nextInt(this.world.players.size())); + this.bS = (Entity) this.world.players.get(this.random.nextInt(this.world.players.size())); } else { boolean flag = false; @@ -401,7 +401,7 @@ public class EntityEnderDragon extends EntityLiving implements IComplex { flag = d0 * d0 + d1 * d1 + d2 * d2 > 100.0D; } while (!flag); - this.bR = null; + this.bS = null; } } @@ -482,7 +482,7 @@ public class EntityEnderDragon extends EntityLiving implements IComplex { this.a = this.locX + (double) (f1 * 5.0F) + (double) ((this.random.nextFloat() - 0.5F) * 2.0F); this.b = this.locY + (double) (this.random.nextFloat() * 3.0F) + 1.0D; this.c = this.locZ - (double) (f2 * 5.0F) + (double) ((this.random.nextFloat() - 0.5F) * 2.0F); - this.bR = null; + this.bS = null; if (damagesource.getEntity() instanceof EntityHuman || damagesource == DamageSource.EXPLOSION) { this.dealDamage(damagesource, i); } @@ -499,8 +499,8 @@ public class EntityEnderDragon extends EntityLiving implements IComplex { } protected void aP() { - ++this.bP; - if (this.bP >= 180 && this.bP <= 200) { + ++this.bQ; + if (this.bQ >= 180 && this.bQ <= 200) { float f = (this.random.nextFloat() - 0.5F) * 8.0F; float f1 = (this.random.nextFloat() - 0.5F) * 4.0F; float f2 = (this.random.nextFloat() - 0.5F) * 8.0F; @@ -512,7 +512,7 @@ public class EntityEnderDragon extends EntityLiving implements IComplex { int j; if (!this.world.isStatic) { - if (this.bP > 150 && this.bP % 5 == 0) { + if (this.bQ > 150 && this.bQ % 5 == 0) { i = expToDrop / 12; // CraftBukkit - drop experience as dragon falls from sky. use experience drop from death event. This is now set in getExpReward() while (i > 0) { @@ -522,14 +522,14 @@ public class EntityEnderDragon extends EntityLiving implements IComplex { } } - if (this.bP == 1) { + if (this.bQ == 1) { this.world.e(1018, (int) this.locX, (int) this.locY, (int) this.locZ, 0); } } this.move(0.0D, 0.10000000149011612D, 0.0D); - this.aw = this.yaw += 20.0F; - if (this.bP == 200 && !this.world.isStatic) { + this.ax = this.yaw += 20.0F; + if (this.bQ == 200 && !this.world.isStatic) { i = expToDrop - 10 * (expToDrop / 12); // CraftBukkit - drop the remaining experience while (i > 0) { @@ -599,7 +599,7 @@ public class EntityEnderDragon extends EntityLiving implements IComplex { for (Iterator it = this.world.players.iterator(); it.hasNext();) { EntityHuman entity = (EntityHuman) it.next(); if (entity instanceof EntityPlayer) { - ((EntityPlayer) entity).netServerHandler.sendPacket(packet); + ((EntityPlayer) entity).playerConnection.sendPacket(packet); } } } |