Advertisement
Guest User

Untitled

a guest
Feb 7th, 2016
54
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.17 KB | None | 0 0
  1. public abstract class CommandExecutor {
  2.  
  3. private final String command, permission; // you can group variables of the same type together like this
  4. private final boolean console, player;
  5. private final int length;
  6.  
  7. /*
  8. Instantiating the variables inside of the constructor instead of using a setter. If you do not want all of these
  9. to be set (e.g. if some are optional) you can have multiple constructors.
  10. */
  11. public CommandExecutor(String command, String permission, boolean console, boolean player, int length) {
  12. this.command = command;
  13. this.permission = permission;
  14. this.console = console;
  15. this.player = player;
  16. this.length = length;
  17. }
  18.  
  19. // you know what this does
  20. public abstract void onCommand(CommandSender sender, Command cmd, String label, String[] args);
  21.  
  22. public String getCommand() {
  23. return this.command; // using the "this" operater in getters is just a personal preference of mine.
  24. }
  25.  
  26. public String getPermission() {
  27. return this.permission;
  28. }
  29.  
  30. public boolean isConsole() {
  31. return this.console;
  32. }
  33.  
  34. public boolean isPlayer() {
  35. return this.player;
  36. }
  37.  
  38. public int getLength() {
  39. return this.length;
  40. }
  41.  
  42. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement