Skip to content

Commit fcb0298

Browse files
Update SetDisplayNameMethod.cs
1 parent 93644ab commit fcb0298

File tree

1 file changed

+6
-7
lines changed

1 file changed

+6
-7
lines changed

MethodSystem/Methods/PlayerMethods/SetDisplayNameMethod.cs

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,26 +5,25 @@
55
using System.Collections.Generic;
66

77
namespace SER.MethodSystem.Methods.PlayerMethods;
8+
89
public class SetDisplayNameMethod : SynchronousMethod
910
{
1011
public override string Description => "Sets display name for specified players";
1112

1213
public override Argument[] ExpectedArguments =>
1314
[
1415
new PlayersArgument("players"),
15-
new TextArgument("displayname")
16+
new TextArgument("display name")
1617
{
1718
Description = "Leave empty quotes if you want to remove display name from players"
1819
}
1920
];
2021

2122
public override void Execute()
2223
{
23-
string disp = Args.GetText("displayname");
24-
List<Player> pls = Args.GetPlayers("players");
25-
foreach(Player p in pls)
26-
{
27-
p.DisplayName = disp;
28-
}
24+
List<Player> players = Args.GetPlayers("players");
25+
string displayName = Args.GetText("display name");
26+
27+
players.ForEach(p => p.DisplayName = displayName);
2928
}
3029
}

0 commit comments

Comments
 (0)