summaryrefslogtreecommitdiffstats
path: root/src/main/java/net/minecraft/server/EntityZombie.java
diff options
context:
space:
mode:
authorNathan Adams <dinnerbone@dinnerbone.com>2012-03-01 10:49:23 +0000
committerNathan Adams <dinnerbone@dinnerbone.com>2012-03-01 14:38:31 +0000
commit543c4879fee3b7165764c5371d226c93fe3a657b (patch)
tree4fe9116464e1fe42a40dc3ba19b58234bd26f821 /src/main/java/net/minecraft/server/EntityZombie.java
parente9ca87000c1794715bc3fe0a7d1caaf809057635 (diff)
downloadcraftbukkit-543c4879fee3b7165764c5371d226c93fe3a657b.tar
craftbukkit-543c4879fee3b7165764c5371d226c93fe3a657b.tar.gz
craftbukkit-543c4879fee3b7165764c5371d226c93fe3a657b.tar.lz
craftbukkit-543c4879fee3b7165764c5371d226c93fe3a657b.tar.xz
craftbukkit-543c4879fee3b7165764c5371d226c93fe3a657b.zip
Updated CraftBukkit to 1.2
Diffstat (limited to 'src/main/java/net/minecraft/server/EntityZombie.java')
-rw-r--r--src/main/java/net/minecraft/server/EntityZombie.java57
1 files changed, 42 insertions, 15 deletions
diff --git a/src/main/java/net/minecraft/server/EntityZombie.java b/src/main/java/net/minecraft/server/EntityZombie.java
index 472cea64..6c053498 100644
--- a/src/main/java/net/minecraft/server/EntityZombie.java
+++ b/src/main/java/net/minecraft/server/EntityZombie.java
@@ -7,30 +7,38 @@ public class EntityZombie extends EntityMonster {
public EntityZombie(World world) {
super(world);
this.texture = "/mob/zombie.png";
- this.bb = 0.5F;
+ this.bb = 0.23F;
this.damage = 4;
- this.goalSelector.a(1, new PathfinderGoalFloat(this));
- this.goalSelector.a(2, new PathfinderGoalMeleeAttack(this, world, 16.0F));
- this.goalSelector.a(3, new PathfinderGoalRandomStroll(this));
- this.goalSelector.a(4, new PathfinderGoalLookAtPlayer(this, world, 8.0F));
- this.goalSelector.a(4, new PathfinderGoalRandomLookaround(this));
+ this.ak().b(true);
+ this.goalSelector.a(0, new PathfinderGoalFloat(this));
+ this.goalSelector.a(1, new PathfinderGoalBreakDoor(this));
+ this.goalSelector.a(2, new PathfinderGoalMeleeAttack(this, EntityHuman.class, this.bb, false));
+ this.goalSelector.a(3, new PathfinderGoalMeleeAttack(this, EntityVillager.class, this.bb, true));
+ this.goalSelector.a(4, new PathfinderGoalMoveTowardsRestriction(this, this.bb));
+ this.goalSelector.a(5, new PathfinderGoalMoveThroughVillage(this, this.bb, false));
+ this.goalSelector.a(6, new PathfinderGoalRandomStroll(this, this.bb));
+ this.goalSelector.a(7, new PathfinderGoalLookAtPlayer(this, EntityHuman.class, 8.0F));
+ this.goalSelector.a(7, new PathfinderGoalRandomLookaround(this));
+ this.targetSelector.a(1, new PathfinderGoalHurtByTarget(this, false));
+ this.targetSelector.a(2, new PathfinderGoalNearestAttackableTarget(this, EntityHuman.class, 16.0F, 0, true));
+ this.targetSelector.a(2, new PathfinderGoalNearestAttackableTarget(this, EntityVillager.class, 16.0F, 0, false));
}
public int getMaxHealth() {
return 20;
}
- public int P() {
+ public int S() {
return 2;
}
- protected boolean as() {
- return false;
+ protected boolean c_() {
+ return true;
}
- public void d() {
+ public void e() {
if (this.world.e() && !this.world.isStatic) {
- float f = this.a(1.0F);
+ float f = this.b(1.0F);
if (f > 0.5F && this.world.isChunkLoaded(MathHelper.floor(this.locX), MathHelper.floor(this.locY), MathHelper.floor(this.locZ)) && this.random.nextFloat() * 30.0F < (f - 0.4F) * 2.0F) {
// CraftBukkit start
@@ -44,18 +52,18 @@ public class EntityZombie extends EntityMonster {
}
}
- super.d();
+ super.e();
}
- protected String c_() {
+ protected String i() {
return "mob.zombie";
}
- protected String m() {
+ protected String j() {
return "mob.zombiehurt";
}
- protected String n() {
+ protected String k() {
return "mob.zombiedeath";
}
@@ -66,4 +74,23 @@ public class EntityZombie extends EntityMonster {
public MonsterType getMonsterType() {
return MonsterType.UNDEAD;
}
+
+ protected void b(int i) {
+ switch (this.random.nextInt(4)) {
+ case 0:
+ this.b(Item.IRON_SWORD.id, 1);
+ break;
+
+ case 1:
+ this.b(Item.IRON_HELMET.id, 1);
+ break;
+
+ case 2:
+ this.b(Item.IRON_INGOT.id, 1);
+ break;
+
+ case 3:
+ this.b(Item.IRON_SPADE.id, 1);
+ }
+ }
}