From 5209e17e1bd0e0803035c697c1ec10c49831dfdb Mon Sep 17 00:00:00 2001 From: Andrew Ardill Date: Mon, 17 Jan 2011 11:03:19 +0800 Subject: Adding all Entities into CraftBukkit. These are needed to properly allow for determining class type, in accordance with current practice. --- src/main/java/net/minecraft/server/EntityPig.java | 61 +++++++++++++++++++++++ 1 file changed, 61 insertions(+) create mode 100644 src/main/java/net/minecraft/server/EntityPig.java (limited to 'src/main/java/net/minecraft/server/EntityPig.java') diff --git a/src/main/java/net/minecraft/server/EntityPig.java b/src/main/java/net/minecraft/server/EntityPig.java new file mode 100644 index 00000000..e44e7a60 --- /dev/null +++ b/src/main/java/net/minecraft/server/EntityPig.java @@ -0,0 +1,61 @@ +package net.minecraft.server; + +public class EntityPig extends EntityAnimals { + + public EntityPig(World world) { + super(world); + aP = "/mob/pig.png"; + a(0.9F, 0.9F); + } + + protected void a() { + af.a(16, ((Byte.valueOf((byte) 0)))); + } + + public void a(NBTTagCompound nbttagcompound) { + super.a(nbttagcompound); + nbttagcompound.a("Saddle", K()); + } + + public void b(NBTTagCompound nbttagcompound) { + super.b(nbttagcompound); + a(nbttagcompound.l("Saddle")); + } + + protected String e() { + return "mob.pig"; + } + + protected String f() { + return "mob.pig"; + } + + protected String g() { + return "mob.pigdeath"; + } + + public boolean a(EntityPlayer entityplayer) { + if (K() && !l.z && (j == null || j == entityplayer)) { + entityplayer.e(((Entity) (this))); + return true; + } else { + return false; + } + } + + protected int h() { + return Item.ao.ba; + } + + public boolean K() { + return (af.a(16) & 1) != 0; + } + + public void a(boolean flag) { + if (flag) { + af.b(16, ((Byte.valueOf((byte) 1)))); + } else { + af.b(16, ((Byte.valueOf((byte) 0)))); + } + } +} -- cgit v1.2.3