@@ -423,11 +423,11 @@ public boolean onCommand(
423423 }
424424 List <String > requirePermissions = container .getPermissions ();
425425 List <String > selectivePermissions = container .getSelectivePermissions ();
426- if (!checkPermissions (sender , commandLabel , passThroughArgs , requirePermissions , CommandManager .PermissionType .REQUIRE , CommandManager .Action .EXECUTE )) {
426+ if (!checkPermissions (sender , commandLabel , passThroughArgs , requirePermissions , SimpleCommandManager .PermissionType .REQUIRE , SimpleCommandManager .Action .EXECUTE )) {
427427 plugin .text ().of (sender , "no-permission" ).send ();
428428 return true ;
429429 }
430- if (!checkPermissions (sender , commandLabel , passThroughArgs , selectivePermissions , CommandManager .PermissionType .SELECTIVE , CommandManager .Action .EXECUTE )) {
430+ if (!checkPermissions (sender , commandLabel , passThroughArgs , selectivePermissions , SimpleCommandManager .PermissionType .SELECTIVE , SimpleCommandManager .Action .EXECUTE )) {
431431 plugin .text ().of (sender , "no-permission" ).send ();
432432 return true ;
433433 }
@@ -449,12 +449,11 @@ public <T1, T2 extends T1> T2 capture(T1 type) {
449449 return (T2 ) type ;
450450 }
451451
452- @ Override
453- public boolean checkPermissions (CommandSender sender , String commandLabel , String [] cmdArg , List <String > permissionList , CommandManager .PermissionType permissionType , CommandManager .Action action ) {
452+ public boolean checkPermissions (CommandSender sender , String commandLabel , String [] cmdArg , List <String > permissionList , SimpleCommandManager .PermissionType permissionType , SimpleCommandManager .Action action ) {
454453 if (permissionList == null || permissionList .isEmpty ()) {
455454 return true ;
456455 }
457- if (permissionType == CommandManager .PermissionType .REQUIRE ) {
456+ if (permissionType == SimpleCommandManager .PermissionType .REQUIRE ) {
458457 for (String requirePermission : permissionList ) {
459458 if (requirePermission != null
460459 && !requirePermission .isEmpty ()
@@ -494,7 +493,6 @@ public boolean checkPermissions(CommandSender sender, String commandLabel, Strin
494493 }
495494
496495
497- @ Override
498496 public boolean isAdapt (CommandContainer container , CommandSender sender ) {
499497 return container .getExecutorType ().isInstance (sender );
500498 }
@@ -528,10 +526,10 @@ public boolean isAdapt(CommandContainer container, CommandSender sender) {
528526 }
529527 List <String > requirePermissions = container .getPermissions ();
530528 List <String > selectivePermissions = container .getSelectivePermissions ();
531- if (!checkPermissions (sender , commandLabel , passThroughArgs , requirePermissions , CommandManager .PermissionType .REQUIRE , CommandManager .Action .TAB_COMPLETE )) {
529+ if (!checkPermissions (sender , commandLabel , passThroughArgs , requirePermissions , SimpleCommandManager .PermissionType .REQUIRE , SimpleCommandManager .Action .TAB_COMPLETE )) {
532530 return Collections .emptyList ();
533531 }
534- if (!checkPermissions (sender , commandLabel , passThroughArgs , selectivePermissions , CommandManager .PermissionType .SELECTIVE , CommandManager .Action .TAB_COMPLETE )) {
532+ if (!checkPermissions (sender , commandLabel , passThroughArgs , selectivePermissions , SimpleCommandManager .PermissionType .SELECTIVE , SimpleCommandManager .Action .TAB_COMPLETE )) {
535533 return Collections .emptyList ();
536534 }
537535 Util .debugLog ("Tab-complete container: " + container .getPrefix ());
@@ -542,4 +540,22 @@ public boolean isAdapt(CommandContainer container, CommandSender sender) {
542540 }
543541 }
544542
543+ enum Action {
544+ EXECUTE ("execute" ),
545+ TAB_COMPLETE ("tab-complete" );
546+ final String name ;
547+
548+ Action (String name ) {
549+ this .name = name ;
550+ }
551+
552+ public String getName () {
553+ return name ;
554+ }
555+ }
556+
557+ enum PermissionType {
558+ REQUIRE ,
559+ SELECTIVE
560+ }
545561}
0 commit comments