summaryrefslogtreecommitdiffstats
path: root/src/main/java/net/minecraft/server/EntityPig.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/java/net/minecraft/server/EntityPig.java')
-rw-r--r--src/main/java/net/minecraft/server/EntityPig.java29
1 files changed, 20 insertions, 9 deletions
diff --git a/src/main/java/net/minecraft/server/EntityPig.java b/src/main/java/net/minecraft/server/EntityPig.java
index c4c00194..8c6829f8 100644
--- a/src/main/java/net/minecraft/server/EntityPig.java
+++ b/src/main/java/net/minecraft/server/EntityPig.java
@@ -13,7 +13,12 @@ public class EntityPig extends EntityAnimal {
this.b(0.9F, 0.9F);
}
+ public int getMaxHealth() {
+ return 10;
+ }
+
protected void b() {
+ super.b();
this.datawatcher.a(16, Byte.valueOf((byte) 0));
}
@@ -24,23 +29,25 @@ public class EntityPig extends EntityAnimal {
public void a(NBTTagCompound nbttagcompound) {
super.a(nbttagcompound);
- this.setSaddle(nbttagcompound.m("Saddle"));
+ this.setSaddle(nbttagcompound.n("Saddle"));
}
- protected String h() {
+ protected String c_() {
return "mob.pig";
}
- protected String i() {
+ protected String m() {
return "mob.pig";
}
- protected String j() {
+ protected String n() {
return "mob.pigdeath";
}
public boolean b(EntityHuman entityhuman) {
- if (this.hasSaddle() && !this.world.isStatic && (this.passenger == null || this.passenger == entityhuman)) {
+ if (super.b(entityhuman)) {
+ return true;
+ } else if (this.hasSaddle() && !this.world.isStatic && (this.passenger == null || this.passenger == entityhuman)) {
entityhuman.mount(this);
return true;
} else {
@@ -48,8 +55,8 @@ public class EntityPig extends EntityAnimal {
}
}
- protected int k() {
- return this.fireTicks > 0 ? Item.GRILLED_PORK.id : Item.PORK.id;
+ protected int e() {
+ return this.z() ? Item.GRILLED_PORK.id : Item.PORK.id;
}
public boolean hasSaddle() {
@@ -84,10 +91,14 @@ public class EntityPig extends EntityAnimal {
}
}
- protected void a(float f) {
- super.a(f);
+ protected void b(float f) {
+ super.b(f);
if (f > 5.0F && this.passenger instanceof EntityHuman) {
((EntityHuman) this.passenger).a((Statistic) AchievementList.u);
}
}
+
+ protected EntityAnimal createChild(EntityAnimal entityanimal) {
+ return new EntityPig(this.world);
+ }
}