From 1012db046bedc840b8db1c6486ec7f21f2e83b3f Mon Sep 17 00:00:00 2001 From: NoMathExpectation <85624722+NoMathExpectation@users.noreply.github.com> Date: Fri, 6 Mar 2026 23:32:26 +0800 Subject: [PATCH] Added RDDeprecated. --- .../rdkt/core/annotations/RDDeprecated.kt | 19 +++++++++++++++++++ .../rdkt/core/settings/CustomClasses.kt | 3 ++- 2 files changed, 21 insertions(+), 1 deletion(-) create mode 100644 core/src/commonMain/kotlin/cn/rdlevel/rdkt/core/annotations/RDDeprecated.kt diff --git a/core/src/commonMain/kotlin/cn/rdlevel/rdkt/core/annotations/RDDeprecated.kt b/core/src/commonMain/kotlin/cn/rdlevel/rdkt/core/annotations/RDDeprecated.kt new file mode 100644 index 0000000..c29131b --- /dev/null +++ b/core/src/commonMain/kotlin/cn/rdlevel/rdkt/core/annotations/RDDeprecated.kt @@ -0,0 +1,19 @@ +package cn.rdlevel.rdkt.core.annotations + +/** + * This annotation marks APIs that are not recommended for use in levels, either because they are broken, or there are better alternatives available. Use with caution. + */ +@MustBeDocumented +@Target( + AnnotationTarget.CLASS, + AnnotationTarget.FUNCTION, + AnnotationTarget.PROPERTY, + AnnotationTarget.TYPEALIAS, + AnnotationTarget.CONSTRUCTOR, +) +@Retention(AnnotationRetention.BINARY) +@RequiresOptIn( + "This API is not recommended for use in levels, either because it is broken, or there are better alternatives available. Use with caution.", + RequiresOptIn.Level.WARNING, +) +public annotation class RDDeprecated \ No newline at end of file diff --git a/core/src/commonMain/kotlin/cn/rdlevel/rdkt/core/settings/CustomClasses.kt b/core/src/commonMain/kotlin/cn/rdlevel/rdkt/core/settings/CustomClasses.kt index abd51db..0f27452 100644 --- a/core/src/commonMain/kotlin/cn/rdlevel/rdkt/core/settings/CustomClasses.kt +++ b/core/src/commonMain/kotlin/cn/rdlevel/rdkt/core/settings/CustomClasses.kt @@ -1,5 +1,6 @@ package cn.rdlevel.rdkt.core.settings +import cn.rdlevel.rdkt.core.annotations.RDDeprecated import cn.rdlevel.rdkt.core.settings.CustomClasses.INJURY @@ -56,6 +57,6 @@ public object CustomClasses { * Replaces hearts with pumpkins. * Currently, this is broken and does not work. */ - @Deprecated("This custom class is currently broken and does not work.") + @RDDeprecated public const val HALLOWEEN: String = "Halloween" } \ No newline at end of file