summaryrefslogtreecommitdiffstats
path: root/src/main/java/net/minecraft/server/EntityCreeper.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/EntityCreeper.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/EntityCreeper.java')
-rw-r--r--src/main/java/net/minecraft/server/EntityCreeper.java101
1 files changed, 37 insertions, 64 deletions
diff --git a/src/main/java/net/minecraft/server/EntityCreeper.java b/src/main/java/net/minecraft/server/EntityCreeper.java
index 9ecbaca4..00f92a01 100644
--- a/src/main/java/net/minecraft/server/EntityCreeper.java
+++ b/src/main/java/net/minecraft/server/EntityCreeper.java
@@ -10,6 +10,19 @@ public class EntityCreeper extends EntityMonster {
public EntityCreeper(World world) {
super(world);
this.texture = "/mob/creeper.png";
+ this.goalSelector.a(1, new PathfinderGoalFloat(this));
+ this.goalSelector.a(2, new PathfinderGoalSwell(this));
+ this.goalSelector.a(3, new PathfinderGoalAvoidPlayer(this, EntityOcelot.class, 6.0F, 0.25F, 0.3F));
+ this.goalSelector.a(4, new PathfinderGoalMeleeAttack(this, 0.25F, false));
+ this.goalSelector.a(5, new PathfinderGoalRandomStroll(this, 0.2F));
+ this.goalSelector.a(6, new PathfinderGoalLookAtPlayer(this, EntityHuman.class, 8.0F));
+ this.goalSelector.a(6, new PathfinderGoalRandomLookaround(this));
+ this.targetSelector.a(1, new PathfinderGoalNearestAttackableTarget(this, EntityHuman.class, 16.0F, 0, false));
+ this.targetSelector.a(2, new PathfinderGoalHurtByTarget(this, false));
+ }
+
+ public boolean c_() {
+ return true;
}
public int getMaxHealth() {
@@ -34,22 +47,10 @@ public class EntityCreeper extends EntityMonster {
this.datawatcher.watch(17, Byte.valueOf((byte) (nbttagcompound.getBoolean("powered") ? 1 : 0)));
}
- protected void b(Entity entity, float f) {
- if (!this.world.isStatic) {
- if (this.fuseTicks > 0) {
- this.b(-1);
- --this.fuseTicks;
- if (this.fuseTicks < 0) {
- this.fuseTicks = 0;
- }
- }
- }
- }
-
- public void y_() {
- this.b = this.fuseTicks;
- if (this.world.isStatic) {
- int i = this.B();
+ public void G_() {
+ if (this.isAlive()) {
+ this.b = this.fuseTicks;
+ int i = this.A();
if (i > 0 && this.fuseTicks == 0) {
this.world.makeSound(this, "random.fuse", 1.0F, 0.5F);
@@ -62,24 +63,30 @@ public class EntityCreeper extends EntityMonster {
if (this.fuseTicks >= 30) {
this.fuseTicks = 30;
- }
- }
+ // CraftBukkit start
+ float radius = this.isPowered() ? 6.0F : 3.0F;
- super.y_();
- if (this.target == null && this.fuseTicks > 0) {
- this.b(-1);
- --this.fuseTicks;
- if (this.fuseTicks < 0) {
- this.fuseTicks = 0;
+ ExplosionPrimeEvent event = new ExplosionPrimeEvent(this.getBukkitEntity(), radius, false);
+ this.world.getServer().getPluginManager().callEvent(event);
+
+ if (!event.isCancelled()) {
+ this.world.createExplosion(this, this.locX, this.locY, this.locZ, event.getRadius(), event.getFire());
+ this.die();
+ } else {
+ this.fuseTicks = 0;
+ }
+ // CraftBukkit end
}
}
+
+ super.G_();
}
- protected String m() {
+ protected String j() {
return "mob.creeper";
}
- protected String n() {
+ protected String k() {
return "mob.creeperdeath";
}
@@ -90,42 +97,8 @@ public class EntityCreeper extends EntityMonster {
}
}
- protected void a(Entity entity, float f) {
- if (!this.world.isStatic) {
- int i = this.B();
-
- if ((i > 0 || f >= 3.0F) && (i <= 0 || f >= 7.0F)) {
- this.b(-1);
- --this.fuseTicks;
- if (this.fuseTicks < 0) {
- this.fuseTicks = 0;
- }
- } else {
- if (this.fuseTicks == 0) {
- this.world.makeSound(this, "random.fuse", 1.0F, 0.5F);
- }
-
- this.b(1);
- ++this.fuseTicks;
- if (this.fuseTicks >= 30) {
- // CraftBukkit start
- float radius = this.isPowered() ? 6.0F : 3.0F;
-
- ExplosionPrimeEvent event = new ExplosionPrimeEvent(this.getBukkitEntity(), radius, false);
- this.world.getServer().getPluginManager().callEvent(event);
-
- if (!event.isCancelled()) {
- this.world.createExplosion(this, this.locX, this.locY, this.locZ, event.getRadius(), event.getFire());
- this.die();
- } else {
- this.fuseTicks = 0;
- }
- // CraftBukkit end
- }
-
- this.e = true;
- }
- }
+ public boolean a(Entity entity) {
+ return true;
}
public boolean isPowered() {
@@ -136,11 +109,11 @@ public class EntityCreeper extends EntityMonster {
return Item.SULPHUR.id;
}
- private int B() {
+ public int A() {
return this.datawatcher.getByte(16);
}
- private void b(int i) {
+ public void c(int i) {
this.datawatcher.watch(16, Byte.valueOf((byte) i));
}