diff options
author | Dico200 <dico.karssiens@gmail.com> | 2015-04-08 22:32:14 +0200 |
---|---|---|
committer | Dico200 <dico.karssiens@gmail.com> | 2015-04-08 22:32:14 +0200 |
commit | 201c76611911de2c5ae0afb2171dfd540de2d012 (patch) | |
tree | e36f4a87a7f7a6eafaec68a8b4c5127b95d5fbe0 /misc.py | |
parent | f7abc20ca13f6fbb637461d7a9e9bf71eb631703 (diff) |
Change to /modules... trying to make @command work.
@command throws an error when it tries to access current_subs, which
supposedly didn't exist. current_subs stores all subcommands found when
defining the method which @command was added to. (These SHOULD be called
first)
Diffstat (limited to 'misc.py')
-rw-r--r-- | misc.py | 17 |
1 files changed, 14 insertions, 3 deletions
@@ -6,6 +6,7 @@ import thread import org.bukkit.inventory.ItemStack as ItemStack import org.bukkit.Bukkit as Bukkit import org.bukkit.event.player.PlayerChatEvent as PlayerChatEvent +import basecommands from basecommands import simplecommand """ @@ -86,6 +87,18 @@ def on_me_command(sender, command, label, args): broadcast("utils.me", "&7- %s &7%s %s" % (sender.getDisplayName() if isinstance(sender, Player) else "&9CONSOLE", u"\u21E6", " ".join(args))) return None +""" +@basecommands.command("damnyou", aliases = ["dam"]) +def damnyou_command(): + + @basecommands.subcommand("me") + def me(sender, command, label, args): + info("me ran") + + @basecommands.maincommand + def main(sender, command, label, args): + info("main ran") +""" #@hook.command("gm") #def on_gm_command(sender, args): @@ -192,9 +205,7 @@ def on_modules_command(sender, command, label, args): list all modules, unloaded modules in red """ plugin_header(sender, "Modules") - for mod in shared["load_modules"]: - color = "a" if mod in shared["modules"] else "c" - msg(sender, "&" + color + mod) + msg(sender, ", ".join([(("&a" if mod in shared["modules"] else "&c") + mod) for mod in shared["load_modules"]])) @hook.event("player.PlayerTeleportEvent") |