diff options
Diffstat (limited to 'patches/server/0383-Improve-fix-EntityTargetLivingEntityEvent.patch')
-rw-r--r-- | patches/server/0383-Improve-fix-EntityTargetLivingEntityEvent.patch | 17 |
1 files changed, 2 insertions, 15 deletions
diff --git a/patches/server/0383-Improve-fix-EntityTargetLivingEntityEvent.patch b/patches/server/0383-Improve-fix-EntityTargetLivingEntityEvent.patch index 513faeb27d..29703174a1 100644 --- a/patches/server/0383-Improve-fix-EntityTargetLivingEntityEvent.patch +++ b/patches/server/0383-Improve-fix-EntityTargetLivingEntityEvent.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Improve/fix EntityTargetLivingEntityEvent diff --git a/src/main/java/net/minecraft/world/entity/ai/behavior/StopAttackingIfTargetInvalid.java b/src/main/java/net/minecraft/world/entity/ai/behavior/StopAttackingIfTargetInvalid.java -index 5aeef564cdaabeed88a52635e56073cca3a9d1f1..fe635e46569c67dac1d3581ee930d1bfa8b4030e 100644 +index cc7d161b53a2295fa1745254eafb8a70c7b6c7b2..508d4f391fe563453d7bf6782b3082741c358006 100644 --- a/src/main/java/net/minecraft/world/entity/ai/behavior/StopAttackingIfTargetInvalid.java +++ b/src/main/java/net/minecraft/world/entity/ai/behavior/StopAttackingIfTargetInvalid.java -@@ -47,17 +47,30 @@ public class StopAttackingIfTargetInvalid { +@@ -47,9 +47,22 @@ public class StopAttackingIfTargetInvalid { if (entityinsentient.canAttack(entityliving) && (!shouldForgetIfTargetUnreachable || !StopAttackingIfTargetInvalid.isTiredOfTryingToReachTarget(entityinsentient, behaviorbuilder_b.tryGet(memoryaccessor1))) && entityliving.isAlive() && entityliving.level() == entityinsentient.level() && !alternativeCondition.test(entityliving)) { return true; } else { @@ -33,16 +33,3 @@ index 5aeef564cdaabeed88a52635e56073cca3a9d1f1..fe635e46569c67dac1d3581ee930d1bf if (event.isCancelled()) { return false; } -- if (event.getTarget() == null) { -- memoryaccessor.erase(); -- return true; -- } -- entityliving = ((CraftLivingEntity) event.getTarget()).getHandle(); -+ // if (event.getTarget() == null) { // Paper - this is wrong, you are skipping the forgetCallback -+ // memoryaccessor.erase(); -+ // return true; -+ // } -+ // entityliving = ((CraftLivingEntity) event.getTarget()).getHandle(); - // CraftBukkit end - forgetCallback.accept(entityinsentient, entityliving); - memoryaccessor.erase(); |