26 Commits

Author SHA1 Message Date
Score_Under
9fd9767a4a 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
Wesley Wolfe
34b63c06cc Add check for existing config file. Addresses BUKKIT-1851 2012-06-28 16:39:19 -05:00
feildmaster
062a3df78d Javadoc updates
Fixes BUKKIT-1653, Fixes BUKKIT-1383 and Fixes BUKKIT-1644
2012-06-03 05:40:54 -05:00
Feildmaster
0a106995d2 Revert Plugin to Interface, added PluginBase
Fixed Tests, moved TestPlugin out of messaging
2012-02-29 20:59:56 -05:00
rmichela
cd732ee3f7 [Bleeding] Added a Metadata framework for Entities, Blocks, and Worlds
This metadata implementation has the following features:

- All metadata is lazy. Metadata values are not actually computed until another plugin requests them. Memory and CPU are conserved by not computing and storing unnecessary metadata values.

- All metadata is cached. Once a metadata value is computed its value is cached in the metadata store to prevent further unnecessary computation. An invalidation mechanism is provided to flush the cache and force recompilation of metadata values.

- All metadata is stored in basic data types. Convenience methods in the MetadataValue class allow for the conversion of metadata data types when possible. Restricting metadata to basic data types prevents the accidental linking of large object graphs into metadata. Metadata is persistent across the lifetime of the application and adding large object graphs would damage garbage collector performance.

- Metadata access is thread safe. Care has been taken to protect the internal data structures and access them in a thread safe manner.

- Metadata is exposed for all objects that descend from Entity, Block, and World. All Entity and World metadata is stored at the Server  level and all Block metadata is stored at the World level.

- Metadata is NOT keyed on references to original objects - instead metadata is keyed off of unique fields within those objects. Doing this allows metadata to exist for blocks that are in chunks not currently in memory. Additionally, Player objects are keyed off of player name so that Player metadata remains consistent between logins.

- Metadata convenience methods have been added to all Entities, Players, Blocks, BlockStates, and World allowing direct access to an individual instance's metadata.

- Players and OfflinePlayers share a single metadata store, allowing player metadata to be manipulated regardless of the player's current online status.
2012-02-29 19:16:04 +01:00
Erik Broes
049a7cc1d0 Deprecation cleanup. 2012-02-18 13:05:58 -05:00
Tahg
468d45b761 Updated timing code for new event system 2012-01-19 18:41:04 -05:00
rmichela
5ca940b907 [Bleeding] Added Plugin.getLogger() which returns a java.util.Logger that prefixes messages with the plugin name.
Note: the server when enabling or disabling a plugin will now by default log this.
2012-01-17 19:45:36 +01:00
Tahg
b063a7246a Added timings command. 2012-01-09 23:44:17 -05:00
Erik Broes
b9fca3c04d Generic cleanup of warnings, whitespace and style. 2011-12-25 16:02:30 +01:00
Nathan Adams
a345613cfa Added plugin saveResources + saveDefaultConfig methods. This completes a bleeding branch by deltahat at http://forums.bukkit.org/threads/branch-complete-savedefaultconfig.48721/ 2011-12-22 21:18:36 +00:00
Nathan Adams
984c8ec90d Added reloadConfig() plugin method 2011-10-11 15:50:59 +01:00
Dinnerbone
ee27cc07f0 Added new Configuration classes 2011-10-10 21:06:34 +01:00
Dinnerbone
fe4f4c5f58 Many javadoc fixes thanks to Celtic Minstrel 2011-09-25 02:56:40 +01:00
Dinnerbone
faf2216d5c Added new getDefaultWorldGenerator method to Plugin 2011-06-22 18:26:32 +01:00
Erik Broes
992f1f2bf3 Whitespace + general cleanup 2011-05-15 14:06:02 +02:00
Dinnerbone
61b8c36233 Implemented ebeans 2011-04-01 16:09:23 +01:00
Erik Broes
f5803e1876 Just NAG once, to be nice 2011-03-30 00:38:46 +02:00
Raphfrk
ebf1904fff Adds an onLoad method to Plugin. The onLoad method is called for all plugins before the onEnable calls 2011-03-14 14:46:11 +00:00
Dinnerbone
95d92e406e Tweaks to command system to allow setting executors via plugins (no more ambiguous onCommand in plugins) 2011-02-28 00:30:59 +00:00
stevenh
a89a96416b 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
VictorD
0951ed5de8 Updated commands to have optional aliases, and to fallback to /pluginName:cmdName on name conflict. 2011-01-18 01:12:50 +01:00
VictorD
267afcb0ea Added command registration to plugin config file. Registered commands are sent to the corresponding plugin.onCommand method when executed. 2011-01-16 16:30:34 +01:00
sk89q
262d0ddad6 Plugin data folders are now no longer created by default. 2011-01-15 00:34:01 -08:00
sk89q
a9f9c6e6c2 Added configuration and plugin data directory support to plugins. 2011-01-14 23:38:53 -08:00
Erik Broes
ddff384203 Transition to Maven 2011-01-01 11:23:14 +01:00