Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Very simple change that makes it so the order injectors are called in is the one they were registered in, instead of being arbitrary.
This is relevant when the injectors overlap on classes, eg: CommandSender vs Player injectors, if your command wants to be injected a "CommandSender", it could randomly first attempt the player one (as player is compatible) and if player isn't available (eg: console) then it would go to the other injector for the actual CommandSender.
While this is probably a minor change it otherwise becomes impossible to make required injectors that will throw exceptions (later handled by the exception handler) when the necessary context isn't available when classes overlap. In the previous example, if the injector for Player threw an exception when the caller isn't a player, then randomly no command would be able to run from console (if you're unlucky enough that the player injector is called first).
With this change, as long as you register CommandSender's injector first, and then Player, such behavior works reliably.