diff options
author | Andrew Ardill <andrew.ardill@gmail.com> | 2011-01-17 11:03:19 +0800 |
---|---|---|
committer | Dinner Bone <dinnerbone@dinnerbone.com> | 2011-01-18 00:13:32 +0800 |
commit | 5209e17e1bd0e0803035c697c1ec10c49831dfdb (patch) | |
tree | 849b2a1cae93687c886a0f55d63b0e93fb636cea /src/main/java/net/minecraft/server/EntityPigZombie.java | |
parent | 5f2c8108b776ab5710adfe597574fb0b7e929e36 (diff) | |
download | craftbukkit-5209e17e1bd0e0803035c697c1ec10c49831dfdb.tar craftbukkit-5209e17e1bd0e0803035c697c1ec10c49831dfdb.tar.gz craftbukkit-5209e17e1bd0e0803035c697c1ec10c49831dfdb.tar.lz craftbukkit-5209e17e1bd0e0803035c697c1ec10c49831dfdb.tar.xz craftbukkit-5209e17e1bd0e0803035c697c1ec10c49831dfdb.zip |
Adding all Entities into CraftBukkit.
These are needed to properly allow for determining class type, in
accordance with current practice.
Diffstat (limited to 'src/main/java/net/minecraft/server/EntityPigZombie.java')
-rw-r--r-- | src/main/java/net/minecraft/server/EntityPigZombie.java | 100 |
1 files changed, 100 insertions, 0 deletions
diff --git a/src/main/java/net/minecraft/server/EntityPigZombie.java b/src/main/java/net/minecraft/server/EntityPigZombie.java new file mode 100644 index 00000000..d29de54a --- /dev/null +++ b/src/main/java/net/minecraft/server/EntityPigZombie.java @@ -0,0 +1,100 @@ +package net.minecraft.server; + +import java.util.List; +import java.util.Random; + +public class EntityPigZombie extends EntityZombie { + + private int a; + private int b; + private static final ItemStack f; + + public EntityPigZombie(World world) { + super(world); + a = 0; + b = 0; + aP = "/mob/pigzombie.png"; + bC = 0.5F; + c = 5; + ae = true; + } + + public void b_() { + bC = d == null ? 0.5F : 0.95F; + if (b > 0 && --b == 0) { + l.a(((Entity) (this)), "mob.zombiepig.zpigangry", i() * 2.0F, ((W.nextFloat() - W.nextFloat()) * 0.2F + 1.0F) * 1.8F); + } + super.b_(); + } + + public boolean b() { + return l.k > 0 && l.a(z) && l.a(((Entity) (this)), z).size() == 0 && !l.b(z); + } + + public void a(NBTTagCompound nbttagcompound) { + super.a(nbttagcompound); + nbttagcompound.a("Anger", (short) a); + } + + public void b(NBTTagCompound nbttagcompound) { + super.b(nbttagcompound); + a = ((int) (nbttagcompound.c("Anger"))); + } + + protected Entity l() { + if (a == 0) { + return null; + } else { + return super.l(); + } + } + + public void o() { + super.o(); + } + + public boolean a(Entity entity, int i) { + if (entity instanceof EntityPlayer) { + List list = l.b(((Entity) (this)), z.b(32D, 32D, 32D)); + + for (int j = 0; j < list.size(); j++) { + Entity entity1 = (Entity) list.get(j); + + if (entity1 instanceof EntityPigZombie) { + EntityPigZombie entitypigzombie = (EntityPigZombie) entity1; + + entitypigzombie.g(entity); + } + } + + g(entity); + } + return super.a(entity, i); + } + + private void g(Entity entity) { + d = entity; + a = 400 + W.nextInt(400); + b = W.nextInt(40); + } + + protected String e() { + return "mob.zombiepig.zpig"; + } + + protected String f() { + return "mob.zombiepig.zpighurt"; + } + + protected String g() { + return "mob.zombiepig.zpigdeath"; + } + + protected int h() { + return Item.ap.ba; + } + + static { + f = new ItemStack(Item.E, 1); + } +} |