diff options
author | Erik Broes <erikbroes@grum.nl> | 2011-05-28 22:50:08 +0200 |
---|---|---|
committer | EvilSeph <evilseph@unaligned.org> | 2011-05-30 22:37:34 -0400 |
commit | 6dbd710bbf37728eb760cacb019d1e384a7e1311 (patch) | |
tree | 37b670b6e589f3fcffa116d55c099e424402dfdc /src/main/java/net/minecraft/server/EntityCreeper.java | |
parent | 9ec5d8b5dfc544a6873aa1bb48a07deedd1751fb (diff) | |
download | craftbukkit-6dbd710bbf37728eb760cacb019d1e384a7e1311.tar craftbukkit-6dbd710bbf37728eb760cacb019d1e384a7e1311.tar.gz craftbukkit-6dbd710bbf37728eb760cacb019d1e384a7e1311.tar.lz craftbukkit-6dbd710bbf37728eb760cacb019d1e384a7e1311.tar.xz craftbukkit-6dbd710bbf37728eb760cacb019d1e384a7e1311.zip |
Update for 1.6.5
Diffstat (limited to 'src/main/java/net/minecraft/server/EntityCreeper.java')
-rw-r--r-- | src/main/java/net/minecraft/server/EntityCreeper.java | 72 |
1 files changed, 39 insertions, 33 deletions
diff --git a/src/main/java/net/minecraft/server/EntityCreeper.java b/src/main/java/net/minecraft/server/EntityCreeper.java index f3d9f1c6..06d58377 100644 --- a/src/main/java/net/minecraft/server/EntityCreeper.java +++ b/src/main/java/net/minecraft/server/EntityCreeper.java @@ -36,16 +36,18 @@ public class EntityCreeper extends EntityMonster { } protected void b(Entity entity, float f) { - if (this.fuseTicks > 0) { - this.e(-1); - --this.fuseTicks; - if (this.fuseTicks < 0) { - this.fuseTicks = 0; + if (!this.world.isStatic) { + if (this.fuseTicks > 0) { + this.e(-1); + --this.fuseTicks; + if (this.fuseTicks < 0) { + this.fuseTicks = 0; + } } } } - public void p_() { + public void o_() { this.b = this.fuseTicks; if (this.world.isStatic) { int i = this.x(); @@ -64,7 +66,7 @@ public class EntityCreeper extends EntityMonster { } } - super.p_(); + super.o_(); if (this.target == null && this.fuseTicks > 0) { this.e(-1); --this.fuseTicks; @@ -90,39 +92,43 @@ public class EntityCreeper extends EntityMonster { } protected void a(Entity entity, float f) { - int i = this.x(); + if (!this.world.isStatic) { + int i = this.x(); - if ((i > 0 || f >= 3.0F) && (i <= 0 || f >= 7.0F)) { - this.e(-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); - } + if ((i > 0 || f >= 3.0F) && (i <= 0 || f >= 7.0F)) { + this.e(-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.e(1); - ++this.fuseTicks; - if (this.fuseTicks >= 30) { - // CraftBukkit start - CraftServer server = ((WorldServer) this.world).getServer(); + this.e(1); + ++this.fuseTicks; + if (this.fuseTicks >= 30) { + // CraftBukkit start + CraftServer server = ((WorldServer) this.world).getServer(); + + float radius = this.t() ? 6.0F : 3.0F; + ExplosionPrimeEvent event = new ExplosionPrimeEvent(CraftEntity.getEntity(server, this), radius, false); + server.getPluginManager().callEvent(event); - float radius = this.t() ? 6.0F : 3.0F; - ExplosionPrimeEvent event = new ExplosionPrimeEvent(CraftEntity.getEntity(server, this), radius, false); - server.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 - 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; + this.e = true; + } } } |