diff options
author | GJ <gjmcferrin@gmail.com> | 2014-02-05 11:56:37 -0500 |
---|---|---|
committer | Travis Watkins <amaranth@ubuntu.com> | 2014-04-18 10:43:06 -0500 |
commit | 890a4af12fce9c28dcc69aebf14078420293dc00 (patch) | |
tree | 05a1f7938e78c3040aac869a25678c07750c7b13 /src/main/java/net/minecraft/server/EntityWolf.java | |
parent | 3abba823151c87050fb7680c3a7194eb1fe5d64d (diff) | |
download | craftbukkit-890a4af12fce9c28dcc69aebf14078420293dc00.tar craftbukkit-890a4af12fce9c28dcc69aebf14078420293dc00.tar.gz craftbukkit-890a4af12fce9c28dcc69aebf14078420293dc00.tar.lz craftbukkit-890a4af12fce9c28dcc69aebf14078420293dc00.tar.xz craftbukkit-890a4af12fce9c28dcc69aebf14078420293dc00.zip |
[Bleeding] Call EntityTargetEvent in many new places.
Adds BUKKIT-5388, BUKKIT-5387, BUKKIT-5386, BUKKIT-5483, BUKKIT-5484.
Fixes BUKKIT-5389.
Diffstat (limited to 'src/main/java/net/minecraft/server/EntityWolf.java')
-rw-r--r-- | src/main/java/net/minecraft/server/EntityWolf.java | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/src/main/java/net/minecraft/server/EntityWolf.java b/src/main/java/net/minecraft/server/EntityWolf.java index 9a4e0c4c..b992d084 100644 --- a/src/main/java/net/minecraft/server/EntityWolf.java +++ b/src/main/java/net/minecraft/server/EntityWolf.java @@ -1,5 +1,10 @@ package net.minecraft.server; +// CraftBukkit start +import org.bukkit.craftbukkit.event.CraftEventFactory; +import org.bukkit.event.entity.EntityTargetEvent.TargetReason; +// CraftBukkit end + public class EntityWolf extends EntityTameableAnimal { private float bq; @@ -236,6 +241,11 @@ public class EntityWolf extends EntityTameableAnimal { this.bc = false; this.setPathEntity((PathEntity) null); this.setTarget((Entity) null); + // CraftBukkit start + if (this.getGoalTarget() != null) { + CraftEventFactory.callEntityTargetEvent(this, null, TargetReason.FORGOT_TARGET); + } + // CraftBukkit end this.setGoalTarget((EntityLiving) null); } } else if (itemstack != null && itemstack.getItem() == Items.BONE && !this.isAngry()) { @@ -249,9 +259,14 @@ public class EntityWolf extends EntityTameableAnimal { if (!this.world.isStatic) { // CraftBukkit - added event call and isCancelled check. - if (this.random.nextInt(3) == 0 && !org.bukkit.craftbukkit.event.CraftEventFactory.callEntityTameEvent(this, entityhuman).isCancelled()) { + if (this.random.nextInt(3) == 0 && !CraftEventFactory.callEntityTameEvent(this, entityhuman).isCancelled()) { this.setTamed(true); this.setPathEntity((PathEntity) null); + // CraftBukkit start + if (this.getGoalTarget() != null) { + CraftEventFactory.callEntityTargetEvent(this, null, TargetReason.FORGOT_TARGET); + } + // CraftBukkit end this.setGoalTarget((EntityLiving) null); this.bp.setSitting(true); this.setHealth(this.getMaxHealth()); // CraftBukkit - 20.0 -> getMaxHealth() |