generated from AriasCreations/vsmodtemplate
Add homes list command
This commit is contained in:
parent
9522b6d941
commit
93a9a5e8bc
4 changed files with 28 additions and 3 deletions
|
@ -1,4 +1,7 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using Vintagestory.API.Common;
|
||||
using Vintagestory.API.Config;
|
||||
using Vintagestory.API.Server;
|
||||
|
@ -68,6 +71,26 @@ namespace AriasServerUtils
|
|||
return TextCommandResult.Success();
|
||||
}
|
||||
|
||||
internal static TextCommandResult HandleListHomes(TextCommandCallingArgs args)
|
||||
{
|
||||
if (args.Caller.Player is IServerPlayer isp)
|
||||
{
|
||||
PlayerStorage data = ServerUtilities.GetPlayerData(isp);
|
||||
|
||||
List<string> lTmp = new List<string>();
|
||||
foreach (var entry in data.Homes)
|
||||
{
|
||||
lTmp.Add(entry.Key);
|
||||
}
|
||||
|
||||
|
||||
ServerUtilities.SendMessageTo(isp, Lang.Get($"{ServerUtilities.MOD_ID}:home-list", data.Homes.Count, string.Join(", ", lTmp)));
|
||||
|
||||
}
|
||||
|
||||
return TextCommandResult.Success();
|
||||
}
|
||||
|
||||
internal static TextCommandResult HandleReturnItems(TextCommandCallingArgs args)
|
||||
{
|
||||
IPlayer player = args[0] as IPlayer;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue