From eeed4f55ed8bc83146720f1ff9acd37a5c26872a Mon Sep 17 00:00:00 2001 From: s0127943 Date: Thu, 14 Oct 2021 18:05:38 +0200 Subject: [PATCH] Fixed cockatrice targeting players in spectator mode Resolves #4069, #3987 TODO: Make cockatrice patrol an area #3660 --- .../github/alexthe666/iceandfire/entity/EntityCockatrice.java | 2 +- .../alexthe666/iceandfire/entity/ai/CockatriceAIAggroLook.java | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/java/com/github/alexthe666/iceandfire/entity/EntityCockatrice.java b/src/main/java/com/github/alexthe666/iceandfire/entity/EntityCockatrice.java index 23ba3c668..aa03912c5 100644 --- a/src/main/java/com/github/alexthe666/iceandfire/entity/EntityCockatrice.java +++ b/src/main/java/com/github/alexthe666/iceandfire/entity/EntityCockatrice.java @@ -140,7 +140,7 @@ public boolean apply(@Nullable Entity entity) { })); this.goalSelector.removeGoal(aiMelee); } - + //TODO: Make cockatrice patrol an area public boolean detachHome() { return this.hasHomePosition && this.getCommand() == 3 || super.detachHome(); } diff --git a/src/main/java/com/github/alexthe666/iceandfire/entity/ai/CockatriceAIAggroLook.java b/src/main/java/com/github/alexthe666/iceandfire/entity/ai/CockatriceAIAggroLook.java index 7a813dbcb..c9da49da1 100644 --- a/src/main/java/com/github/alexthe666/iceandfire/entity/ai/CockatriceAIAggroLook.java +++ b/src/main/java/com/github/alexthe666/iceandfire/entity/ai/CockatriceAIAggroLook.java @@ -57,7 +57,7 @@ public void resetTask() { * Returns whether an in-progress Goal should continue executing */ public boolean shouldContinueExecuting() { - if (this.player != null && !this.player.isCreative()) { + if (this.player != null && !this.player.isCreative() && !this.player.isSpectator()) { if (!EntityGorgon.isEntityLookingAt(this.player, this.cockatrice, 0.4F)) { return false; } else {