diff options
author | Taylor Kelly <tkelly910@gmail.com> | 2011-01-26 14:26:24 -0500 |
---|---|---|
committer | Taylor Kelly <tkelly910@gmail.com> | 2011-01-26 14:26:24 -0500 |
commit | c07e32c1de57898d5f7ad2fbfa0800d65fc20f5a (patch) | |
tree | 5bbc5a84094a38e0e098d5d1d4f9e21432e4d8f8 /src/main/java/net/minecraft/server/EntitySpider.java | |
parent | 0ba870434ea7ec6e75652cad0b3fb6b9d240bbb6 (diff) | |
download | craftbukkit-c07e32c1de57898d5f7ad2fbfa0800d65fc20f5a.tar craftbukkit-c07e32c1de57898d5f7ad2fbfa0800d65fc20f5a.tar.gz craftbukkit-c07e32c1de57898d5f7ad2fbfa0800d65fc20f5a.tar.lz craftbukkit-c07e32c1de57898d5f7ad2fbfa0800d65fc20f5a.tar.xz craftbukkit-c07e32c1de57898d5f7ad2fbfa0800d65fc20f5a.zip |
EntityTargetEvent
Diffstat (limited to 'src/main/java/net/minecraft/server/EntitySpider.java')
-rw-r--r-- | src/main/java/net/minecraft/server/EntitySpider.java | 18 |
1 files changed, 16 insertions, 2 deletions
diff --git a/src/main/java/net/minecraft/server/EntitySpider.java b/src/main/java/net/minecraft/server/EntitySpider.java index 1d1c746c..77bd7eb4 100644 --- a/src/main/java/net/minecraft/server/EntitySpider.java +++ b/src/main/java/net/minecraft/server/EntitySpider.java @@ -4,7 +4,10 @@ import java.util.Random; // CraftBukkit start import org.bukkit.craftbukkit.CraftServer; +import org.bukkit.craftbukkit.entity.CraftEntity; import org.bukkit.craftbukkit.entity.CraftSpider; +import org.bukkit.event.entity.EntityTargetEvent; +import org.bukkit.event.entity.EntityTargetEvent.TargetReason; // CraftBukkit stop public class EntitySpider extends EntityMobs { @@ -52,8 +55,19 @@ public class EntitySpider extends EntityMobs { float f2 = b(1.0F); if (f2 > 0.5F && W.nextInt(100) == 0) { - this.d = null; - return; + // CraftBukkit start + EntityTargetEvent event = new EntityTargetEvent(this.getBukkitEntity(), null, TargetReason.FORGOT_TARGET); + CraftServer server = ((WorldServer) this.l).getServer(); + server.getPluginManager().callEvent(event); + if(!event.isCancelled()) { + if(event.getTarget() == null) { + this.d = null; + } else { + this.d = ((CraftEntity) event.getTarget()).getHandle(); + } + return; + } + // CraftBukkit end } if (f1 > 2.0F && f1 < 6F && W.nextInt(10) == 0) { if (A) { |