diff --git a/eco-api/src/main/java/com/willfp/eco/core/entities/ai/goals/target/TargetGoalHurtBy.java b/eco-api/src/main/java/com/willfp/eco/core/entities/ai/goals/target/TargetGoalHurtBy.java index a66dd9c5..83a27489 100644 --- a/eco-api/src/main/java/com/willfp/eco/core/entities/ai/goals/target/TargetGoalHurtBy.java +++ b/eco-api/src/main/java/com/willfp/eco/core/entities/ai/goals/target/TargetGoalHurtBy.java @@ -9,15 +9,9 @@ import org.jetbrains.annotations.NotNull; * * @param blacklist The entities not to attack when hurt by. */ +@SuppressWarnings({"varargs", "unchecked"}) public record TargetGoalHurtBy( @NotNull Class... blacklist ) implements TargetGoal { - /** - * Hurt by entity. - * - * @param blacklist The entities not to attack when hurt by. - */ - @SafeVarargs - public TargetGoalHurtBy { - } + } diff --git a/eco-core/core-nms/v1_17_R1/src/main/kotlin/com/willfp/eco/internal/spigot/proxy/v1_17_R1/ai/EntityGoals.kt b/eco-core/core-nms/v1_17_R1/src/main/kotlin/com/willfp/eco/internal/spigot/proxy/v1_17_R1/ai/EntityGoals.kt index a12d932e..3a584d1a 100644 --- a/eco-core/core-nms/v1_17_R1/src/main/kotlin/com/willfp/eco/internal/spigot/proxy/v1_17_R1/ai/EntityGoals.kt +++ b/eco-core/core-nms/v1_17_R1/src/main/kotlin/com/willfp/eco/internal/spigot/proxy/v1_17_R1/ai/EntityGoals.kt @@ -345,6 +345,7 @@ object RangedAttackGoalFactory : EntityGoalFactory { object RangedBowAttackGoalFactory : EntityGoalFactory { override fun create(apiGoal: EntityGoalRangedBowAttack, entity: PathfinderMob): Goal? { + @Suppress("UNCHECKED_CAST") return RangedBowAttackGoal( entity.tryCastForThis() ?: return null, apiGoal.speed, @@ -359,6 +360,7 @@ object RangedBowAttackGoalFactory : EntityGoalFactory object RangedCrossbowAttackGoalFactory : EntityGoalFactory { override fun create(apiGoal: EntityGoalRangedCrossbowAttack, entity: PathfinderMob): Goal? { + @Suppress("UNCHECKED_CAST") return RangedCrossbowAttackGoal( entity.tryCastForThis() ?: return null, apiGoal.speed, diff --git a/eco-core/core-nms/v1_18_R1/src/main/kotlin/com/willfp/eco/internal/spigot/proxy/v1_18_R1/ai/EntityGoals.kt b/eco-core/core-nms/v1_18_R1/src/main/kotlin/com/willfp/eco/internal/spigot/proxy/v1_18_R1/ai/EntityGoals.kt index 59901af3..03fe4a53 100644 --- a/eco-core/core-nms/v1_18_R1/src/main/kotlin/com/willfp/eco/internal/spigot/proxy/v1_18_R1/ai/EntityGoals.kt +++ b/eco-core/core-nms/v1_18_R1/src/main/kotlin/com/willfp/eco/internal/spigot/proxy/v1_18_R1/ai/EntityGoals.kt @@ -345,6 +345,7 @@ object RangedAttackGoalFactory : EntityGoalFactory { object RangedBowAttackGoalFactory : EntityGoalFactory { override fun create(apiGoal: EntityGoalRangedBowAttack, entity: PathfinderMob): Goal? { + @Suppress("UNCHECKED_CAST") return RangedBowAttackGoal( entity.tryCastForThis() ?: return null, apiGoal.speed, @@ -359,6 +360,7 @@ object RangedBowAttackGoalFactory : EntityGoalFactory object RangedCrossbowAttackGoalFactory : EntityGoalFactory { override fun create(apiGoal: EntityGoalRangedCrossbowAttack, entity: PathfinderMob): Goal? { + @Suppress("UNCHECKED_CAST") return RangedCrossbowAttackGoal( entity.tryCastForThis() ?: return null, apiGoal.speed,