From 98d9097ba5cae36b7d46c04f11c1c78fe170eded Mon Sep 17 00:00:00 2001 From: zontreck Date: Sat, 7 Jun 2025 13:56:53 -0700 Subject: [PATCH] Release 1.1.0 Fix setwarpmount cost. Fix #6 --- AriasServerUtils/EventHandler.cs | 46 +++++++++++++++++++++++--------- AriasServerUtils/modinfo.json | 4 +-- 2 files changed, 36 insertions(+), 14 deletions(-) diff --git a/AriasServerUtils/EventHandler.cs b/AriasServerUtils/EventHandler.cs index d8a2dc7..0f297b4 100644 --- a/AriasServerUtils/EventHandler.cs +++ b/AriasServerUtils/EventHandler.cs @@ -567,7 +567,7 @@ namespace AriasServerUtils // Check for the gears and pay here, or show error. withMount = true; } - int cost = ServerUtilities.config.cmdCosts.costs[withMount ? CommandCosts.CostType.sethomemount : CommandCosts.CostType.setwarp]; + int cost = ServerUtilities.config.cmdCosts.costs[withMount ? CommandCosts.CostType.setwarpmount : CommandCosts.CostType.setwarp]; int balance = RustyGearUtils.CountRustyGears(isp); if (cost > 0) @@ -867,77 +867,99 @@ namespace AriasServerUtils { UpdateCost(CommandCosts.CostType.spawn, args); - return TextCommandResult.Success(Lang.Get($"{ServerUtilities.MOD_ID}:updatedconfig")); + int cost = 0; + if (args[0] is int nc) cost = nc; + return TextCommandResult.Success(Lang.Get($"{ServerUtilities.MOD_ID}:updatedconfig", cost)); } internal static TextCommandResult HandleASUUpdateCommandCostRTP(TextCommandCallingArgs args) { UpdateCost(CommandCosts.CostType.rtp, args); - return TextCommandResult.Success(Lang.Get($"{ServerUtilities.MOD_ID}:updatedconfig")); + int cost = 0; + if (args[0] is int nc) cost = nc; + return TextCommandResult.Success(Lang.Get($"{ServerUtilities.MOD_ID}:updatedconfig", cost)); } internal static TextCommandResult HandleASUUpdateCommandCostBack(TextCommandCallingArgs args) { UpdateCost(CommandCosts.CostType.back, args); - return TextCommandResult.Success(Lang.Get($"{ServerUtilities.MOD_ID}:updatedconfig")); + int cost = 0; + if (args[0] is int nc) cost = nc; + return TextCommandResult.Success(Lang.Get($"{ServerUtilities.MOD_ID}:updatedconfig", cost)); } internal static TextCommandResult HandleASUUpdateCommandCostSetHome(TextCommandCallingArgs args) { UpdateCost(CommandCosts.CostType.sethome, args); - return TextCommandResult.Success(Lang.Get($"{ServerUtilities.MOD_ID}:updatedconfig")); + int cost = 0; + if (args[0] is int nc) cost = nc; + return TextCommandResult.Success(Lang.Get($"{ServerUtilities.MOD_ID}:updatedconfig", cost)); } internal static TextCommandResult HandleASUUpdateCommandCostHome(TextCommandCallingArgs args) { UpdateCost(CommandCosts.CostType.home, args); - return TextCommandResult.Success(Lang.Get($"{ServerUtilities.MOD_ID}:updatedconfig")); + int cost = 0; + if (args[0] is int nc) cost = nc; + return TextCommandResult.Success(Lang.Get($"{ServerUtilities.MOD_ID}:updatedconfig", cost)); } internal static TextCommandResult HandleASUUpdateCommandCostDelHome(TextCommandCallingArgs args) { UpdateCost(CommandCosts.CostType.delhome, args); - return TextCommandResult.Success(Lang.Get($"{ServerUtilities.MOD_ID}:updatedconfig")); + int cost = 0; + if (args[0] is int nc) cost = nc; + return TextCommandResult.Success(Lang.Get($"{ServerUtilities.MOD_ID}:updatedconfig", cost)); } internal static TextCommandResult HandleASUUpdateCommandCostSetHomeMount(TextCommandCallingArgs args) { UpdateCost(CommandCosts.CostType.sethomemount, args); - return TextCommandResult.Success(Lang.Get($"{ServerUtilities.MOD_ID}:updatedconfig")); + int cost = 0; + if (args[0] is int nc) cost = nc; + return TextCommandResult.Success(Lang.Get($"{ServerUtilities.MOD_ID}:updatedconfig", cost)); } internal static TextCommandResult HandleASUUpdateCommandCostWarp(TextCommandCallingArgs args) { UpdateCost(CommandCosts.CostType.warp, args); - return TextCommandResult.Success(Lang.Get($"{ServerUtilities.MOD_ID}:updatedconfig")); + int cost = 0; + if (args[0] is int nc) cost = nc; + return TextCommandResult.Success(Lang.Get($"{ServerUtilities.MOD_ID}:updatedconfig", cost)); } internal static TextCommandResult HandleASUUpdateCommandCostSetWarp(TextCommandCallingArgs args) { UpdateCost(CommandCosts.CostType.setwarp, args); - return TextCommandResult.Success(Lang.Get($"{ServerUtilities.MOD_ID}:updatedconfig")); + int cost = 0; + if (args[0] is int nc) cost = nc; + return TextCommandResult.Success(Lang.Get($"{ServerUtilities.MOD_ID}:updatedconfig", cost)); } internal static TextCommandResult HandleASUUpdateCommandCostDelWarp(TextCommandCallingArgs args) { UpdateCost(CommandCosts.CostType.delwarp, args); - return TextCommandResult.Success(Lang.Get($"{ServerUtilities.MOD_ID}:updatedconfig")); + int cost = 0; + if (args[0] is int nc) cost = nc; + return TextCommandResult.Success(Lang.Get($"{ServerUtilities.MOD_ID}:updatedconfig", cost)); } internal static TextCommandResult HandleASUUpdateCommandCostSetWarpMount(TextCommandCallingArgs args) { UpdateCost(CommandCosts.CostType.setwarpmount, args); - return TextCommandResult.Success(Lang.Get($"{ServerUtilities.MOD_ID}:updatedconfig")); + int cost = 0; + if (args[0] is int nc) cost = nc; + return TextCommandResult.Success(Lang.Get($"{ServerUtilities.MOD_ID}:updatedconfig", cost)); } } } \ No newline at end of file diff --git a/AriasServerUtils/modinfo.json b/AriasServerUtils/modinfo.json index 017e0f3..174454d 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: 06-07-2025 @ 1:47 PM MST", - "version": "1.1.0-dev.8", + "description": "A collection of server utilities\n\nBuild Date: 06-07-2025 @ 1:56 PM MST", + "version": "1.1.0", "dependencies": { "game": "" }