Skip to content

Commit

Permalink
修正攻击宠物的问题
Browse files Browse the repository at this point in the history
  • Loading branch information
TartaricAcid committed Sep 11, 2024
1 parent fe0f1d2 commit 20ba987
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -50,9 +50,9 @@ default boolean canAttack(EntityMaid maid, LivingEntity target) {
if (target instanceof Player) {
return false;
}
if (target instanceof TamableAnimal tamableAnimal) {
// 有主的宠物也不攻击
return tamableAnimal.getOwnerUUID() == null;
// 有主的宠物也不攻击
if (target instanceof TamableAnimal tamableAnimal && tamableAnimal.getOwnerUUID() != null) {
return false;
}

// 判断配置文件的
Expand Down

0 comments on commit 20ba987

Please sign in to comment.