Commit Graph

24 Commits

Author SHA1 Message Date
MiniDigger cebe28ef6c [WIP] Add dependency injection functionality, Closes #85 (#86)
* misc improvements (as suggested by intellij)

* first draft of the DI functionality (#85)

* address review

* reenabled disabled inspections

* overload registerDependency method

* inject fields of superclasses two and remove invalid sponge default dependency
2018-01-25 14:21:16 -05:00
Aikar 1739bfc39c Add way to set @Flags context for entire command - Closes #29
Couldn't do it through annotations due to limitations on annotations,
but this achieves same goal.
2018-01-14 19:48:25 -05:00
Aikar 9f7eb9bcf5 Condition handlers wasnt meant to return boolean.
Sorry if anyone wrote one already, remove the return type please.

Really don't want to bump version when very low chance anyones using
this system yet.
2018-01-10 19:44:26 -05:00
Aikar 40eaa9ea07 Command Conditions and MANY other code changes for Generics <3🌮
This completes and fully enables a new feature called "Conditions"

We already had some forms of conditions built into @Flags such as
on the Player for itemheld.

However, letting end users add additional restrictions to existing context
handlers such as players is not possible without redefining the context.

That's not friendly nor scalable.

Flags will now be primarily only for controlling how to resolve a context,
and then Conditions will then be the way to validate the context and trigger
a failure if the condition is not met.

Conditions can be placed on Command Class, Methods, or individual Parameters.
2018-01-08 23:30:27 -05:00
Aikar 9ef0ac6e5e Current progress on Conditions, not done yet - #58 2017-12-13 23:12:31 -05:00
Aikar fbed6f2be3 Add Support for Async Tab Completions for Paper Servers
This adds the ability for plugins to define completion handlers as async safe (not on games main thread)

When they are defined async safe, and ran on a Paper 1.12.2+ server, with a Paper ACF manager,
completions will be handled mostly async, letting you safely do heavier operations in tab completions.
2017-11-30 01:18:43 -05:00
Aikar 8c49ecabcf Add many comments to the example to help explain things 2017-10-11 20:47:10 -04:00
Aikar 8168122241 Massive i18n work, not fully finished set but resolves #53 2017-06-30 12:05:00 -05:00
Aikar c9acb55a48 ton more I18N/Locales work, messages migrated! 2017-06-29 00:36:59 -04:00
Aikar f2e96ea244 Start of I18N work 2017-06-26 23:03:18 -04:00
MiniDigger eb84340f46 Add custom Exception Handlers (#43)
* Add the ability to register exception handlers to handle exceptions that occur while executing a command

* you saw nothing

* add ability to cancel default error message

* per command exception handler

* add a getter for the default exception handler
2017-06-15 10:25:25 -04:00
Aikar 15b149d55c Big Break: Change the Command Completion Handler signature to match Context
For consistency, make Completion Handlers be implemented the same way Context Handlers are.

Previously when we added the Context parameter, we left the original signature in place and simply tacked , c on the end.

This made migration easier than changing all completion handlers bodies.

But since 0.5.0 is a big migration already, let's just get it over with.

See changes to Bukkit default completions and the example plugin for migration example.
2017-06-14 22:17:33 -04:00
Aikar 1455dd4951 get rid of BaseSubcommand and establish parent tree 2017-06-08 00:07:53 -04:00
Aikar 7bf24e9c13 Almost done with modular work 2017-06-03 00:11:43 -04:00
Aikar 0bf2621a91 Merge branch 'master' into modular
* master:
  Warn if you register replacements after commands
  add some more example
  Fix Command Replacements not being applied correctly to aliases - fixes #37
2017-05-20 12:29:04 -04:00
Aikar e79912299f add some more example 2017-05-20 12:22:56 -04:00
Aikar c2a58a471f Refactor everything to a modular format - WIP
This does not compile

Almost done with core !!!
2017-05-20 11:32:41 -04:00
Aikar 9f08f16028 Add support for Command Replacements - Resolves #28 2017-05-05 23:44:32 -04:00
Aikar 80fa47685f supper inner classes and parent up subcommand bases - Resolves #20 2017-05-05 21:57:15 -04:00
Aikar 4160e8be23 Allow multiple class files registering to same root alias - resolves #17
allows organizing categories of commands (staff etc)
2017-05-04 23:36:47 -04:00
Aikar ae87e7440a v0.4.0: Refactor Command Completions to look up context - API BREAK
Just add ", c" to your registerCompletion handler:

commandManager.getCommandCompletions().registerCompletion("test", (sender, config, input, c) -> {

});
2017-04-29 00:30:48 -04:00
Aikar a9009457ec Fix example plugin 2017-04-21 18:34:46 -04:00
Aikar 8bb172ee26 Misc cleanup 2017-04-21 01:42:00 -04:00
Aikar c0a29c4691 Add an example plugin 2017-04-21 01:12:15 -04:00