mirror of
https://github.com/PaperMC/Paper.git
synced 2025-01-02 09:21:57 +01:00
SPIGOT-7788: The healing power of friendship advancement is never granted
By: md_5 <git@md-5.net>
This commit is contained in:
parent
2f1800fa2e
commit
d67f71f3f4
1 changed files with 3 additions and 4 deletions
|
@ -13,7 +13,7 @@
|
|||
public class BehaviorAttackTargetForget {
|
||||
|
||||
private static final int TIMEOUT_TO_GET_WITHIN_ATTACK_RANGE = 200;
|
||||
@@ -41,6 +47,18 @@
|
||||
@@ -41,6 +47,17 @@
|
||||
if (entityinsentient.canAttack(entityliving) && (!flag || !isTiredOfTryingToReachTarget(entityinsentient, behaviorbuilder_b.tryGet(memoryaccessor1))) && entityliving.isAlive() && entityliving.level() == entityinsentient.level() && !predicate.test(entityliving)) {
|
||||
return true;
|
||||
} else {
|
||||
|
@ -23,11 +23,10 @@
|
|||
+ if (event.isCancelled()) {
|
||||
+ return false;
|
||||
+ }
|
||||
+ if (event.getTarget() == null) {
|
||||
+ memoryaccessor.erase();
|
||||
+ if (event.getTarget() != null) {
|
||||
+ entityinsentient.getBrain().setMemory(MemoryModuleType.ATTACK_TARGET, ((CraftLivingEntity) event.getTarget()).getHandle());
|
||||
+ return true;
|
||||
+ }
|
||||
+ entityliving = ((CraftLivingEntity) event.getTarget()).getHandle();
|
||||
+ // CraftBukkit end
|
||||
biconsumer.accept(entityinsentient, entityliving);
|
||||
memoryaccessor.erase();
|
||||
|
|
Loading…
Reference in a new issue