2626
2727import org .bukkit .Bukkit ;
2828import org .bukkit .command .*;
29+ import org .jetbrains .annotations .NotNull ;
2930
3031import java .lang .reflect .Field ;
3132import java .util .List ;
@@ -48,22 +49,6 @@ public AbstractCommand(String command) {
4849 this (command , null , null , null , null );
4950 }
5051
51- public AbstractCommand (String command , String usage ) {
52- this (command , usage , null , null , null );
53- }
54-
55- public AbstractCommand (String command , String usage , String description ) {
56- this (command , usage , description , null , null );
57- }
58-
59- public AbstractCommand (String command , String usage , String description , String permissionMessage ) {
60- this (command , usage , description , permissionMessage , null );
61- }
62-
63- public AbstractCommand (String command , String usage , String description , List <String > aliases ) {
64- this (command , usage , description , null , aliases );
65- }
66-
6752 public AbstractCommand (
6853 String command , String usage , String description , String permissionMessage , List <String > aliases ) {
6954 this .command = command .toLowerCase ();
@@ -93,22 +78,22 @@ final CommandMap getCommandMap() {
9378 } catch (Exception e ) {
9479 e .printStackTrace ();
9580 }
96- } else if ( cmap != null ) {
81+ } else {
9782 return cmap ;
9883 }
9984 return getCommandMap ();
10085 }
10186
102- public abstract boolean onCommand (CommandSender sender , Command cmd , String label , String [] args );
87+ public abstract boolean onCommand (@ NotNull CommandSender sender , @ NotNull Command cmd , @ NotNull String label , String [] args );
10388
104- public List <String > onTabComplete (CommandSender sender , Command cmd , String label , String [] args ) {
89+ public List <String > onTabComplete (@ NotNull CommandSender sender , @ NotNull Command cmd , @ NotNull String label , String [] args ) {
10590 return null ;
10691 }
10792
108- private final class ReflectCommand extends Command {
93+ private static final class ReflectCommand extends Command {
10994 private AbstractCommand exe = null ;
11095
111- protected ReflectCommand (String command ) {
96+ private ReflectCommand (String command ) {
11297 super (command );
11398 }
11499
@@ -117,15 +102,15 @@ public void setExecutor(AbstractCommand exe) {
117102 }
118103
119104 @ Override
120- public boolean execute (CommandSender sender , String commandLabel , String [] args ) {
105+ public boolean execute (@ NotNull CommandSender sender , @ NotNull String commandLabel , String [] args ) {
121106 if (exe != null ) {
122107 return exe .onCommand (sender , this , commandLabel , args );
123108 }
124109 return false ;
125110 }
126111
127112 @ Override
128- public List <String > tabComplete (CommandSender sender , String alais , String [] args ) {
113+ public List <String > tabComplete (@ NotNull CommandSender sender , @ NotNull String alais , String [] args ) {
129114 if (exe != null ) {
130115 return exe .onTabComplete (sender , this , alais , args );
131116 }
0 commit comments