diff --git a/MCGalaxy/Commands/Information/CmdBlocks.cs b/MCGalaxy/Commands/Information/CmdBlocks.cs index a12151120..c9f380e74 100644 --- a/MCGalaxy/Commands/Information/CmdBlocks.cs +++ b/MCGalaxy/Commands/Information/CmdBlocks.cs @@ -39,25 +39,19 @@ namespace MCGalaxy.Commands if (args[0] == "" || args[0].CaselessEq("basic")) { Player.Message(p, "Basic blocks: "); - MultiPageOutput.Output(p, BasicBlocks(), (name, i) => name, + MultiPageOutput.Output(p, BasicBlocks(), FormatBlockName, "blocks basic", "blocks", modifier, false); } else if (args[0].CaselessEq("all") || args[0].CaselessEq("complex")) { Player.Message(p, "Complex blocks: "); - MultiPageOutput.Output(p, ComplexBlocks(), (name, i) => name, + MultiPageOutput.Output(p, ComplexBlocks(), FormatBlockName, "blocks complex", "blocks", modifier, false); } else if (Block.Byte(args[0]) != Block.Invalid) { OutputBlockData(p, args[0]); } else if (Group.Find(args[0]) != null) { Group grp = Group.Find(args[0]); - List blocks = RankBlocks(grp.Permission); - - if (blocks.Count == 0) { - Player.Message(p, "{0} %Scannot modify any blocks.", grp.ColoredName); - } else { - Player.Message(p, "Blocks which {0} %Scan place: ", grp.ColoredName); - MultiPageOutput.Output(p, blocks, (name, i) => name, - "blocks " + args[0], "blocks", modifier, false); - } + Player.Message(p, "Blocks which {0} %Scan place: ", grp.ColoredName); + MultiPageOutput.Output(p, RankBlocks(grp.Permission), FormatBlockName, + "blocks " + args[0], "blocks", modifier, false); } else if (args.Length > 1) { Help(p); } else { @@ -92,6 +86,13 @@ namespace MCGalaxy.Commands } + internal static string FormatBlockName(string block, int i) { + Block.Blocks perms = Block.BlockList[Block.Byte(block)]; + Group grp = Group.findPerm(perms.lowestRank); + string col = grp == null ? "&f" : grp.color; + return col + block; + } + static void OutputBlockData(Player p, string block) { byte b = Block.Byte(block); if (b >= Block.CpeCount) { diff --git a/MCGalaxy/Commands/Information/CmdSearch.cs b/MCGalaxy/Commands/Information/CmdSearch.cs index 1e479f382..76e37242a 100644 --- a/MCGalaxy/Commands/Information/CmdSearch.cs +++ b/MCGalaxy/Commands/Information/CmdSearch.cs @@ -61,12 +61,7 @@ namespace MCGalaxy.Commands { } OutputList(p, keyword, "search blocks", "blocks", - modifier, blocks, FormatBlockName); - } - - static string FormatBlockName(string block, int i) { - string prefix = (i & 1) == 0 ? "&2" : "&9"; - return prefix + block; + modifier, blocks, CmdBlocks.FormatBlockName); } static void SearchCommands(Player p, string keyword, string modifier) { diff --git a/MCGalaxy/Commands/Moderation/CmdTempRank.cs b/MCGalaxy/Commands/Moderation/CmdTempRank.cs index 61e2fa9e2..699d43146 100644 --- a/MCGalaxy/Commands/Moderation/CmdTempRank.cs +++ b/MCGalaxy/Commands/Moderation/CmdTempRank.cs @@ -164,7 +164,7 @@ namespace MCGalaxy.Commands.Moderation { Player.Message(p, "%H e.g. to temprank for 90 minutes, [timespan] would be %S1h30m"); Player.Message(p, "%T/temprank [player] info"); Player.Message(p, "%HLists information about the temp rank for the given player."); - Player.Message(p, "%T/temprank delete %H- Removes player's temp rank."); + Player.Message(p, "%T/temprank [player] delete %H- Removes player's temp rank."); Player.Message(p, "%T/temprank list %H- Lists all current temp ranks."); } } diff --git a/MCGalaxy/util/Utils.cs b/MCGalaxy/util/Utils.cs index da86ae9b4..874e611b8 100644 --- a/MCGalaxy/util/Utils.cs +++ b/MCGalaxy/util/Utils.cs @@ -15,13 +15,10 @@ or implied. See the Licenses for the specific language governing permissions and limitations under the Licenses. */ -using System; -using System.Collections; -using System.Collections.Generic; -using System.Globalization; -using System.IO; -using System.IO.Compression; -using System.Text; +using System; +using System.Collections; +using System.Globalization; +using System.Text; namespace MCGalaxy { public static class Utils {