From 4aebf33006efc049215761fe7dfb8f301bd66018 Mon Sep 17 00:00:00 2001 From: Wilee999 Date: Thu, 16 May 2013 12:18:39 -0600 Subject: [PATCH 1/5] Added a broadcast to /purgeall --- .../TotalFreedomMod/Commands/Command_purgeall.java | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/me/StevenLawson/TotalFreedomMod/Commands/Command_purgeall.java b/src/me/StevenLawson/TotalFreedomMod/Commands/Command_purgeall.java index 29a42662..3e759410 100644 --- a/src/me/StevenLawson/TotalFreedomMod/Commands/Command_purgeall.java +++ b/src/me/StevenLawson/TotalFreedomMod/Commands/Command_purgeall.java @@ -1,5 +1,8 @@ package me.StevenLawson.TotalFreedomMod.Commands; +import me.StevenLawson.TotalFreedomMod.TFM_Util; + +import org.bukkit.ChatColor; import org.bukkit.command.Command; import org.bukkit.command.CommandSender; import org.bukkit.entity.Player; @@ -20,8 +23,10 @@ public class Command_purgeall extends TFM_Command server.dispatchCommand(sender, "mp"); server.dispatchCommand(sender, "blockcmd"); server.dispatchCommand(sender, "halt purge"); + + TFM_Util.bcastMsg("[Purge] Purged!", ChatColor.LIGHT_PURPLE); //If I'm missing any, lemme know. Or just add it yourself. return true; } -} \ No newline at end of file +} From 31b5c99007eab39b4a53ee0d833bfb6611c99c22 Mon Sep 17 00:00:00 2001 From: Wilee999 Date: Thu, 16 May 2013 12:19:47 -0600 Subject: [PATCH 2/5] Added broadcast to /spurgeall --- .../TotalFreedomMod/Commands/Command_spurgeall.java | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/me/StevenLawson/TotalFreedomMod/Commands/Command_spurgeall.java b/src/me/StevenLawson/TotalFreedomMod/Commands/Command_spurgeall.java index 147b419a..c6f5dd99 100644 --- a/src/me/StevenLawson/TotalFreedomMod/Commands/Command_spurgeall.java +++ b/src/me/StevenLawson/TotalFreedomMod/Commands/Command_spurgeall.java @@ -1,5 +1,8 @@ package me.StevenLawson.TotalFreedomMod.Commands; +import me.StevenLawson.TotalFreedomMod.TFM_Util; + +import org.bukkit.ChatColor; import org.bukkit.command.Command; import org.bukkit.command.CommandSender; import org.bukkit.entity.Player; @@ -21,9 +24,11 @@ public class Command_spurgeall extends TFM_Command server.dispatchCommand(sender, "blockcmd"); server.dispatchCommand(sender, "halt purge"); server.dispatchCommand(sender, "lockup purge"); + + TFM_Util.bcastMsg("[Purge] Purged!", ChatColor.LIGHT_PURPLE); //If I'm missing any, lemme know. Or just add it yourself. return true; } -} \ No newline at end of file +} From 6abd2491f19c103f68bed2116977a955f516ef27 Mon Sep 17 00:00:00 2001 From: Wilee999 Date: Thu, 16 May 2013 12:28:28 -0600 Subject: [PATCH 3/5] Removed /denick from /spurgeall --- .../StevenLawson/TotalFreedomMod/Commands/Command_spurgeall.java | 1 - 1 file changed, 1 deletion(-) diff --git a/src/me/StevenLawson/TotalFreedomMod/Commands/Command_spurgeall.java b/src/me/StevenLawson/TotalFreedomMod/Commands/Command_spurgeall.java index c6f5dd99..da053ad1 100644 --- a/src/me/StevenLawson/TotalFreedomMod/Commands/Command_spurgeall.java +++ b/src/me/StevenLawson/TotalFreedomMod/Commands/Command_spurgeall.java @@ -17,7 +17,6 @@ public class Command_spurgeall extends TFM_Command server.dispatchCommand(sender, "rd"); server.dispatchCommand(sender, "potion clearall"); server.dispatchCommand(sender, "uall"); - server.dispatchCommand(sender, "denick"); server.dispatchCommand(sender, "mute purge"); server.dispatchCommand(sender, "fr purge"); server.dispatchCommand(sender, "mp"); From aea65815a860e565fb1e7360d0f998e68761dc2e Mon Sep 17 00:00:00 2001 From: Wilee999 Date: Thu, 16 May 2013 12:29:06 -0600 Subject: [PATCH 4/5] removed /denick from /purgeall --- .../StevenLawson/TotalFreedomMod/Commands/Command_purgeall.java | 1 - 1 file changed, 1 deletion(-) diff --git a/src/me/StevenLawson/TotalFreedomMod/Commands/Command_purgeall.java b/src/me/StevenLawson/TotalFreedomMod/Commands/Command_purgeall.java index 3e759410..f80c6694 100644 --- a/src/me/StevenLawson/TotalFreedomMod/Commands/Command_purgeall.java +++ b/src/me/StevenLawson/TotalFreedomMod/Commands/Command_purgeall.java @@ -17,7 +17,6 @@ public class Command_purgeall extends TFM_Command server.dispatchCommand(sender, "rd"); server.dispatchCommand(sender, "potion clearall"); server.dispatchCommand(sender, "uall"); - server.dispatchCommand(sender, "denick"); server.dispatchCommand(sender, "mute purge"); server.dispatchCommand(sender, "fr purge"); server.dispatchCommand(sender, "mp"); From d2457adf68314723ae4dddf52d44b71be2423d49 Mon Sep 17 00:00:00 2001 From: Wilee999 Date: Thu, 16 May 2013 12:31:22 -0600 Subject: [PATCH 5/5] Create Command_cmdlist.java --- .../Commands/Command_cmdlist.java | 51 +++++++++++++++++++ 1 file changed, 51 insertions(+) create mode 100644 src/me/StevenLawson/TotalFreedomMod/Commands/Command_cmdlist.java diff --git a/src/me/StevenLawson/TotalFreedomMod/Commands/Command_cmdlist.java b/src/me/StevenLawson/TotalFreedomMod/Commands/Command_cmdlist.java new file mode 100644 index 00000000..70a111b6 --- /dev/null +++ b/src/me/StevenLawson/TotalFreedomMod/Commands/Command_cmdlist.java @@ -0,0 +1,51 @@ +package me.StevenLawson.TotalFreedomMod.Commands; + +import java.util.ArrayList; +import java.util.Collections; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import org.apache.commons.lang.StringUtils; +import org.bukkit.command.Command; +import org.bukkit.command.CommandSender; +import org.bukkit.entity.Player; +import org.bukkit.plugin.Plugin; +import org.bukkit.plugin.PluginDescriptionFile; + +@CommandPermissions(level = AdminLevel.ALL, source = SourceType.BOTH) +@CommandParameters(description = "Show all commands for all server plugins.", usage = "/") +public class Command_cmdlist extends TFM_Command +{ + @Override + public boolean run(CommandSender sender, Player sender_p, Command cmd, String commandLabel, String[] args, boolean senderIsConsole) + { + List commands = new ArrayList(); + + for (Plugin p : server.getPluginManager().getPlugins()) + { + try + { + PluginDescriptionFile desc = p.getDescription(); + Map> map = (Map>) desc.getCommands(); + + if (map != null) + { + for (Entry> entry : map.entrySet()) + { + String command_name = (String) entry.getKey(); + commands.add(command_name); + } + } + } + catch (Throwable ex) + { + } + } + + Collections.sort(commands); + + sender.sendMessage(StringUtils.join(commands, ",")); + + return true; + } +}