mirror of
https://github.com/MCCTeam/Minecraft-Console-Client
synced 2025-10-14 21:22:49 +00:00
Added a command that executes other command if a condition is met.
This commit is contained in:
parent
59cc4cea7c
commit
77da611411
6 changed files with 126 additions and 7 deletions
|
|
@ -15,10 +15,13 @@ namespace MinecraftClient.Commands
|
|||
if (hasArg(command))
|
||||
{
|
||||
string commandsString = getArg(command);
|
||||
IEnumerable<string> commands = commandsString.Split("->")
|
||||
|
||||
if (commandsString.Contains("execmulti", StringComparison.OrdinalIgnoreCase) || commandsString.Contains("execif", StringComparison.OrdinalIgnoreCase))
|
||||
return Translations.TryGet("cmd.execmulti.prevent");
|
||||
|
||||
IEnumerable<string> commands = commandsString.Split("->", StringSplitOptions.TrimEntries)
|
||||
.ToList()
|
||||
.ConvertAll(command => command.Trim())
|
||||
.FindAll(command => !string.IsNullOrEmpty(command) || command.StartsWith("execmulti", StringComparison.OrdinalIgnoreCase));
|
||||
.FindAll(command => !string.IsNullOrEmpty(command));
|
||||
|
||||
foreach (string cmd in commands)
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue