Skip to content

Commit

Permalink
Make /plugins output paginated
Browse files Browse the repository at this point in the history
  • Loading branch information
UnknownShadow200 committed Jul 22, 2021
1 parent 1204c8c commit 855c5f7
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
2 changes: 1 addition & 1 deletion MCGalaxy/Commands/Information/CmdLevels.cs
Expand Up @@ -33,7 +33,7 @@ public sealed class CmdLevels : Command2 {
// Files list is not guaranteed to be in alphabetical order
Array.Sort(files);

p.Message("Levels (&c[no] &Sif not visitable): ");
p.Message("Levels (&c[no] &Sif not visitable):");
MultiPageOutput.Output(p, files, (file) => FormatMap(p, file),
"Levels", "levels", message, false);
}
Expand Down
11 changes: 7 additions & 4 deletions MCGalaxy/Commands/Scripting/CmdPlugin.cs
Expand Up @@ -32,12 +32,15 @@ public sealed class CmdPlugin : Command2 {
public override bool MessageBlockRestricted { get { return true; } }

public override void Use(Player p, string message, CommandData data) {
if (IsListCommand(message)) {
p.Message("Loaded plugins: " + Plugin.all.Join(pl => pl.name));
string[] args = message.SplitSpaces(3);
if (IsListCommand(args[0])) {
string modifier = args.Length > 1 ? args[1] : "";

p.Message("Loaded plugins:");
MultiPageOutput.Output(p, Plugin.all, pl => pl.name,
"Plugins", "plugins", modifier, false);
return;
}

string[] args = message.SplitSpaces(3);
if (args.Length == 1) { Help(p); return; }

string cmd = args[0], name = args[1];
Expand Down

0 comments on commit 855c5f7

Please sign in to comment.