diff options
author | Thinkofname <thinkofdeath@spigotmc.org> | 2016-04-20 11:40:16 +0100 |
---|---|---|
committer | Thinkofname <thinkofdeath@spigotmc.org> | 2016-04-20 11:40:16 +0100 |
commit | 199b11bdd076cdf0cfdc66dbfa1064e57c4f2484 (patch) | |
tree | bcbee7f785131fe8b6a760400dc0d3c2e5267820 /nms-patches/EntityEnderman.patch | |
parent | a4786c824ffe175a5c7847b6ad996db428b12b91 (diff) | |
download | craftbukkit-199b11bdd076cdf0cfdc66dbfa1064e57c4f2484.tar craftbukkit-199b11bdd076cdf0cfdc66dbfa1064e57c4f2484.tar.gz craftbukkit-199b11bdd076cdf0cfdc66dbfa1064e57c4f2484.tar.lz craftbukkit-199b11bdd076cdf0cfdc66dbfa1064e57c4f2484.tar.xz craftbukkit-199b11bdd076cdf0cfdc66dbfa1064e57c4f2484.zip |
SPIGOT-2157: Fix enderman not playing their animation when attacking
Diffstat (limited to 'nms-patches/EntityEnderman.patch')
-rw-r--r-- | nms-patches/EntityEnderman.patch | 41 |
1 files changed, 39 insertions, 2 deletions
diff --git a/nms-patches/EntityEnderman.patch b/nms-patches/EntityEnderman.patch index 3292a9e7..a48336b7 100644 --- a/nms-patches/EntityEnderman.patch +++ b/nms-patches/EntityEnderman.patch @@ -1,6 +1,43 @@ --- a/net/minecraft/server/EntityEnderman.java +++ b/net/minecraft/server/EntityEnderman.java -@@ -306,8 +306,12 @@ +@@ -4,6 +4,8 @@ + import com.google.common.base.Optional; + import com.google.common.base.Predicate; + import com.google.common.collect.Sets; ++import org.bukkit.event.entity.EntityTargetEvent; ++ + import java.util.Random; + import java.util.Set; + import java.util.UUID; +@@ -55,7 +57,18 @@ + } + + public void setGoalTarget(EntityLiving entityliving) { +- super.setGoalTarget(entityliving); ++ // CraftBukkit start - fire event ++ setGoalTarget(entityliving, EntityTargetEvent.TargetReason.UNKNOWN, true); ++ } ++ ++ @Override ++ public boolean setGoalTarget(EntityLiving entityliving, org.bukkit.event.entity.EntityTargetEvent.TargetReason reason, boolean fireEvent) { ++ if (!super.setGoalTarget(entityliving, reason, fireEvent)) { ++ return false; ++ } ++ entityliving = getGoalTarget(); ++ System.out.println(entityliving); ++ // CraftBukkit end + AttributeInstance attributeinstance = this.getAttributeInstance(GenericAttributes.MOVEMENT_SPEED); + + if (entityliving == null) { +@@ -69,6 +82,7 @@ + attributeinstance.b(EntityEnderman.b); + } + } ++ return true; + + } + +@@ -306,8 +320,12 @@ boolean flag = movingobjectposition != null && movingobjectposition.a().equals(blockposition); if (EntityEnderman.c.contains(block) && flag) { @@ -15,7 +52,7 @@ } } -@@ -337,8 +341,12 @@ +@@ -337,8 +355,12 @@ IBlockData iblockdata2 = this.a.getCarried(); if (iblockdata2 != null && this.a(world, blockposition, iblockdata2.getBlock(), iblockdata, iblockdata1)) { |