diff options
author | Travis Watkins <amaranth@ubuntu.com> | 2013-03-13 17:33:27 -0500 |
---|---|---|
committer | Travis Watkins <amaranth@ubuntu.com> | 2013-03-15 13:28:59 -0500 |
commit | 83d29e461c85733f0113b6eb19db6e3b42da2949 (patch) | |
tree | b3063a1c28f478ab368d5ba3413a842def68c28f /src/main/java/net/minecraft/server/PathfinderGoalBreed.java | |
parent | ba6e4c38cfa98ad291974195cc46d70a4f138ac1 (diff) | |
download | craftbukkit-83d29e461c85733f0113b6eb19db6e3b42da2949.tar craftbukkit-83d29e461c85733f0113b6eb19db6e3b42da2949.tar.gz craftbukkit-83d29e461c85733f0113b6eb19db6e3b42da2949.tar.lz craftbukkit-83d29e461c85733f0113b6eb19db6e3b42da2949.tar.xz craftbukkit-83d29e461c85733f0113b6eb19db6e3b42da2949.zip |
Update CraftBukkit to Minecraft 1.5
Diffstat (limited to 'src/main/java/net/minecraft/server/PathfinderGoalBreed.java')
-rw-r--r-- | src/main/java/net/minecraft/server/PathfinderGoalBreed.java | 21 |
1 files changed, 11 insertions, 10 deletions
diff --git a/src/main/java/net/minecraft/server/PathfinderGoalBreed.java b/src/main/java/net/minecraft/server/PathfinderGoalBreed.java index a2c57a62..ca544f36 100644 --- a/src/main/java/net/minecraft/server/PathfinderGoalBreed.java +++ b/src/main/java/net/minecraft/server/PathfinderGoalBreed.java @@ -38,10 +38,10 @@ public class PathfinderGoalBreed extends PathfinderGoal { } public void e() { - this.d.getControllerLook().a(this.e, 10.0F, (float) this.d.bp()); + this.d.getControllerLook().a(this.e, 10.0F, (float) this.d.bs()); this.d.getNavigation().a((EntityLiving) this.e, this.c); ++this.b; - if (this.b == 60) { + if (this.b >= 60 && this.d.e(this.e) < 9.0D) { this.g(); } } @@ -49,17 +49,18 @@ public class PathfinderGoalBreed extends PathfinderGoal { private EntityAnimal f() { float f = 8.0F; List list = this.a.a(this.d.getClass(), this.d.boundingBox.grow((double) f, (double) f, (double) f)); + double d0 = Double.MAX_VALUE; + EntityAnimal entityanimal = null; Iterator iterator = list.iterator(); - EntityAnimal entityanimal; + while (iterator.hasNext()) { + EntityAnimal entityanimal1 = (EntityAnimal) iterator.next(); - do { - if (!iterator.hasNext()) { - return null; + if (this.d.mate(entityanimal1) && this.d.e(entityanimal1) < d0) { + entityanimal = entityanimal1; + d0 = this.d.e(entityanimal1); } - - entityanimal = (EntityAnimal) iterator.next(); - } while (!this.d.mate(entityanimal)); + } return entityanimal; } @@ -75,7 +76,7 @@ public class PathfinderGoalBreed extends PathfinderGoal { entityageable.setAge(-24000); entityageable.setPositionRotation(this.d.locX, this.d.locY, this.d.locZ, 0.0F, 0.0F); this.a.addEntity(entityageable, org.bukkit.event.entity.CreatureSpawnEvent.SpawnReason.BREEDING); // CraftBukkit - added SpawnReason - Random random = this.d.aB(); + Random random = this.d.aE(); for (int i = 0; i < 7; ++i) { double d0 = random.nextGaussian() * 0.02D; |