generated from AriasCreations/vsmodtemplate
Make max distance arg optional
This commit is contained in:
parent
a9150cf322
commit
9f7edc64c3
3 changed files with 4 additions and 3 deletions
|
@ -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()
|
||||
|
|
|
@ -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));
|
||||
|
|
|
@ -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": ""
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue