diff options
author | feildmaster <admin@feildmaster.com> | 2012-12-19 22:03:52 -0600 |
---|---|---|
committer | feildmaster <admin@feildmaster.com> | 2012-12-20 10:43:00 -0600 |
commit | 23b67643741d5754af4de020a29d557078f9f81d (patch) | |
tree | 90e1a32f7eb94af49a381cb6bc34bf6247f0efe6 /src/main/java/net/minecraft/server/EntityLiving.java | |
parent | 9f1bf124eec7c20f16b2034fd9fba55f70c805fd (diff) | |
download | craftbukkit-23b67643741d5754af4de020a29d557078f9f81d.tar craftbukkit-23b67643741d5754af4de020a29d557078f9f81d.tar.gz craftbukkit-23b67643741d5754af4de020a29d557078f9f81d.tar.lz craftbukkit-23b67643741d5754af4de020a29d557078f9f81d.tar.xz craftbukkit-23b67643741d5754af4de020a29d557078f9f81d.zip |
Update CraftBukkit to Minecraft 1.4.6
Diffstat (limited to 'src/main/java/net/minecraft/server/EntityLiving.java')
-rw-r--r-- | src/main/java/net/minecraft/server/EntityLiving.java | 384 |
1 files changed, 202 insertions, 182 deletions
diff --git a/src/main/java/net/minecraft/server/EntityLiving.java b/src/main/java/net/minecraft/server/EntityLiving.java index 08ffc62c..bae495a2 100644 --- a/src/main/java/net/minecraft/server/EntityLiving.java +++ b/src/main/java/net/minecraft/server/EntityLiving.java @@ -15,57 +15,57 @@ import org.bukkit.event.entity.EntityRegainHealthEvent; public abstract class EntityLiving extends Entity { - private static final float[] b = new float[] { 0.0F, 0.0F, 0.005F, 0.01F}; - private static final float[] c = new float[] { 0.0F, 0.0F, 0.05F, 0.1F}; - private static final float[] d = new float[] { 0.0F, 0.0F, 0.005F, 0.02F}; - public static final float[] as = new float[] { 0.0F, 0.01F, 0.07F, 0.2F}; + private static final float[] b = new float[] { 0.0F, 0.0F, 0.05F, 0.1F}; + private static final float[] c = new float[] { 0.0F, 0.0F, 0.05F, 0.2F}; + private static final float[] d = new float[] { 0.0F, 0.0F, 0.05F, 0.02F}; + public static final float[] at = new float[] { 0.0F, 0.1F, 0.15F, 0.45F}; public int maxNoDamageTicks = 20; - public float au; public float av; - public float aw = 0.0F; + public float aw; public float ax = 0.0F; public float ay = 0.0F; public float az = 0.0F; - protected float aA; + public float aA = 0.0F; protected float aB; protected float aC; protected float aD; - protected boolean aE = true; + protected float aE; + protected boolean aF = true; protected String texture = "/mob/char.png"; - protected boolean aG = true; - protected float aH = 0.0F; - protected String aI = null; - protected float aJ = 1.0F; - protected int aK = 0; - protected float aL = 0.0F; - public float aM = 0.1F; - public float aN = 0.02F; - public float aO; + protected boolean aH = true; + protected float aI = 0.0F; + protected String aJ = null; + protected float aK = 1.0F; + protected int aL = 0; + protected float aM = 0.0F; + public float aN = 0.1F; + public float aO = 0.02F; public float aP; + public float aQ; protected int health = this.getMaxHealth(); - public int aR; - protected int aS; - public int aT; + public int aS; + protected int aT; + public int aU; public int hurtTicks; - public int aV; - public float aW = 0.0F; + public int aW; + public float aX = 0.0F; public int deathTicks = 0; public int attackTicks = 0; - public float aZ; public float ba; - protected boolean bb = false; - protected int bc; - public int bd = -1; - public float be = (float) (Math.random() * 0.8999999761581421D + 0.10000000149011612D); - public float bf; + public float bb; + protected boolean bc = false; + protected int bd; + public int be = -1; + public float bf = (float) (Math.random() * 0.8999999761581421D + 0.10000000149011612D); public float bg; public float bh; + public float bi; public EntityHuman killer = null; // CraftBukkit - protected -> public protected int lastDamageByPlayerTime = 0; public EntityLiving lastDamager = null; // CraftBukkit - private -> public private int f = 0; private EntityLiving g = null; - public int bk = 0; + public int bl = 0; public HashMap effects = new HashMap(); // CraftBukkit - protected -> public public boolean updateEffects = true; // CraftBukkit - private -> public private int i; @@ -76,36 +76,36 @@ public abstract class EntityLiving extends Entity { private Navigation navigation; protected final PathfinderGoalSelector goalSelector; protected final PathfinderGoalSelector targetSelector; - private EntityLiving bM; - private EntitySenses bN; - private float bO; - private ChunkCoordinates bP = new ChunkCoordinates(0, 0, 0); - private float bQ = -1.0F; + private EntityLiving bN; + private EntitySenses bO; + private float bP; + private ChunkCoordinates bQ = new ChunkCoordinates(0, 0, 0); + private float bR = -1.0F; private ItemStack[] equipment = new ItemStack[5]; public float[] dropChances = new float[5]; // CraftBukkit - protected -> public - private ItemStack[] bS = new ItemStack[5]; - public boolean bp = false; - public int bq = 0; + private ItemStack[] bT = new ItemStack[5]; + public boolean bq = false; + public int br = 0; public boolean canPickUpLoot = false; // CraftBukkit - protected -> public public boolean persistent = !this.bj(); // CraftBukkit - private -> public, change value - protected int bs; - protected double bt; + protected int bt; protected double bu; protected double bv; protected double bw; protected double bx; - float by = 0.0F; + protected double by; + float bz = 0.0F; public int lastDamage = 0; // CraftBukkit - protected -> public - protected int bA = 0; - protected float bB; + protected int bB = 0; protected float bC; protected float bD; - protected boolean bE = false; - protected float bF = 0.0F; - protected float bG = 0.7F; - private int bU = 0; - private Entity bV; - protected int bH = 0; + protected float bE; + protected boolean bF = false; + protected float bG = 0.0F; + protected float bH = 0.7F; + private int bV = 0; + private Entity bW; + protected int bI = 0; public int expToDrop = 0; // CraftBukkit public int maxAirTicks = 300; // CraftBukkit @@ -119,12 +119,12 @@ public abstract class EntityLiving extends Entity { this.jumpController = new ControllerJump(this); this.senses = new EntityAIBodyControl(this); this.navigation = new Navigation(this, world, 16.0F); - this.bN = new EntitySenses(this); - this.av = (float) (Math.random() + 1.0D) * 0.01F; + this.bO = new EntitySenses(this); + this.aw = (float) (Math.random() + 1.0D) * 0.01F; this.setPosition(this.locX, this.locY, this.locZ); - this.au = (float) Math.random() * 12398.0F; + this.av = (float) Math.random() * 12398.0F; this.yaw = (float) (Math.random() * 3.1415927410125732D * 2.0D); - this.ay = this.yaw; + this.az = this.yaw; for (int i = 0; i < this.dropChances.length; ++i) { this.dropChances[i] = 0.05F; @@ -150,7 +150,7 @@ public abstract class EntityLiving extends Entity { } public EntitySenses aA() { - return this.bN; + return this.bO; } public Random aB() { @@ -172,19 +172,19 @@ public abstract class EntityLiving extends Entity { } public int aE() { - return this.bA; + return this.bB; } public float ap() { - return this.ay; + return this.az; } public float aF() { - return this.bO; + return this.bP; } public void e(float f) { - this.bO = f; + this.bP = f; this.f(f); } @@ -194,11 +194,11 @@ public abstract class EntityLiving extends Entity { } public EntityLiving aG() { - return this.bM; + return this.bN; } public void b(EntityLiving entityliving) { - this.bM = entityliving; + this.bN = entityliving; } public boolean a(Class oclass) { @@ -239,28 +239,28 @@ public abstract class EntityLiving extends Entity { } public boolean e(int i, int j, int k) { - return this.bQ == -1.0F ? true : this.bP.e(i, j, k) < this.bQ * this.bQ; + return this.bR == -1.0F ? true : this.bQ.e(i, j, k) < this.bR * this.bR; } public void b(int i, int j, int k, int l) { - this.bP.b(i, j, k); - this.bQ = (float) l; + this.bQ.b(i, j, k); + this.bR = (float) l; } public ChunkCoordinates aJ() { - return this.bP; + return this.bQ; } public float aK() { - return this.bQ; + return this.bR; } public void aL() { - this.bQ = -1.0F; + this.bR = -1.0F; } public boolean aM() { - return this.bQ != -1.0F; + return this.bR != -1.0F; } public void c(EntityLiving entityliving) { @@ -303,11 +303,11 @@ public abstract class EntityLiving extends Entity { } public void y() { - this.aO = this.aP; + this.aP = this.aQ; super.y(); this.world.methodProfiler.a("mobBaseTick"); - if (this.isAlive() && this.random.nextInt(1000) < this.aT++) { - this.aT = -this.aN(); + if (this.isAlive() && this.random.nextInt(1000) < this.aU++) { + this.aU = -this.aN(); this.aO(); } @@ -327,7 +327,9 @@ public abstract class EntityLiving extends Entity { this.extinguish(); } - if (this.isAlive() && this.a(Material.WATER) && !this.bc() && !this.effects.containsKey(Integer.valueOf(MobEffectList.WATER_BREATHING.id))) { + boolean flag = this instanceof EntityHuman && ((EntityHuman) this).abilities.isInvulnerable; + + if (this.isAlive() && this.a(Material.WATER) && !this.bc() && !this.effects.containsKey(Integer.valueOf(MobEffectList.WATER_BREATHING.id)) && !flag) { this.setAirTicks(this.g(this.getAirTicks())); if (this.getAirTicks() == -20) { this.setAirTicks(0); @@ -360,7 +362,7 @@ public abstract class EntityLiving extends Entity { // CraftBukkit end } - this.aZ = this.ba; + this.ba = this.bb; if (this.attackTicks > 0) { --this.attackTicks; } @@ -398,9 +400,9 @@ public abstract class EntityLiving extends Entity { } this.bx(); - this.aD = this.aC; - this.ax = this.aw; - this.az = this.ay; + this.aE = this.aD; + this.ay = this.ax; + this.aA = this.az; this.lastYaw = this.yaw; this.lastPitch = this.pitch; this.world.methodProfiler.b(); @@ -453,7 +455,20 @@ public abstract class EntityLiving extends Entity { } protected int getExpValue(EntityHuman entityhuman) { - return this.bc; + if (this.bd > 0) { + int i = this.bd; + ItemStack[] aitemstack = this.getEquipment(); + + for (int j = 0; j < aitemstack.length; ++j) { + if (aitemstack[j] != null && this.dropChances[j] <= 1.0F) { + i += 1 + this.random.nextInt(3); + } + } + + return i; + } else { + return this.bd; + } } protected boolean alwaysGivesExp() { @@ -473,8 +488,8 @@ public abstract class EntityLiving extends Entity { public void U() { super.U(); - this.aA = this.aB; - this.aB = 0.0F; + this.aB = this.aC; + this.aC = 0.0F; this.fallDistance = 0.0F; } @@ -486,20 +501,20 @@ public abstract class EntityLiving extends Entity { for (i = 0; i < 5; ++i) { ItemStack itemstack = this.getEquipment(i); - if (!ItemStack.matches(itemstack, this.bS[i])) { + if (!ItemStack.matches(itemstack, this.bT[i])) { ((WorldServer) this.world).getTracker().a((Entity) this, (Packet) (new Packet5EntityEquipment(this.id, i, itemstack))); - this.bS[i] = itemstack == null ? null : itemstack.cloneItemStack(); + this.bT[i] = itemstack == null ? null : itemstack.cloneItemStack(); } } i = this.bJ(); if (i > 0) { - if (this.bk <= 0) { - this.bk = 20 * (30 - i); + if (this.bl <= 0) { + this.bl = 20 * (30 - i); } - --this.bk; - if (this.bk <= 0) { + --this.bl; + if (this.bl <= 0) { this.r(i - 1); } } @@ -509,10 +524,10 @@ public abstract class EntityLiving extends Entity { double d0 = this.locX - this.lastX; double d1 = this.locZ - this.lastZ; float f = (float) (d0 * d0 + d1 * d1); - float f1 = this.aw; + float f1 = this.ax; float f2 = 0.0F; - this.aA = this.aB; + this.aB = this.aC; float f3 = 0.0F; if (f > 0.0025000002F) { @@ -522,7 +537,7 @@ public abstract class EntityLiving extends Entity { f1 = (float) org.bukkit.craftbukkit.TrigMath.atan2(d1, d0) * 180.0F / 3.1415927F - 90.0F; } - if (this.aP > 0.0F) { + if (this.aQ > 0.0F) { f1 = this.yaw; } @@ -530,15 +545,15 @@ public abstract class EntityLiving extends Entity { f3 = 0.0F; } - this.aB += (f3 - this.aB) * 0.3F; + this.aC += (f3 - this.aC) * 0.3F; this.world.methodProfiler.a("headTurn"); if (this.be()) { this.senses.a(); } else { - float f4 = MathHelper.g(f1 - this.aw); + float f4 = MathHelper.g(f1 - this.ax); - this.aw += f4 * 0.3F; - float f5 = MathHelper.g(this.yaw - this.aw); + this.ax += f4 * 0.3F; + float f5 = MathHelper.g(this.yaw - this.ax); boolean flag = f5 < -90.0F || f5 >= 90.0F; if (f5 < -75.0F) { @@ -549,9 +564,9 @@ public abstract class EntityLiving extends Entity { f5 = 75.0F; } - this.aw = this.yaw - f5; + this.ax = this.yaw - f5; if (f5 * f5 > 2500.0F) { - this.aw += f5 * 0.2F; + this.ax += f5 * 0.2F; } if (flag) { @@ -570,12 +585,12 @@ public abstract class EntityLiving extends Entity { this.lastYaw += 360.0F; } - while (this.aw - this.ax < -180.0F) { - this.ax -= 360.0F; + while (this.ax - this.ay < -180.0F) { + this.ay -= 360.0F; } - while (this.aw - this.ax >= 180.0F) { - this.ax += 360.0F; + while (this.ax - this.ay >= 180.0F) { + this.ay += 360.0F; } while (this.pitch - this.lastPitch < -180.0F) { @@ -586,16 +601,16 @@ public abstract class EntityLiving extends Entity { this.lastPitch += 360.0F; } - while (this.ay - this.az < -180.0F) { - this.az -= 360.0F; + while (this.az - this.aA < -180.0F) { + this.aA -= 360.0F; } - while (this.ay - this.az >= 180.0F) { - this.az += 360.0F; + while (this.az - this.aA >= 180.0F) { + this.aA += 360.0F; } this.world.methodProfiler.b(); - this.aC += f2; + this.aD += f2; } // CraftBukkit start - delegate so we can handle providing a reason for health being regained @@ -640,17 +655,18 @@ public abstract class EntityLiving extends Entity { } else if (this.world.isStatic) { return false; } else { - this.bA = 0; + this.bB = 0; if (this.health <= 0) { return false; } else if (damagesource.k() && this.hasEffect(MobEffectList.FIRE_RESISTANCE)) { return false; } else { if ((damagesource == DamageSource.ANVIL || damagesource == DamageSource.FALLING_BLOCK) && this.getEquipment(4) != null) { - i = (int) ((float) i * 0.55F); + this.getEquipment(4).damage(i * 4 + this.random.nextInt(i * 2), this); + i = (int) ((float) i * 0.75F); } - this.bg = 1.5F; + this.bh = 1.5F; boolean flag = true; // CraftBukkit start @@ -673,13 +689,13 @@ public abstract class EntityLiving extends Entity { flag = false; } else { this.lastDamage = i; - this.aR = this.health; + this.aS = this.health; this.noDamageTicks = this.maxNoDamageTicks; this.d(damagesource, i); - this.hurtTicks = this.aV = 10; + this.hurtTicks = this.aW = 10; } - this.aW = 0.0F; + this.aX = 0.0F; Entity entity = damagesource.getEntity(); if (entity != null) { @@ -715,10 +731,10 @@ public abstract class EntityLiving extends Entity { d0 = (Math.random() - Math.random()) * 0.01D; } - this.aW = (float) (Math.atan2(d1, d0) * 180.0D / 3.1415927410125732D) - this.yaw; + this.aX = (float) (Math.atan2(d1, d0) * 180.0D / 3.1415927410125732D) - this.yaw; this.a(entity, i, d0, d1); } else { - this.aW = (float) ((int) (Math.random() * 2.0D) * 180); + this.aX = (float) ((int) (Math.random() * 2.0D) * 180); } } @@ -764,11 +780,11 @@ public abstract class EntityLiving extends Entity { protected int b(DamageSource damagesource, int i) { if (!damagesource.ignoresArmor()) { int j = 25 - this.aW(); - int k = i * j + this.aS; + int k = i * j + this.aT; this.k(i); i = k / 25; - this.aS = k % 25; + this.aT = k % 25; } return i; @@ -778,10 +794,10 @@ public abstract class EntityLiving extends Entity { if (this.hasEffect(MobEffectList.RESISTANCE)) { int j = (this.getEffect(MobEffectList.RESISTANCE).getAmplifier() + 1) * 5; int k = 25 - j; - int l = i * k + this.aS; + int l = i * k + this.aT; i = l / 25; - this.aS = l % 25; + this.aT = l % 25; } return i; @@ -830,15 +846,15 @@ public abstract class EntityLiving extends Entity { public void die(DamageSource damagesource) { Entity entity = damagesource.getEntity(); - if (this.aK >= 0 && entity != null) { - entity.c(this, this.aK); + if (this.aL >= 0 && entity != null) { + entity.c(this, this.aL); } if (entity != null) { entity.a(this); } - this.bb = true; + this.bc = true; if (!this.world.isStatic) { int i = 0; @@ -984,12 +1000,12 @@ public abstract class EntityLiving extends Entity { if (this.be()) { f4 = this.aF(); } else { - f4 = this.aM; + f4 = this.aN; } f4 *= f3; } else { - f4 = this.aN; + f4 = this.aO; } this.a(f, f1, f4); @@ -1054,7 +1070,7 @@ public abstract class EntityLiving extends Entity { this.motZ *= (double) f2; } - this.bf = this.bg; + this.bg = this.bh; d0 = this.locX - this.lastX; double d1 = this.locZ - this.lastZ; float f6 = MathHelper.sqrt(d0 * d0 + d1 * d1) * 4.0F; @@ -1063,8 +1079,8 @@ public abstract class EntityLiving extends Entity { f6 = 1.0F; } - this.bg += (f6 - this.bg) * 0.4F; - this.bh += this.bg; + this.bh += (f6 - this.bh) * 0.4F; + this.bi += this.bh; } public boolean g_() { @@ -1185,29 +1201,33 @@ public abstract class EntityLiving extends Entity { } public void f(float f) { - this.bC = f; + this.bD = f; } public void e(boolean flag) { - this.bE = flag; + this.bF = flag; } public void c() { - if (this.bU > 0) { - --this.bU; + if (this.bV > 0) { + --this.bV; } - if (this.bs > 0) { - double d0 = this.locX + (this.bt - this.locX) / (double) this.bs; - double d1 = this.locY + (this.bu - this.locY) / (double) this.bs; - double d2 = this.locZ + (this.bv - this.locZ) / (double) this.bs; - double d3 = MathHelper.g(this.bw - (double) this.yaw); + if (this.bt > 0) { + double d0 = this.locX + (this.bu - this.locX) / (double) this.bt; + double d1 = this.locY + (this.bv - this.locY) / (double) this.bt; + double d2 = this.locZ + (this.bw - this.locZ) / (double) this.bt; + double d3 = MathHelper.g(this.bx - (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.by - (double) this.pitch) / (double) this.bt); + --this.bt; this.setPosition(d0, d1, d2); this.b(this.yaw, this.pitch); + } else if (!this.bf()) { + this.motX *= 0.98D; + this.motY *= 0.98D; + this.motZ *= 0.98D; } if (Math.abs(this.motX) < 0.005D) { @@ -1224,10 +1244,10 @@ public abstract class EntityLiving extends Entity { this.world.methodProfiler.a("ai"); if (this.bg()) { - this.bE = false; - this.bB = 0.0F; + this.bF = false; this.bC = 0.0F; this.bD = 0.0F; + this.bE = 0.0F; } else if (this.bf()) { if (this.be()) { this.world.methodProfiler.a("newAi"); @@ -1237,35 +1257,35 @@ public abstract class EntityLiving extends Entity { this.world.methodProfiler.a("oldAi"); this.bn(); this.world.methodProfiler.b(); - this.ay = this.yaw; + this.az = this.yaw; } } this.world.methodProfiler.b(); this.world.methodProfiler.a("jump"); - if (this.bE) { + if (this.bF) { if (!this.H() && !this.J()) { - if (this.onGround && this.bU == 0) { + if (this.onGround && this.bV == 0) { this.bi(); - this.bU = 10; + this.bV = 10; } } else { this.motY += 0.03999999910593033D; } } else { - this.bU = 0; + this.bV = 0; } this.world.methodProfiler.b(); this.world.methodProfiler.a("travel"); - this.bB *= 0.98F; this.bC *= 0.98F; - this.bD *= 0.9F; - float f = this.aM; + this.bD *= 0.98F; + this.bE *= 0.9F; + float f = this.aN; - this.aM *= this.bB(); - this.e(this.bB, this.bC); - this.aM = f; + this.aN *= this.bB(); + this.e(this.bC, this.bD); + this.aN = f; this.world.methodProfiler.b(); this.world.methodProfiler.a("push"); if (!this.world.isStatic) { @@ -1275,15 +1295,15 @@ public abstract class EntityLiving extends Entity { this.world.methodProfiler.b(); this.world.methodProfiler.a("looting"); // CraftBukkit - Don't run mob pickup code on players - if (!this.world.isStatic && !(this instanceof EntityPlayer) && this.canPickUpLoot && !this.bb && this.world.getGameRules().getBoolean("mobGriefing")) { + if (!this.world.isStatic && !(this instanceof EntityPlayer) && this.canPickUpLoot && !this.bc && this.world.getGameRules().getBoolean("mobGriefing")) { List list = this.world.a(EntityItem.class, this.boundingBox.grow(1.0D, 0.0D, 1.0D)); Iterator iterator = list.iterator(); while (iterator.hasNext()) { EntityItem entityitem = (EntityItem) iterator.next(); - if (!entityitem.dead && entityitem.itemStack != null) { - ItemStack itemstack = entityitem.itemStack; + if (!entityitem.dead && entityitem.getItemStack() != null) { + ItemStack itemstack = entityitem.getItemStack(); int i = b(itemstack); if (i > -1) { @@ -1409,26 +1429,26 @@ public abstract class EntityLiving extends Entity { this.die(); } - if (this.bA > 600 && this.random.nextInt(800) == 0 && d3 > 1024.0D) { // CraftBukkit - remove this.bj() check + if (this.bB > 600 && this.random.nextInt(800) == 0 && d3 > 1024.0D) { // CraftBukkit - remove this.bj() check this.die(); } else if (d3 < 1024.0D) { - this.bA = 0; + this.bB = 0; } } // CraftBukkit start } else { - this.bA = 0; + this.bB = 0; } // CraftBukkit end } protected void bl() { - ++this.bA; + ++this.bB; this.world.methodProfiler.a("checkDespawn"); this.bk(); this.world.methodProfiler.b(); this.world.methodProfiler.a("sensing"); - this.bN.a(); + this.bO.a(); this.world.methodProfiler.b(); this.world.methodProfiler.a("targetSelector"); this.targetSelector.a(); @@ -1456,59 +1476,59 @@ public abstract class EntityLiving extends Entity { protected void bm() {} protected void bn() { - ++this.bA; + ++this.bB; this.bk(); - this.bB = 0.0F; this.bC = 0.0F; + this.bD = 0.0F; float f = 8.0F; if (this.random.nextFloat() < 0.02F) { EntityHuman entityhuman = this.world.findNearbyPlayer(this, (double) f); if (entityhuman != null) { - this.bV = entityhuman; - this.bH = 10 + this.random.nextInt(20); + this.bW = entityhuman; + this.bI = 10 + this.random.nextInt(20); } else { - this.bD = (this.random.nextFloat() - 0.5F) * 20.0F; + this.bE = (this.random.nextFloat() - 0.5F) * 20.0F; } } - if (this.bV != null) { - this.a(this.bV, 10.0F, (float) this.bp()); - if (this.bH-- <= 0 || this.bV.dead || this.bV.e((Entity) this) > (double) (f * f)) { - this.bV = null; + if (this.bW != null) { + this.a(this.bW, 10.0F, (float) this.bp()); + if (this.bI-- <= 0 || this.bW.dead || this.bW.e((Entity) this) > (double) (f * f)) { + this.bW = null; } } else { if (this.random.nextFloat() < 0.05F) { - this.bD = (this.random.nextFloat() - 0.5F) * 20.0F; + this.bE = (this.random.nextFloat() - 0.5F) * 20.0F; } - this.yaw += this.bD; - this.pitch = this.bF; + this.yaw += this.bE; + this.pitch = this.bG; } boolean flag = this.H(); boolean flag1 = this.J(); if (flag || flag1) { - this.bE = this.random.nextFloat() < 0.8F; + this.bF = this.random.nextFloat() < 0.8F; } } protected void bo() { int i = this.h(); - if (this.bp) { - ++this.bq; - if (this.bq >= i) { - this.bq = 0; - this.bp = false; + if (this.bq) { + ++this.br; + if (this.br >= i) { + this.br = 0; + this.bq = false; } } else { - this.bq = 0; + this.br = 0; } - this.aP = (float) this.bq / (float) i; + this.aQ = (float) this.br / (float) i; } public int bp() { @@ -1853,15 +1873,15 @@ public abstract class EntityLiving extends Entity { int i = this.random.nextInt(2); float f = this.world.difficulty == 3 ? 0.1F : 0.25F; - if (this.random.nextFloat() < 0.07F) { + if (this.random.nextFloat() < 0.1F) { ++i; } - if (this.random.nextFloat() < 0.07F) { + if (this.random.nextFloat() < 0.1F) { ++i; } - if (this.random.nextFloat() < 0.07F) { + if (this.random.nextFloat() < 0.1F) { ++i; } @@ -1986,14 +2006,14 @@ public abstract class EntityLiving extends Entity { protected void bF() { if (this.bD() != null && this.random.nextFloat() < b[this.world.difficulty]) { - EnchantmentManager.a(this.random, this.bD(), 5); + EnchantmentManager.a(this.random, this.bD(), 5 + this.world.difficulty * this.random.nextInt(6)); } for (int i = 0; i < 4; ++i) { ItemStack itemstack = this.q(i); if (itemstack != null && this.random.nextFloat() < c[this.world.difficulty]) { - EnchantmentManager.a(this.random, itemstack, 5); + EnchantmentManager.a(this.random, itemstack, 5 + this.world.difficulty * this.random.nextInt(6)); } } } @@ -2005,9 +2025,9 @@ public abstract class EntityLiving extends Entity { } public void bH() { - if (!this.bp || this.bq >= this.h() / 2 || this.bq < 0) { - this.bq = -1; - this.bp = true; + if (!this.bq || this.br >= this.h() / 2 || this.br < 0) { + this.br = -1; + this.bq = true; if (this.world instanceof WorldServer) { ((WorldServer) this.world).getTracker().a((Entity) this, (Packet) (new Packet18ArmAnimation(this, 1))); } |