diff options
author | Erik Broes <erikbroes@grum.nl> | 2011-01-29 22:50:29 +0100 |
---|---|---|
committer | Erik Broes <erikbroes@grum.nl> | 2011-01-30 13:24:39 +0100 |
commit | df69047324abc54f5d5b8d069bb69b1061b20cce (patch) | |
tree | 76f8d13addf80730deea9285f4bd9a1ffbe45f80 /src/main/java/net/minecraft/server/EntityChicken.java | |
parent | d0cd8c6cc7d1aaf38934996e7e5d3e03272e4ff1 (diff) | |
download | craftbukkit-df69047324abc54f5d5b8d069bb69b1061b20cce.tar craftbukkit-df69047324abc54f5d5b8d069bb69b1061b20cce.tar.gz craftbukkit-df69047324abc54f5d5b8d069bb69b1061b20cce.tar.lz craftbukkit-df69047324abc54f5d5b8d069bb69b1061b20cce.tar.xz craftbukkit-df69047324abc54f5d5b8d069bb69b1061b20cce.zip |
Port to new mc-dev format.
Diffstat (limited to 'src/main/java/net/minecraft/server/EntityChicken.java')
-rw-r--r-- | src/main/java/net/minecraft/server/EntityChicken.java | 69 |
1 files changed, 34 insertions, 35 deletions
diff --git a/src/main/java/net/minecraft/server/EntityChicken.java b/src/main/java/net/minecraft/server/EntityChicken.java index 252d65fa..d99c9c2d 100644 --- a/src/main/java/net/minecraft/server/EntityChicken.java +++ b/src/main/java/net/minecraft/server/EntityChicken.java @@ -1,65 +1,64 @@ package net.minecraft.server; -import java.util.Random; - // CraftBukkit start import org.bukkit.craftbukkit.CraftServer; import org.bukkit.craftbukkit.entity.CraftChicken; // CraftBukkit end -public class EntityChicken extends EntityAnimals { +public class EntityChicken extends EntityAnimal { - public boolean a; - public float b; - public float c; + public boolean a = false; + public float b = 0.0F; + public float c = 0.0F; public float f; public float ak; - public float al; + public float al = 1.0F; public int am; public EntityChicken(World world) { super(world); - a = false; - b = 0.0F; - c = 0.0F; - al = 1.0F; - aP = "/mob/chicken.png"; - a(0.3F, 0.4F); - aZ = 4; - am = W.nextInt(6000) + 6000; + this.texture = "/mob/chicken.png"; + this.a(0.3F, 0.4F); + this.health = 4; + this.am = this.random.nextInt(6000) + 6000; + // CraftBukkit start - CraftServer server = ((WorldServer) this.l).getServer(); + CraftServer server = ((WorldServer) this.world).getServer(); this.bukkitEntity = new CraftChicken(server, this); // CraftBukkit end } public void o() { super.o(); - ak = b; - f = c; - c += ((float) ((double) (A ? -1 : 4) * 0.29999999999999999D)); - if (c < 0.0F) { - c = 0.0F; + this.ak = this.b; + this.f = this.c; + this.c = (float) ((double) this.c + (double) (this.onGround ? -1 : 4) * 0.3D); + if (this.c < 0.0F) { + this.c = 0.0F; } - if (c > 1.0F) { - c = 1.0F; + + if (this.c > 1.0F) { + this.c = 1.0F; } - if (!A && al < 1.0F) { - al = 1.0F; + + if (!this.onGround && this.al < 1.0F) { + this.al = 1.0F; } - al *= 0.90000000000000002D; - if (!A && t < 0.0D) { - t *= 0.59999999999999998D; + + this.al = (float) ((double) this.al * 0.9D); + if (!this.onGround && this.motY < 0.0D) { + this.motY *= 0.6D; } - b += al * 2.0F; - if (!l.z && --am <= 0) { - l.a(((Entity) (this)), "mob.chickenplop", 1.0F, (W.nextFloat() - W.nextFloat()) * 0.2F + 1.0F); - a(Item.aN.ba, 1); - am = W.nextInt(6000) + 6000; + + this.b += this.al * 2.0F; + if (!this.world.isStatic && --this.am <= 0) { + this.world.a(this, "mob.chickenplop", 1.0F, (this.random.nextFloat() - this.random.nextFloat()) * 0.2F + 1.0F); + this.a(Item.EGG.id, 1); + this.am = this.random.nextInt(6000) + 6000; } } - protected void a(float f1) {} + protected void a(float f) {} public void a(NBTTagCompound nbttagcompound) { super.a(nbttagcompound); @@ -82,6 +81,6 @@ public class EntityChicken extends EntityAnimals { } protected int h() { - return Item.J.ba; + return Item.FEATHER.id; } } |