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

Top level commands should show to those with sufficient permission #24

Closed DarkArc closed 4 years ago

DarkArc commented 4 years ago
@CommandContainer(superTypes = CommandPermissionsConditionGenerator.Registration.class)
public class FooCommands {
  @Command(name = "foo", desc =" do foo")
  @CommandPermissions({"do.foo"})
  public void fooCmd() {
  }
}
CommandManager componentManager = service.newCommandManager();
registration.register(commandManager, FooCommandsRegistration.builder(), new FooCommands());
topLevelCommandManager.registerManager(componentManager);

Registering the commands of FooCommands in this way, results in the commands being non-visible to all players, including those that have the respective permissions (do.foo), for purposes of completion.

octylFractal commented 4 years ago

Test for this is in most recent commit, works fine. Permission condition is probably not working properly.