generated from AriasCreations/vsmodtemplate
parent
8d875653e0
commit
c269066a26
5 changed files with 213 additions and 7 deletions
|
@ -560,7 +560,15 @@ namespace AriasServerUtils
|
|||
{
|
||||
if (isp.HasPrivilege(Privilege.controlserver) || !ServerUtilities.config.onlyAdminsCreateWarps)
|
||||
{
|
||||
int cost = ServerUtilities.config.cmdCosts.costs[CommandCosts.CostType.setwarp];
|
||||
|
||||
bool withMount = false;
|
||||
if (args.Command.Name == "setwarpmount")
|
||||
{
|
||||
// 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 balance = RustyGearUtils.CountRustyGears(isp);
|
||||
if (cost > 0)
|
||||
{
|
||||
|
@ -575,7 +583,7 @@ namespace AriasServerUtils
|
|||
return TextCommandResult.Success();
|
||||
}
|
||||
}
|
||||
ServerUtilities.serverWarps.warps[name] = Warp.Create(isp);
|
||||
ServerUtilities.serverWarps.warps[name] = Warp.Create(isp, withMount);
|
||||
ServerUtilities.MarkDirty();
|
||||
|
||||
ServerUtilities.SendMessageTo(isp, Lang.Get($"{ServerUtilities.MOD_ID}:warp-set", name));
|
||||
|
@ -835,5 +843,101 @@ namespace AriasServerUtils
|
|||
byPlayer.Entity.World.SpawnItemEntity(new ItemStack(byPlayer.Entity.World.GetBlock(new AssetLocation($"soil-{farmlandType}-none"))), blockSel.Position.ToVec3d().Add(0.5, 0.5, 0.5));
|
||||
}
|
||||
}
|
||||
|
||||
internal static TextCommandResult HandleASUUpdateCmdCostReset(TextCommandCallingArgs args)
|
||||
{
|
||||
ServerUtilities.config.cmdCosts = new CommandCosts();
|
||||
ServerUtilities.config.cmdCosts.SanityCheck();
|
||||
ServerUtilities.MarkDirty();
|
||||
|
||||
return TextCommandResult.Success(Lang.Get($"{ServerUtilities.MOD_ID}:cost-reset"));
|
||||
}
|
||||
|
||||
private static void UpdateCost(CommandCosts.CostType cost, TextCommandCallingArgs args)
|
||||
{
|
||||
if (args[0] is int newCost)
|
||||
{
|
||||
// Update the cost
|
||||
ServerUtilities.config.cmdCosts.costs[cost] = newCost;
|
||||
ServerUtilities.MarkDirty();
|
||||
}
|
||||
}
|
||||
|
||||
internal static TextCommandResult HandleASUUpdateCommandCostSpawn(TextCommandCallingArgs args)
|
||||
{
|
||||
UpdateCost(CommandCosts.CostType.spawn, args);
|
||||
|
||||
return TextCommandResult.Success(Lang.Get($"{ServerUtilities.MOD_ID}:updatedconfig"));
|
||||
}
|
||||
|
||||
internal static TextCommandResult HandleASUUpdateCommandCostRTP(TextCommandCallingArgs args)
|
||||
{
|
||||
UpdateCost(CommandCosts.CostType.rtp, args);
|
||||
|
||||
return TextCommandResult.Success(Lang.Get($"{ServerUtilities.MOD_ID}:updatedconfig"));
|
||||
}
|
||||
|
||||
internal static TextCommandResult HandleASUUpdateCommandCostBack(TextCommandCallingArgs args)
|
||||
{
|
||||
UpdateCost(CommandCosts.CostType.back, args);
|
||||
|
||||
return TextCommandResult.Success(Lang.Get($"{ServerUtilities.MOD_ID}:updatedconfig"));
|
||||
}
|
||||
|
||||
internal static TextCommandResult HandleASUUpdateCommandCostSetHome(TextCommandCallingArgs args)
|
||||
{
|
||||
UpdateCost(CommandCosts.CostType.sethome, args);
|
||||
|
||||
return TextCommandResult.Success(Lang.Get($"{ServerUtilities.MOD_ID}:updatedconfig"));
|
||||
}
|
||||
|
||||
internal static TextCommandResult HandleASUUpdateCommandCostHome(TextCommandCallingArgs args)
|
||||
{
|
||||
UpdateCost(CommandCosts.CostType.home, args);
|
||||
|
||||
return TextCommandResult.Success(Lang.Get($"{ServerUtilities.MOD_ID}:updatedconfig"));
|
||||
}
|
||||
|
||||
internal static TextCommandResult HandleASUUpdateCommandCostDelHome(TextCommandCallingArgs args)
|
||||
{
|
||||
UpdateCost(CommandCosts.CostType.delhome, args);
|
||||
|
||||
return TextCommandResult.Success(Lang.Get($"{ServerUtilities.MOD_ID}:updatedconfig"));
|
||||
}
|
||||
|
||||
internal static TextCommandResult HandleASUUpdateCommandCostSetHomeMount(TextCommandCallingArgs args)
|
||||
{
|
||||
UpdateCost(CommandCosts.CostType.sethomemount, args);
|
||||
|
||||
return TextCommandResult.Success(Lang.Get($"{ServerUtilities.MOD_ID}:updatedconfig"));
|
||||
}
|
||||
|
||||
internal static TextCommandResult HandleASUUpdateCommandCostWarp(TextCommandCallingArgs args)
|
||||
{
|
||||
UpdateCost(CommandCosts.CostType.warp, args);
|
||||
|
||||
return TextCommandResult.Success(Lang.Get($"{ServerUtilities.MOD_ID}:updatedconfig"));
|
||||
}
|
||||
|
||||
internal static TextCommandResult HandleASUUpdateCommandCostSetWarp(TextCommandCallingArgs args)
|
||||
{
|
||||
UpdateCost(CommandCosts.CostType.setwarp, args);
|
||||
|
||||
return TextCommandResult.Success(Lang.Get($"{ServerUtilities.MOD_ID}:updatedconfig"));
|
||||
}
|
||||
|
||||
internal static TextCommandResult HandleASUUpdateCommandCostDelWarp(TextCommandCallingArgs args)
|
||||
{
|
||||
UpdateCost(CommandCosts.CostType.delwarp, args);
|
||||
|
||||
return TextCommandResult.Success(Lang.Get($"{ServerUtilities.MOD_ID}:updatedconfig"));
|
||||
}
|
||||
|
||||
internal static TextCommandResult HandleASUUpdateCommandCostSetWarpMount(TextCommandCallingArgs args)
|
||||
{
|
||||
UpdateCost(CommandCosts.CostType.setwarpmount, args);
|
||||
|
||||
return TextCommandResult.Success(Lang.Get($"{ServerUtilities.MOD_ID}:updatedconfig"));
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue