From 80977e2d9e0b65a42ffb5dd451fee457c93a6289 Mon Sep 17 00:00:00 2001 From: tartaric_acid Date: Wed, 11 Sep 2024 19:23:27 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=AD=A3=E6=94=BB=E5=87=BB=E5=AE=A0?= =?UTF-8?q?=E7=89=A9=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../tartaricacid/touhoulittlemaid/api/task/IAttackTask.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/main/java/com/github/tartaricacid/touhoulittlemaid/api/task/IAttackTask.java b/src/main/java/com/github/tartaricacid/touhoulittlemaid/api/task/IAttackTask.java index 0437ce05e..7de1960fd 100644 --- a/src/main/java/com/github/tartaricacid/touhoulittlemaid/api/task/IAttackTask.java +++ b/src/main/java/com/github/tartaricacid/touhoulittlemaid/api/task/IAttackTask.java @@ -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; } // 判断配置文件的