diff --git a/README.md b/README.md index ea7d7d3..a95de50 100644 --- a/README.md +++ b/README.md @@ -9,5 +9,5 @@ taboolib{ relocate("ink.ptms.um","xx.um") } -taboo("ink.ptms:um:1.0.8") +taboo("ink.ptms:um:1.1.1") ``` diff --git a/build.gradle.kts b/build.gradle.kts index efaa274..0e420da 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -3,7 +3,7 @@ import org.jetbrains.kotlin.gradle.tasks.KotlinCompile plugins { id("org.gradle.java") id("org.gradle.maven-publish") - id("org.jetbrains.kotlin.jvm") version "1.8.22" apply false + id("org.jetbrains.kotlin.jvm") version "1.9.22" apply false } subprojects { @@ -52,4 +52,4 @@ publishing { gradle.buildFinished { buildDir.deleteRecursively() -} \ No newline at end of file +} diff --git a/project/common/build.gradle.kts b/project/common/build.gradle.kts index efa7790..9daadad 100644 --- a/project/common/build.gradle.kts +++ b/project/common/build.gradle.kts @@ -30,4 +30,4 @@ dependencies { configure { sourceCompatibility = JavaVersion.VERSION_1_8 targetCompatibility = JavaVersion.VERSION_1_8 -} \ No newline at end of file +} diff --git a/project/implementation-v4/src/main/kotlin/ink/ptms/um/impl4/Mob.kt b/project/implementation-v4/src/main/kotlin/ink/ptms/um/impl4/Mob.kt index ada179f..06bc9fb 100644 --- a/project/implementation-v4/src/main/kotlin/ink/ptms/um/impl4/Mob.kt +++ b/project/implementation-v4/src/main/kotlin/ink/ptms/um/impl4/Mob.kt @@ -4,7 +4,6 @@ import ink.ptms.um.Mob import ink.ptms.um.MobType import io.lumine.xikage.mythicmobs.MythicMobs import io.lumine.xikage.mythicmobs.mobs.ActiveMob -import io.lumine.xikage.mythicmobs.mobs.MythicMob import org.bukkit.entity.Entity import org.bukkit.entity.EntityType import org.bukkit.entity.LivingEntity diff --git a/project/implementation-v4/src/main/kotlin/ink/ptms/um/impl4/MobConfiguration.kt b/project/implementation-v4/src/main/kotlin/ink/ptms/um/impl4/MobConfiguration.kt index c1e18da..c1d5175 100644 --- a/project/implementation-v4/src/main/kotlin/ink/ptms/um/impl4/MobConfiguration.kt +++ b/project/implementation-v4/src/main/kotlin/ink/ptms/um/impl4/MobConfiguration.kt @@ -89,7 +89,9 @@ internal class MobConfiguration(val config: MythicConfig) : ConfigurationSection } override fun getConfigurationSection(path: String): ConfigurationSection? { - return root.getConfigurationSection("$name.$path")?.let { MobConfiguration(MythicConfig("$name.$path", root)) } + return root.getConfigurationSection("$name.$path")?.let { + MobConfiguration(MythicConfig("$name.$path", root)) + } } override fun getDouble(path: String): Double { @@ -219,4 +221,4 @@ internal class MobConfiguration(val config: MythicConfig) : ConfigurationSection override fun toMap(): Map { error("Unsupported") } -} \ No newline at end of file +} diff --git a/project/implementation-v4/src/main/kotlin/ink/ptms/um/impl4/Mythic4.kt b/project/implementation-v4/src/main/kotlin/ink/ptms/um/impl4/Mythic4.kt index c9caad7..3b6e130 100644 --- a/project/implementation-v4/src/main/kotlin/ink/ptms/um/impl4/Mythic4.kt +++ b/project/implementation-v4/src/main/kotlin/ink/ptms/um/impl4/Mythic4.kt @@ -48,7 +48,9 @@ internal class Mythic4 : Mythic { val skillManager: SkillManager by unsafeLazy { api.skillManager } - internal val mmList: ConcurrentHashMap = mobManager.getProperty>("mmList")!! + val mmList: ConcurrentHashMap by unsafeLazy { + mobManager.getProperty>("mmList")!! + } override val isLegacy = true diff --git a/project/implementation-v5/build.gradle.kts b/project/implementation-v5/build.gradle.kts index 5a15398..e49f693 100644 --- a/project/implementation-v5/build.gradle.kts +++ b/project/implementation-v5/build.gradle.kts @@ -39,4 +39,4 @@ tasks.withType { kotlinOptions { jvmTarget = "11" } -} \ No newline at end of file +} diff --git a/project/implementation-v5/src/main/kotlin/ink/ptms/um/impl5/MobConfiguration.kt b/project/implementation-v5/src/main/kotlin/ink/ptms/um/impl5/MobConfiguration.kt index 9e6f8a9..545c84d 100644 --- a/project/implementation-v5/src/main/kotlin/ink/ptms/um/impl5/MobConfiguration.kt +++ b/project/implementation-v5/src/main/kotlin/ink/ptms/um/impl5/MobConfiguration.kt @@ -219,4 +219,4 @@ internal class MobConfiguration(sourceConfig: MythicConfig) : ConfigurationSecti override fun toMap(): Map { error("Unsupported") } -} \ No newline at end of file +} diff --git a/project/implementation-v5/src/main/kotlin/ink/ptms/um/impl5/Mythic5.kt b/project/implementation-v5/src/main/kotlin/ink/ptms/um/impl5/Mythic5.kt index 6d1fd63..359b440 100644 --- a/project/implementation-v5/src/main/kotlin/ink/ptms/um/impl5/Mythic5.kt +++ b/project/implementation-v5/src/main/kotlin/ink/ptms/um/impl5/Mythic5.kt @@ -24,6 +24,7 @@ import taboolib.common.LifeCycle import taboolib.common.platform.Awake import taboolib.common.util.orNull import taboolib.library.reflex.Reflex.Companion.getProperty +import taboolib.library.reflex.Reflex.Companion.invokeMethod import taboolib.module.nms.getItemTag import java.io.File import java.util.* @@ -40,7 +41,9 @@ internal class Mythic5 : Mythic { val api: MythicBukkit get() = MythicProvider.get() as MythicBukkit - val mmList: MutableMap = api.mobManager.getProperty>("mmList")!! + val mmList: MutableMap by lazy { + api.mobManager.getProperty>("mmList")!! + } override val isLegacy = false @@ -84,11 +87,13 @@ internal class Mythic5 : Mythic { } override fun getSkillTrigger(name: String): Skill.Trigger { - return Skill5.Trigger(SkillTrigger.get(name.uppercase())) + val invokeMethod = Class.forName(SkillTrigger::class.java.name).invokeMethod("get", name.uppercase(), isStatic = true) ?: return getDefaultSkillTrigger() + return Skill5.Trigger(invokeMethod) } override fun getDefaultSkillTrigger(): Skill.Trigger { - return Skill5.Trigger(SkillTrigger.get("DEFAULT")) + val invokeMethod = Class.forName(SkillTrigger::class.java.name).invokeMethod("get", "DEFAULT", isStatic = true) + return Skill5.Trigger(invokeMethod!!) } override fun getSkillMechanic(skillLine: String): Skill? { @@ -156,4 +161,4 @@ internal class Mythic5 : Mythic { } } } -} \ No newline at end of file +}