summaryrefslogtreecommitdiffstats
path: root/nms-patches/EntityInsentient.patch
diff options
context:
space:
mode:
authorThinkofname <thinkofdeath@spigotmc.org>2016-04-20 11:40:16 +0100
committerThinkofname <thinkofdeath@spigotmc.org>2016-04-20 11:40:16 +0100
commit199b11bdd076cdf0cfdc66dbfa1064e57c4f2484 (patch)
treebcbee7f785131fe8b6a760400dc0d3c2e5267820 /nms-patches/EntityInsentient.patch
parenta4786c824ffe175a5c7847b6ad996db428b12b91 (diff)
downloadcraftbukkit-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/EntityInsentient.patch')
-rw-r--r--nms-patches/EntityInsentient.patch21
1 files changed, 11 insertions, 10 deletions
diff --git a/nms-patches/EntityInsentient.patch b/nms-patches/EntityInsentient.patch
index a7de7164..fc63698e 100644
--- a/nms-patches/EntityInsentient.patch
+++ b/nms-patches/EntityInsentient.patch
@@ -26,7 +26,7 @@
}
protected void r() {}
-@@ -110,7 +122,37 @@
+@@ -110,7 +122,38 @@
}
public void setGoalTarget(EntityLiving entityliving) {
@@ -34,8 +34,8 @@
+ setGoalTarget(entityliving, EntityTargetEvent.TargetReason.UNKNOWN, true);
+ }
+
-+ public void setGoalTarget(EntityLiving entityliving, EntityTargetEvent.TargetReason reason, boolean fireEvent) {
-+ if (getGoalTarget() == entityliving) return;
++ public boolean setGoalTarget(EntityLiving entityliving, EntityTargetEvent.TargetReason reason, boolean fireEvent) {
++ if (getGoalTarget() == entityliving) return false;
+ if (fireEvent) {
+ if (reason == EntityTargetEvent.TargetReason.UNKNOWN && getGoalTarget() != null && entityliving == null) {
+ reason = getGoalTarget().isAlive() ? EntityTargetEvent.TargetReason.FORGOT_TARGET : EntityTargetEvent.TargetReason.TARGET_DIED;
@@ -50,7 +50,7 @@
+ EntityTargetLivingEntityEvent event = new EntityTargetLivingEntityEvent(this.getBukkitEntity(), ctarget, reason);
+ world.getServer().getPluginManager().callEvent(event);
+ if (event.isCancelled()) {
-+ return;
++ return false;
+ }
+
+ if (event.getTarget() != null) {
@@ -60,11 +60,12 @@
+ }
+ }
this.goalTarget = entityliving;
++ return true;
+ // CraftBukkit end
}
public boolean d(Class<? extends EntityLiving> oclass) {
-@@ -321,11 +363,20 @@
+@@ -321,11 +364,20 @@
public void a(NBTTagCompound nbttagcompound) {
super.a(nbttagcompound);
@@ -87,7 +88,7 @@
NBTTagList nbttaglist;
int i;
-@@ -549,11 +600,11 @@
+@@ -549,11 +601,11 @@
double d2 = entityhuman.locZ - this.locZ;
double d3 = d0 * d0 + d1 * d1 + d2 * d2;
@@ -101,7 +102,7 @@
this.die();
} else if (d3 < 1024.0D) {
this.ticksFarFromPlayer = 0;
-@@ -931,9 +982,21 @@
+@@ -931,9 +983,21 @@
public final boolean a(EntityHuman entityhuman, ItemStack itemstack, EnumHand enumhand) {
if (this.isLeashed() && this.getLeashHolder() == entityhuman) {
@@ -123,7 +124,7 @@
this.setLeashHolder(entityhuman, true);
--itemstack.count;
return true;
-@@ -953,10 +1016,12 @@
+@@ -953,10 +1017,12 @@
if (this.bC) {
if (!this.isAlive()) {
@@ -136,7 +137,7 @@
this.unleash(true, true);
}
}
-@@ -967,7 +1032,9 @@
+@@ -967,7 +1033,9 @@
this.bC = false;
this.leashHolder = null;
if (!this.world.isClientSide && flag1) {
@@ -146,7 +147,7 @@
}
if (!this.world.isClientSide && flag && this.world instanceof WorldServer) {
-@@ -1037,6 +1104,7 @@
+@@ -1037,6 +1105,7 @@
this.leashHolder = entityleash;
} else {