mirror of
https://github.com/CitizensDev/Citizens2.git
synced 2024-11-27 21:29:14 +01:00
Use default strategy if the attack strategy returns false
This commit is contained in:
parent
7911d70c73
commit
8457671a6e
@ -121,6 +121,8 @@ public class MCTargetStrategy implements PathStrategy, EntityTarget {
|
|||||||
if (aggro && canAttack()) {
|
if (aggro && canAttack()) {
|
||||||
AttackStrategy strategy = parameters.attackStrategy();
|
AttackStrategy strategy = parameters.attackStrategy();
|
||||||
if (strategy != null && strategy.handle((LivingEntity) handle.getBukkitEntity(), getTarget())) {
|
if (strategy != null && strategy.handle((LivingEntity) handle.getBukkitEntity(), getTarget())) {
|
||||||
|
} else if (strategy != parameters.defaultAttackStrategy()) {
|
||||||
|
parameters.defaultAttackStrategy().handle((LivingEntity) handle.getBukkitEntity(), getTarget());
|
||||||
}
|
}
|
||||||
attackTicks = ATTACK_DELAY_TICKS;
|
attackTicks = ATTACK_DELAY_TICKS;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user