mirror of
https://github.com/PaperMC/Paper.git
synced 2025-01-06 18:50:51 +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 {
|
public class BehaviorAttackTargetForget {
|
||||||
|
|
||||||
private static final int TIMEOUT_TO_GET_WITHIN_ATTACK_RANGE = 200;
|
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)) {
|
if (entityinsentient.canAttack(entityliving) && (!flag || !isTiredOfTryingToReachTarget(entityinsentient, behaviorbuilder_b.tryGet(memoryaccessor1))) && entityliving.isAlive() && entityliving.level() == entityinsentient.level() && !predicate.test(entityliving)) {
|
||||||
return true;
|
return true;
|
||||||
} else {
|
} else {
|
||||||
|
@ -23,11 +23,10 @@
|
||||||
+ if (event.isCancelled()) {
|
+ if (event.isCancelled()) {
|
||||||
+ return false;
|
+ return false;
|
||||||
+ }
|
+ }
|
||||||
+ if (event.getTarget() == null) {
|
+ if (event.getTarget() != null) {
|
||||||
+ memoryaccessor.erase();
|
+ entityinsentient.getBrain().setMemory(MemoryModuleType.ATTACK_TARGET, ((CraftLivingEntity) event.getTarget()).getHandle());
|
||||||
+ return true;
|
+ return true;
|
||||||
+ }
|
+ }
|
||||||
+ entityliving = ((CraftLivingEntity) event.getTarget()).getHandle();
|
|
||||||
+ // CraftBukkit end
|
+ // CraftBukkit end
|
||||||
biconsumer.accept(entityinsentient, entityliving);
|
biconsumer.accept(entityinsentient, entityliving);
|
||||||
memoryaccessor.erase();
|
memoryaccessor.erase();
|
||||||
|
|
Loading…
Reference in a new issue