From f636138037f82525008696aee4cd2f7cc63dffe1 Mon Sep 17 00:00:00 2001 From: lemon <2328953346@qq.com> Date: Sat, 25 Jul 2026 18:35:54 +0800 Subject: [PATCH 1/2] fixup! --- scripts/wayzer/cmds/gatherTp.kts | 4 ++-- scripts/wayzer/user/ext/whiteList.kts | 3 ++- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/scripts/wayzer/cmds/gatherTp.kts b/scripts/wayzer/cmds/gatherTp.kts index 9a1b7e74..813c48b9 100644 --- a/scripts/wayzer/cmds/gatherTp.kts +++ b/scripts/wayzer/cmds/gatherTp.kts @@ -61,9 +61,9 @@ fun check(unit: Unit, tile: Tile): Boolean { listen { val tile = lastPos ?: return@listen if (it.message.equals("go", true)) { - it.caster.unit()?.apply { + it.player.unit()?.apply { if (!check(this, tile)) { - it.caster.sendMessage("[yellow]目标位置无法安全传送") + it.player.sendMessage("[yellow]目标位置无法安全传送") return@listen } set(tile) diff --git a/scripts/wayzer/user/ext/whiteList.kts b/scripts/wayzer/user/ext/whiteList.kts index 2135588c..69414325 100644 --- a/scripts/wayzer/user/ext/whiteList.kts +++ b/scripts/wayzer/user/ext/whiteList.kts @@ -122,7 +122,8 @@ listenTo { command("login", "统一登录") { attr(ClientOnly) body { - val player = context.caster ?: return@body + val player = player + ?: return@body openMenu(player) } } \ No newline at end of file From 5898bd9964a8106cba8780de25943a1f841c8628 Mon Sep 17 00:00:00 2001 From: lemon <2328953346@qq.com> Date: Sun, 2 Aug 2026 23:07:24 +0800 Subject: [PATCH 2/2] =?UTF-8?q?:art:(coreLib/variables)=20=E4=B8=BADate?= =?UTF-8?q?=E7=B1=BB=E5=9E=8B=E6=B7=BB=E5=8A=A0toString?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- scripts/coreLibrary/variables.kts | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/scripts/coreLibrary/variables.kts b/scripts/coreLibrary/variables.kts index 2198b6ba..526527d1 100644 --- a/scripts/coreLibrary/variables.kts +++ b/scripts/coreLibrary/variables.kts @@ -8,9 +8,11 @@ import io.github.config4k.CustomType import io.github.config4k.registerCustomType import io.github.config4k.toConfig import java.lang.management.ManagementFactory +import java.text.SimpleDateFormat import java.time.Duration import java.time.Instant import java.time.temporal.ChronoUnit +import java.util.Date import kotlin.time.toKotlinDuration name = "基础变量注册" @@ -19,6 +21,15 @@ registerVar("\\n", "换行符", "\n") registerVar("joinLines", "'join \\n'的别名", DynamicVar { VarToken("join", VarString.Parameters(it.params + "\n")) }) +registerVarForType().apply { + registerToString("格式化") { obj -> + DynamicVar { params -> + val arg = params.getOrNull(0)?.name + ?: "MM-dd" + SimpleDateFormat(arg).format(obj) + } + } +} registerVarForType().apply { registerToString("参数设定单位(天,时,分,秒,d,h,m,s,默认m)") { obj -> DynamicVar { params ->