From 38fed28abf22a9476ca7db4d1b2707b2492c2156 Mon Sep 17 00:00:00 2001 From: UnknownShadow200 Date: Tue, 6 Sep 2016 18:51:23 +1000 Subject: [PATCH] Add /bots [level] (Thanks goodlyay) --- Commands/Bots/CmdBots.cs | 11 ++++++++++- Commands/Economy/CmdAwards.cs | 2 +- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/Commands/Bots/CmdBots.cs b/Commands/Bots/CmdBots.cs index 310c8d4e4..438f764b0 100644 --- a/Commands/Bots/CmdBots.cs +++ b/Commands/Bots/CmdBots.cs @@ -30,7 +30,15 @@ namespace MCGalaxy.Commands { StringBuilder text = new StringBuilder(); PlayerBot[] bots = PlayerBot.Bots.Items; + Level lvl = null; + if (message != "") { + lvl = LevelInfo.FindMatches(p, message); + if (lvl == null) return; + } + foreach (PlayerBot bot in bots) { + if (lvl != null && bot.level != lvl) continue; + text.Append(", ").Append(bot.name) .Append("(").Append(bot.level.name).Append(")"); @@ -42,11 +50,12 @@ namespace MCGalaxy.Commands { if (text.Length > 0) Player.Message(p, "&1Bots: %S" + text.ToString(2, text.Length - 2)); else - Player.Message(p, "No bots are alive."); + Player.Message(p, "There are no bots."); } public override void Help(Player p) { Player.Message(p, "%T/bots %H- Shows a list of bots, their AIs and levels"); + Player.Message(p, "%T/bots [level] %H- Only shows bots on the given level"); } } } diff --git a/Commands/Economy/CmdAwards.cs b/Commands/Economy/CmdAwards.cs index e9a2af0fa..8ef44ea94 100644 --- a/Commands/Economy/CmdAwards.cs +++ b/Commands/Economy/CmdAwards.cs @@ -1,7 +1,7 @@ /* Copyright 2010 MCSharp team (Modified for use with MCZall/MCLawl/MCGalaxy) - Dual-licensed under the Educational Community License, Version 2.0 and + Dual-licensed under the educational Community License, Version 2.0 and the GNU General Public License, Version 3 (the "Licenses"); you may not use this file except in compliance with the Licenses. You may obtain a copy of the Licenses at