diff --git a/build.gradle.kts b/build.gradle.kts index dafc44e..b81906d 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -7,7 +7,7 @@ plugins { } group = "top.e404" -version = "1.18.0" +version = "1.18.1" val epluginVer = "1.3.0" fun eplugin(module: String, version: String = epluginVer) = "top.e404:eplugin-$module:$version" diff --git a/src/main/kotlin/clean/Clean.kt b/src/main/kotlin/clean/Clean.kt index 69fed7e..006f71c 100644 --- a/src/main/kotlin/clean/Clean.kt +++ b/src/main/kotlin/clean/Clean.kt @@ -30,12 +30,20 @@ object Clean { } task = PL.runTaskTimer(20, 20) { count++ - if (noOnline && noOnlineMessage) { + if (noOnline) { + if (noOnlineMessage) { + Config.config.message[duration - count]?.let { PL.broadcastMsg(it) } + } + } else { Config.config.message[duration - count]?.let { PL.broadcastMsg(it) } } if (count >= duration) { count = 0 - if (noOnline && noOnlineClean) { + if (noOnline) { + if (noOnlineClean) { + clean() + } + } else { clean() } } diff --git a/src/main/kotlin/clean/chunk.kt b/src/main/kotlin/clean/chunk.kt index 1484786..1352165 100644 --- a/src/main/kotlin/clean/chunk.kt +++ b/src/main/kotlin/clean/chunk.kt @@ -47,7 +47,12 @@ fun cleanDenseEntities() { PL.debug { "密集实体清理共${lastChunk}个, 耗时${time}ms" } - if (noOnline && noOnlineMessage) { + if (noOnline) { + if (noOnlineMessage) { + val finish = Config.config.chunk.finish + if (finish.isNotBlank()) PL.broadcastMsg(finish.placeholder("clean" to lastChunk)) + } + } else { val finish = Config.config.chunk.finish if (finish.isNotBlank()) PL.broadcastMsg(finish.placeholder("clean" to lastChunk)) } diff --git a/src/main/kotlin/clean/drop.kt b/src/main/kotlin/clean/drop.kt index ffb40e1..8c34e29 100644 --- a/src/main/kotlin/clean/drop.kt +++ b/src/main/kotlin/clean/drop.kt @@ -45,7 +45,13 @@ fun cleanDrop() { lastDrop = result.sumOf { it.first } PL.debug { "掉落物清理共${lastDrop}个, 耗时${time}ms" } - if (noOnline && noOnlineMessage) { + if (noOnline) { + if (noOnlineMessage) { + val all = result.sumOf { it.second } + val finish = dropCfg.finish + if (finish.isNotBlank()) PL.broadcastMsg(finish.placeholder("clean" to lastDrop, "all" to all)) + } + } else { val all = result.sumOf { it.second } val finish = dropCfg.finish if (finish.isNotBlank()) PL.broadcastMsg(finish.placeholder("clean" to lastDrop, "all" to all)) diff --git a/src/main/kotlin/clean/living.kt b/src/main/kotlin/clean/living.kt index 9829b50..5cb22f7 100644 --- a/src/main/kotlin/clean/living.kt +++ b/src/main/kotlin/clean/living.kt @@ -45,7 +45,13 @@ fun cleanLiving() { lastLiving = result.sumOf { it.first } PL.debug { "生物清理共${lastLiving}个, 耗时${time}ms" } - if (noOnline && noOnlineMessage) { + if (noOnline) { + if (noOnlineMessage) { + val all = result.sumOf { it.second } + val finish = livingCfg.finish + if (finish.isNotBlank()) PL.broadcastMsg(finish.placeholder(mapOf("clean" to lastLiving, "all" to all))) + } + } else { val all = result.sumOf { it.second } val finish = livingCfg.finish if (finish.isNotBlank()) PL.broadcastMsg(finish.placeholder(mapOf("clean" to lastLiving, "all" to all)))