From 9f7edc64c380b46c0c886534a06539987d060cb6 Mon Sep 17 00:00:00 2001 From: zontreck Date: Fri, 7 Mar 2025 01:16:03 -0700 Subject: [PATCH] Make max distance arg optional --- AriasServerUtils/ASUModSystem.cs | 2 +- AriasServerUtils/EventHandler.cs | 1 + AriasServerUtils/modinfo.json | 4 ++-- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/AriasServerUtils/ASUModSystem.cs b/AriasServerUtils/ASUModSystem.cs index bdefbaf..f52be58 100644 --- a/AriasServerUtils/ASUModSystem.cs +++ b/AriasServerUtils/ASUModSystem.cs @@ -210,7 +210,7 @@ namespace AriasServerUtils api.ChatCommands.Create("back").RequiresPlayer().RequiresPrivilege(Privilege.chat).WithDescription("Returns you to the last location you were at").HandleWith(Events.HandleBack); - api.ChatCommands.Create("rtp").RequiresPlayer().RequiresPrivilege(Privilege.chat).WithArgs(parsers.Int("maxDist")).WithDescription("Seeks a position possibly thousands of blocks away to teleport to.").HandleWith(Events.HandleRTP); + api.ChatCommands.Create("rtp").RequiresPlayer().RequiresPrivilege(Privilege.chat).WithArgs(parsers.OptionalInt("maxDist", defaultValue: -1)).WithDescription("Seeks a position possibly thousands of blocks away to teleport to.").HandleWith(Events.HandleRTP); } private void OnCheckPlayerCooldowns() diff --git a/AriasServerUtils/EventHandler.cs b/AriasServerUtils/EventHandler.cs index f74b377..740276f 100644 --- a/AriasServerUtils/EventHandler.cs +++ b/AriasServerUtils/EventHandler.cs @@ -57,6 +57,7 @@ namespace AriasServerUtils int maxDistance = ServerUtilities.config.MaxRTPBlockDistance; if (args[0] is int ix) { + if (ix == -1) ix = maxDistance; if (ix > maxDistance) { ServerUtilities.SendMessageTo(isp, Lang.Get($"{ServerUtilities.MOD_ID}:rtp-capped", ix, maxDistance)); diff --git a/AriasServerUtils/modinfo.json b/AriasServerUtils/modinfo.json index 028e657..aed5cbf 100644 --- a/AriasServerUtils/modinfo.json +++ b/AriasServerUtils/modinfo.json @@ -3,8 +3,8 @@ "modid": "ariasserverutils", "name": "Aria's Server Utilities", "authors": ["zontreck"], - "description": "A collection of server utilities\n\nBuild Date: 03-07-2025 @ 00:52 AM MST", - "version": "1.0.5-dev.1", + "description": "A collection of server utilities\n\nBuild Date: 03-07-2025 @ 1:15 AM MST", + "version": "1.0.5-dev.2", "dependencies": { "game": "" }