From a585dff452b52cd32181b732bfc7f8f6af4594eb Mon Sep 17 00:00:00 2001 From: ewoudje <7384674+ewoudje@users.noreply.github.com> Date: Mon, 11 Mar 2024 18:41:40 +0100 Subject: [PATCH] Added id to @v --- .../mod/common/command/ShipArgumentParser.kt | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/common/src/main/kotlin/org/valkyrienskies/mod/common/command/ShipArgumentParser.kt b/common/src/main/kotlin/org/valkyrienskies/mod/common/command/ShipArgumentParser.kt index d35d69003..6483c2d44 100644 --- a/common/src/main/kotlin/org/valkyrienskies/mod/common/command/ShipArgumentParser.kt +++ b/common/src/main/kotlin/org/valkyrienskies/mod/common/command/ShipArgumentParser.kt @@ -138,8 +138,14 @@ class ShipArgumentParser(private val source: VSCommandSource?, private var selec .filter { it.startsWith(builder.remaining) } .forEach { builder.suggest(it) } } - "limit" -> {} + "id" -> + suggest { builder, source -> + source.shipWorld.allShips + .map { it.id.toString() } + .filter { it.startsWith(builder.remaining) } + .forEach { builder.suggest(it) } + } else -> throw ERROR_UNKNOWN_OPTION.create(option) } @@ -155,7 +161,7 @@ class ShipArgumentParser(private val source: VSCommandSource?, private var selec this.slug = slug } - + "id" -> id = reader.readLong() "limit" -> limit = reader.readInt() else -> throw ERROR_UNKNOWN_OPTION.create(option) }