diff options
author | feildmaster <admin@feildmaster.com> | 2012-07-29 02:33:13 -0500 |
---|---|---|
committer | Travis Watkins <amaranth@ubuntu.com> | 2012-08-02 04:58:50 -0500 |
commit | a43d621c0138110d2ec362b2eaa8f938f241bb49 (patch) | |
tree | d2ebc0d7a4a969d3257b1b958236428a24117eb1 /src/main/java/net/minecraft/server/PathfinderGoalBreakDoor.java | |
parent | 08e2923bd4282579ca0cf7af0e6207cba0591e5c (diff) | |
download | craftbukkit-a43d621c0138110d2ec362b2eaa8f938f241bb49.tar craftbukkit-a43d621c0138110d2ec362b2eaa8f938f241bb49.tar.gz craftbukkit-a43d621c0138110d2ec362b2eaa8f938f241bb49.tar.lz craftbukkit-a43d621c0138110d2ec362b2eaa8f938f241bb49.tar.xz craftbukkit-a43d621c0138110d2ec362b2eaa8f938f241bb49.zip |
Update CraftBukkit to Minecraft 1.3.1
Diffstat (limited to 'src/main/java/net/minecraft/server/PathfinderGoalBreakDoor.java')
-rw-r--r-- | src/main/java/net/minecraft/server/PathfinderGoalBreakDoor.java | 35 |
1 files changed, 25 insertions, 10 deletions
diff --git a/src/main/java/net/minecraft/server/PathfinderGoalBreakDoor.java b/src/main/java/net/minecraft/server/PathfinderGoalBreakDoor.java index d97834b5..b9620ecb 100644 --- a/src/main/java/net/minecraft/server/PathfinderGoalBreakDoor.java +++ b/src/main/java/net/minecraft/server/PathfinderGoalBreakDoor.java @@ -3,39 +3,54 @@ package net.minecraft.server; public class PathfinderGoalBreakDoor extends PathfinderGoalDoorInteract { private int i; + private int j = -1; public PathfinderGoalBreakDoor(EntityLiving entityliving) { super(entityliving); } public boolean a() { - return !super.a() ? false : !this.e.d(this.a.world, this.b, this.c, this.d); + return !super.a() ? false : !this.e.a_(this.a.world, this.b, this.c, this.d); } - public void c() { - super.c(); - this.i = 240; + public void e() { + super.e(); + this.i = 0; } public boolean b() { double d0 = this.a.e((double) this.b, (double) this.c, (double) this.d); - return this.i >= 0 && !this.e.d(this.a.world, this.b, this.c, this.d) && d0 < 4.0D; + return this.i <= 240 && !this.e.a_(this.a.world, this.b, this.c, this.d) && d0 < 4.0D; } - public void e() { - super.e(); - if (this.a.an().nextInt(20) == 0) { + public void c() { + super.c(); + this.a.world.f(this.a.id, this.b, this.c, this.d, -1); + } + + public void d() { + super.d(); + if (this.a.au().nextInt(20) == 0) { this.a.world.triggerEffect(1010, this.b, this.c, this.d, 0); } - if (--this.i == 0 && this.a.world.difficulty == 3) { + ++this.i; + int i = (int) ((float) this.i / 240.0F * 10.0F); + + if (i != this.j) { + this.a.world.f(this.a.id, this.b, this.c, this.d, i); + this.j = i; + } + + if (this.i == 240 && this.a.world.difficulty == 3) { // CraftBukkit start if (org.bukkit.craftbukkit.event.CraftEventFactory.callEntityBreakDoorEvent(this.a, this.b, this.c, this.d).isCancelled()) { - this.c(); + this.e(); return; } // CraftBukkit end + this.a.world.setTypeId(this.b, this.c, this.d, 0); this.a.world.triggerEffect(1012, this.b, this.c, this.d, 0); this.a.world.triggerEffect(2001, this.b, this.c, this.d, this.e.id); |