Commit Graph

44 Commits

Author SHA1 Message Date
Score_Under
ede3fd278d Add tab-completion API. Fixes BUKKIT-2181. Adds BUKKIT-2602
CommandMap contains a method that will auto-complete commands
appropriately. Before the first space, it searches for commands of which
the sender has permission. After the first space, it delegates to the
individual command.

Vanilla commands contain implementations to mimic vanilla
implementation. Exception would be give, that allows for name matching;
a feature we already allowed as part of the command is now supported for
auto-complete as well.

Plugin commands can get a tab completer set to delegate the completion
for. If no tab completer is set, it can check the executor to see if it
implements the tab completion interface. It will also attempt to chain
calls if null gets returned from these interfaces. Plugins also
implement the new TabCompleter interface, to add ease-of-use for plugin
developers, similar to the onCommand() method.

The default command implementation simply searches for player names.

To help facilitate command completion, a utility class was added with
two functions. One checks two strings, to see if the specified string
starts with (ignoring case) the second. The other method uses the first
to selectively copy elements from one collection to another.
2012-10-16 00:05:40 -05:00
feildmaster
110ad8c196 Update Bukkit for 1.3.1 changes 2012-08-02 04:54:21 -05:00
rmichela
bba2e1cd2f [Bleeding] Added Help API. Addresses BUKKIT-863 2012-03-01 04:28:21 -05:00
Tahg
3d4c2010eb Added timings command. 2012-01-09 23:44:17 -05:00
EvilSeph
187a961d2e Added banlist command. Fixes BUKKIT-373. Thanks md-5! 2012-01-07 19:54:02 -05:00
Erik Broes
dce83b6ce4 Generic cleanup of warnings, whitespace and style. 2011-12-25 16:02:30 +01:00
Nathan Adams
d8e3602925 Added /xp and /toggledownfall commands from vanilla 2011-12-02 06:38:33 +00:00
Nathan Adams
5700db0ea7 Few more style cleanups 2011-10-11 02:16:44 +01:00
EvilSeph
39c0d81832 Added GameMode command. 2011-09-14 17:43:11 -04:00
Dinnerbone
0914132467 Moved all vanilla commands into Bukkit 2011-09-03 15:56:35 +01:00
Dinnerbone
0484a8bd84 Added the ability to access offline players & more reverse lookup fixes in Permissible. 2011-09-03 00:41:22 +01:00
Dinnerbone
20dd09d983 Some small fixes to permissions to register the correct Permissible in base and more accurate reverse lookups 2011-09-02 23:39:01 +01:00
Dinnerbone
8831a00b4e Commands now have the ability to set a permission required before execution 2011-09-02 19:27:12 +01:00
EvilSeph
fb3e9605d8 Fixed 'bad aliases' error output. 2011-06-23 16:16:14 -04:00
Dinnerbone
7524109bf0 The server config can now specify aliases to multiple (or none) commands, for example "debug: [version, plugin]" to run both version and plugin, or "plugins: []" to disable the plugins command 2011-06-22 19:08:21 +01:00
Dinnerbone
95484bba53 Server administrators can now specify custom aliases in bukkit.yml which override any aliases set by plugins. 2011-06-17 04:07:17 +01:00
stevenh
ff73db325b Fixed fallbackPrefix not being lowercased, which would break prefixes for plugins with an uppercase char in the name 2011-06-12 16:35:26 +01:00
Erik Broes
c54ec090c8 Generic cleanup 2011-06-12 12:49:08 +02:00
stevenh
7a035d60ea Fixed no command found being sent to the command sender for command handlers which return failure (false) 2011-05-23 23:59:47 +01:00
stevenh
801132b89f Reworked command registration so that aliases are secondary to the primary command label requested
Updated docs to reflect what the code really does
This adds a few new methods to Command including:-
* A full constructor that takes descriptio, usageMassage and aliases for convenience
* getLabel() which returns the active label for a command, which is derived from the Command name or subsiquent call to setLabel(..)
* A number of registration functions for use in the CommandMap implementer
Also of note is Command.getAliases() no returns the "active" aliases
2011-05-22 20:42:26 +01:00
Celtic Minstrel
764ef1c25d Fixed command aliases priorities.
Command aliases are now given lower weight than the "official" name of the command; this allows you to define aliases without worrying about them overriding someone else's command.
2011-05-16 00:41:51 -04:00
EvilSeph
86ca0f5c67 Made disabled plugins show up in red in the plugins list. Thanks Yetanotherx! 2011-05-15 20:07:53 -04:00
Erik Broes
c4d444ce98 Whitespace + general cleanup 2011-05-15 14:06:02 +02:00
EvilSeph
54fc471ec5 Fixed AIOOBE when entering a space into console and hitting enter. 2011-04-24 21:49:45 -04:00
stevenh
99df8e88c4 Removed unneeded string constant concat
Note: editor removed spaces on otherwise empty lines
2011-03-12 17:51:57 +00:00
Erik Broes
010cfd1781 Java 1.5 compat. 2011-03-02 15:23:15 +01:00
Dinnerbone
084ff83fae command.set/getDescription replaces a now deprecated set/getTooltip + javadocs 2011-02-28 11:42:09 +00:00
Dinnerbone
11b94ea17f Case-insensitive commands 2011-02-28 00:52:43 +00:00
Dinnerbone
4fa84d995c Tweaks to command system to allow setting executors via plugins (no more ambiguous onCommand in plugins) 2011-02-28 00:30:59 +00:00
Dinnerbone
efd55fbbe5 Exception handling in commands 2011-02-18 16:25:06 +00:00
EvilSeph
48739b8592 Commands should not be case-sensitive. 2011-02-06 21:56:38 -05:00
EvilSeph
5bb76a6c3d Moved the plugin list display out of the version command and into the plugins command.
Version should not display a list of plugins as a server running many
plugins will no longer be able to see the version output.
2011-02-05 04:30:18 -05:00
Dinnerbone
d36bc58cf3 Revert "fallback code for command lookup"
This reverts commit 74a549c74b.
2011-02-02 09:20:16 +00:00
tahg
74a549c74b fallback code for command lookup 2011-02-01 21:56:16 -08:00
Dinnerbone
a402db3d66 Don't delete the first char of the command passed 2011-02-01 18:12:46 +00:00
stevenh
247e77579a Renamed IExecutor -> CommandExecutor and fixed SERVER_COMMAND doc 2011-01-29 21:17:36 +00:00
stevenh
0814239f31 merge with head 2011-01-29 17:18:32 +00:00
stevenh
cc404ced12 Refactored event calling so its front loading avoiding the lookup for each event call.
This now uses an annoymous class implementing IExecutor that facilitates direct event method handler calling

Changed commands from being executed exclusively by a player to by a CommandSender to facilitate external command callers such as rcon

Fixed CustomEventListener

Merged in additional events

Added getFullName to PluginDescriptionFile which returns the combination of Name and Version

There's also a few bits of reformatting as it seems someones been editing with either tabs or dos eol :(
2011-01-29 16:23:56 +00:00
Dinnerbone
587ee346f8 Fixed only being able to use /reload once 2011-01-28 14:24:54 +00:00
Dinnerbone
d67110aecf clearPlugins() and clearCommands() for PluginManager and CommandMap respectively 2011-01-28 14:18:24 +00:00
Dinnerbone
ea3db10229 Fully implemented /version 2011-01-20 16:26:57 +00:00
Dinnerbone
e48a4a2224 Added /version and /reload commands 2011-01-20 03:53:27 +00:00
VictorD
ad2bfe6bf6 Fixed minor bug with alias registration and removed debug output 2011-01-18 01:54:48 +01:00
VictorD
7a9ecbef53 Updated commands to have optional aliases, and to fallback to /pluginName:cmdName on name conflict. 2011-01-18 01:12:50 +01:00