From 8b207fdf78cae4c139f9167c2dc3f8147fb67092 Mon Sep 17 00:00:00 2001 From: CraftBukkit/Spigot Date: Wed, 8 May 2019 02:18:05 +0200 Subject: [PATCH] SPIGOT-4893: Don't reset angry state of wolves without target. Wolves will 'silently' lose their target when teleporting between dimensions or the chunk getting reloaded. To reset the angry state in those cases, the check got moved into the loading method. By: blablubbabc --- paper-server/nms-patches/EntityWolf.patch | 29 +++++++++++++++++++---- 1 file changed, 25 insertions(+), 4 deletions(-) diff --git a/paper-server/nms-patches/EntityWolf.patch b/paper-server/nms-patches/EntityWolf.patch index 7c4744339..b7f7fcc2a 100644 --- a/paper-server/nms-patches/EntityWolf.patch +++ b/paper-server/nms-patches/EntityWolf.patch @@ -44,7 +44,28 @@ @Override public void setGoalTarget(@Nullable EntityLiving entityliving) { super.setGoalTarget(entityliving); -@@ -217,7 +238,8 @@ +@@ -101,6 +122,11 @@ + public void a(NBTTagCompound nbttagcompound) { + super.a(nbttagcompound); + this.setAngry(nbttagcompound.getBoolean("Angry")); ++ // CraftBukkit start - moved from below, SPIGOT-4893 ++ if (this.getGoalTarget() == null && this.isAngry()) { ++ this.setAngry(false); ++ } ++ // CraftBukkit end + if (nbttagcompound.hasKeyOfType("CollarColor", 99)) { + this.setCollarColor(EnumColor.fromColorIndex(nbttagcompound.getInt("CollarColor"))); + } +@@ -137,7 +163,7 @@ + this.world.broadcastEntityEffect(this, (byte) 8); + } + +- if (!this.world.isClientSide && this.getGoalTarget() == null && this.isAngry()) { ++ if (false && !this.world.isClientSide && this.getGoalTarget() == null && this.isAngry()) { // CraftBukkit - SPIGOT-4893 + this.setAngry(false); + } + +@@ -217,7 +243,8 @@ Entity entity = damagesource.getEntity(); if (this.goalSit != null) { @@ -54,7 +75,7 @@ } if (entity != null && !(entity instanceof EntityHuman) && !(entity instanceof EntityArrow)) { -@@ -264,7 +286,7 @@ +@@ -264,7 +291,7 @@ itemstack.subtract(1); } @@ -63,7 +84,7 @@ return true; } } else if (item instanceof ItemDye) { -@@ -285,7 +307,7 @@ +@@ -285,7 +312,7 @@ this.goalSit.setSitting(!this.isSitting()); this.jumping = false; this.navigation.o(); @@ -72,7 +93,7 @@ } } else if (item == Items.BONE && !this.isAngry()) { if (!entityhuman.abilities.canInstantlyBuild) { -@@ -293,12 +315,13 @@ +@@ -293,12 +320,13 @@ } if (!this.world.isClientSide) {