Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public abstract class CommandExecutor {
- private final String command, permission; // you can group variables of the same type together like this
- private final boolean console, player;
- private final int length;
- /*
- Instantiating the variables inside of the constructor instead of using a setter. If you do not want all of these
- to be set (e.g. if some are optional) you can have multiple constructors.
- */
- public CommandExecutor(String command, String permission, boolean console, boolean player, int length) {
- this.command = command;
- this.permission = permission;
- this.console = console;
- this.player = player;
- this.length = length;
- }
- // you know what this does
- public abstract void onCommand(CommandSender sender, Command cmd, String label, String[] args);
- public String getCommand() {
- return this.command; // using the "this" operater in getters is just a personal preference of mine.
- }
- public String getPermission() {
- return this.permission;
- }
- public boolean isConsole() {
- return this.console;
- }
- public boolean isPlayer() {
- return this.player;
- }
- public int getLength() {
- return this.length;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement