EngineHub / Piston

A generic command system, with tie-ins to many Minecraft platforms such as Bukkit, Forge, and Sponge.
GNU General Public License v3.0
17 stars 3 forks source link

DefaultSuggestionProvider suggestions SubCommandParts with unsatisfied conditions #13

Closed wizjany closed 5 years ago

wizjany commented 5 years ago

In https://github.com/EngineHub/Piston/blob/v0.4.0/core/src/main/java/org/enginehub/piston/suggestion/DefaultSuggestionProvider.java#L174 it would be nice to have access to InjectedValueAccess so that subcommands that the player doesn't have permission to can be filtered. That said I'm not sure if passing IVA this far down has other ramifications.

octylFractal commented 5 years ago

It's actually already down there as part of the parse result. I'll add a check for sub-command condition.

wizjany commented 5 years ago

Oof, didn't realize CommandParemeters implemented InjectedValueAccess. Could have sworn I looked too :man_facepalming: