Commit Graph

209 Commits

Author SHA1 Message Date
Aikar c5ca1ac731 Fix issues with Paper Async Tab Completion
Works in 1.12, but 1.13 has problems at paper level, I will fix there.
2019-02-02 11:20:30 -05:00
MrMicky bf6788c072 Add French translation (#176) 2019-01-18 22:07:34 -05:00
Aikar 71d0416f10 CommandIssuer should be IssuerOnly context
Likely fixes #170
2018-09-09 20:59:00 -04:00
Diego Arias 82aaf9b701 Register SubClasses before Command register() (#169)
This is so the SubCommands from the SubClasses get added to the SubCommand map before calling **addChild()**
2018-09-01 20:27:55 -04:00
Gabik21MC 370e1047d2 Fixes #165 (#166)
This seems kind of wrong to me. Somone calling RegisteredCommand#getHelpText out of context will run into the same issue.
2018-08-27 14:05:57 -04:00
Aikar 6c7ccbd6da Register CommandIssuer context 2018-08-19 10:27:26 -04:00
Niklas Eicker 0aa4cfd457 Improve logging concerning command replacements (#161)
The code is now checking for placeholders, that are not replaced. This would also warn the dev if he completely forgets to register a replacement. 
The downside of this is, that any %.* kind of pattern, that is NOT supposed to be a replacement will cause an error message. But since I couldn't come up for a reason to include % in any of the Annotation values other than a replacement, I decided this is much easier than checking all "old" commands when a replacement is registered.
Alternatively, I could collect all these unreplaced replacements and check against the collection when a new one is registered. This would not warn a dev that forgot to register the replacement, but on the other hand still allows the use of %. Please tell me what you think.

resolves #160
2018-08-06 15:52:31 -04:00
Mark Vainomaa 65ff5a5500 Replace Guava Iterables (#158)
Goes under #120

After this, only MultiMaps remain.
2018-08-03 09:57:38 -04:00
Osip Fatkullin 3c979a9ef2 Drop trivial Guava usages (#142)
#120, #127
2018-07-19 19:43:17 -04:00
Aikar 9aac7d7809 Enable ability to disable logging of uncaught exceptions
You must pass your own exception handler in order to do this.

Implementors need to be sure to log if its not a desired throw or
otherwise you will have silent command failures.
2018-06-18 21:31:46 -04:00
Gabik21MC 7c75cdd48c Improvements (#143)
Improve help output for commands split over multiple base commands
Fix help last page detection
Fix missing argument on Player Context Resolve
Expose registered root commands
2018-06-18 15:15:03 -04:00
Osip Fatkullin 444212ade5 Add russian translation (#141) 2018-06-17 12:03:36 -04:00
Aikar eb639427d2 Use collections instead of lists for static completions 2018-06-12 22:33:06 -04:00
Aikar 59c45f12ce Add support for static command completions 2018-06-12 22:23:38 -04:00
Aikar 27eb9fa733 More Documentation 2018-05-31 19:33:48 -04:00
Proximyst 0be34242db Updated JavaDocs from PR #116 2018-05-31 19:33:28 -04:00
Gabik21MC 961009a77c Support old user names (#133)
Recently a player with a two letter account joined on my server and I noticed that the context resolver for the player interface does not work. This PR also fixes crazy names like these:
https://de.namemc.com/profile/%24.1
https://de.namemc.com/profile/u.1
2018-05-29 11:04:14 -04:00
Aikar d57dbcefab Update Maven Plugins, hopefully will fix #129 2018-05-27 12:43:32 -04:00
Aikar cbc01b8b41 Set Annotation Targets on all the annotations
Fixes Kotlin for Dependency
2018-05-27 12:11:26 -04:00
chickeneer 88130a5574 Replace incorrect usage of MIN_VALUE with -MAX_VALUE
The javadocs for Float and Double specify this for the MIN_VALUE:
A constant holding the smallest positive nonzero value of type...

So the true minimum value must be calculated by the negative max value.
2018-05-24 09:38:26 -05:00
MiniDigger 6bd101ac30 leftover from #124 (#125) 2018-04-20 11:38:37 -04:00
MiniDigger 95fe4577be add a new annotation to hide commands from tabcompletion and help (#124)
* add a new annotation to hide commands from tabcompletion and help (implements #123)

* do the annotation lookup once
2018-04-20 11:28:22 -04:00
Aikar 2d45e03dae Replace use of Guava Table with my own table - Closes #121 2018-03-31 00:59:21 -04:00
chickeneer ac362d7aa6 Fix deprecation warning for UnknownHandler, should point to CatchUnknown 2018-03-30 16:46:48 -05:00
Aikar 8007b933dd Disable setDefaultCompletion as not done yet 2018-03-29 22:01:51 -04:00
DarkPaladin 87613fb59b WIP: Set default completion contexts (#101)
* Register default completion

* Remove auto add @ because it is possible to have completion ids without them

Aikar note - Going to make this private in next commit until feature is done
2018-03-29 21:59:38 -04:00
Aikar 7286b75466 move help output structure to formatter so it can be overridden 2018-03-29 21:55:44 -04:00
Aikar d1054d52ef Revert all Method Handle stuff.
According to https://gist.github.com/raphw/881e1745996f9d314ab0 its not faster in dynamic, unknown situations.
2018-03-26 01:48:14 -04:00
chickeneer e423b877ff Disable method handles to use reflection due to WrongMethodTypeException 2018-03-24 20:55:00 -05:00
JanTuck 31743b0326 Fix methodHandle error (#119)
Fix exception thrown by incorrect function
2018-03-24 19:47:38 -05:00
Aikar d61c937dce fix dupe command prefix 2018-03-24 15:57:48 -04:00
Mariell 44c942101b Add Norwegian bokmål & nynorsk (#111)
* Add bokmål & nynorsk

* Fix colour
2018-03-24 11:02:19 -04:00
Mariell 11dcee8b39 Use MethodHandles for invocation (#112)
* Use method handles for invocation

* Fix parsing, add more safety and add for named MessageChannels, and format

* Add methodhandle support to BaseCommand
2018-03-24 10:59:43 -04:00
Aikar 1362fd4b91 Dont use command prefix in header, expose as replacement 2018-03-22 08:50:31 -04:00
Aikar 5794c3ea58 use a diff format key for detailed command help 2018-03-21 23:35:22 -04:00
Aikar aafea3d74b add {syntax} replacement to param help 2018-03-21 23:29:47 -04:00
Aikar 83bcbbd01e some reformatting 2018-03-21 23:01:47 -04:00
Aikar db94aa4317 Clean up help formatter method signatures 2018-03-21 22:56:19 -04:00
Aikar e8bb460ae0 Use MessageKeyProvider for locales 2018-03-21 22:23:02 -04:00
Aikar 08b8ab6355 Consistently set the correct command prefix 2018-03-21 22:16:24 -04:00
Aikar 8cf361aeaf Merge branch 'MiniDigger-help-improvements'
* MiniDigger-help-improvements:
  Improvements to help formatter
  start with abstracting help messages out
  make sure to only treat a type as sender if its not annotated with "other"
  help improvements
2018-03-21 22:05:19 -04:00
Aikar 8335d580f6 Improvements to help formatter 2018-03-21 22:02:48 -04:00
Aikar 96238f9e06 Merge branch 'help-improvements' of https://github.com/MiniDigger/commands into MiniDigger-help-improvements
* 'help-improvements' of https://github.com/MiniDigger/commands:
  start with abstracting help messages out
  make sure to only treat a type as sender if its not annotated with "other"
  help improvements
2018-03-21 21:20:53 -04:00
Emil 0deeeeca5e Add Swedish as supported language. (#109) 2018-03-20 10:57:50 -04:00
Aikar 633c6278b5 Ignore command issuer for context resolution in completions 2018-03-18 01:11:25 -04:00
Aikar 65af80a430 Default empty descriptions 2018-03-17 20:38:45 -04:00
Aikar 9024e878b1 fix annotation lookup 2018-03-17 20:27:11 -04:00
Aikar ec235d80fc Fix Bukkit Description being null, supply usage/description to Sponge/Bungee 2018-03-17 19:51:52 -04:00
Aikar 901359356f fix looking up annotations without value methods 2018-03-17 19:46:22 -04:00
Aikar 5c9763ac00 More cleanup and refactoring
All annotations should be read for most part at registration now
2018-03-17 19:18:16 -04:00