84 lines
2.0 KiB
Java
84 lines
2.0 KiB
Java
/*
|
|
* Copyright (c) 2017 univento.eu - All rights reserved
|
|
* You are not allowed to use, distribute or modify this code
|
|
*/
|
|
|
|
package eu.univento.core.api.command;
|
|
|
|
import eu.univento.commons.player.rank.Group;
|
|
import eu.univento.commons.player.rank.Rank;
|
|
import eu.univento.commons.server.ServerType;
|
|
|
|
import java.lang.annotation.ElementType;
|
|
import java.lang.annotation.Retention;
|
|
import java.lang.annotation.RetentionPolicy;
|
|
import java.lang.annotation.Target;
|
|
|
|
/**
|
|
* Command Framework - Command <br>
|
|
* The command annotation used to designate methods as commands. All methods
|
|
* should have a single CommandArgs argument
|
|
*
|
|
* @author minnymin3, joethei
|
|
*
|
|
*/
|
|
@Target(ElementType.METHOD)
|
|
@Retention(RetentionPolicy.RUNTIME)
|
|
public @interface Command {
|
|
|
|
/**
|
|
* The name of the command. If it is a sub command then its values would be
|
|
* separated by periods. ie. a command that would be a subcommand of test
|
|
* would be 'test.subcommandname'
|
|
*
|
|
* @return
|
|
*/
|
|
String name();
|
|
|
|
/**
|
|
* Gets the required permission of the command
|
|
*
|
|
* @return
|
|
*/
|
|
Rank rank() default Rank.Player;
|
|
Group group() default Group.None;
|
|
|
|
ServerType serverType() default ServerType.NONE;
|
|
|
|
/**
|
|
* The message sent to the player when they do not have permission to
|
|
* execute it
|
|
*
|
|
* @return
|
|
*/
|
|
String notAllowed() default "§cYou do not have permission to perform that action";
|
|
|
|
/**
|
|
* A list of alternate names that the command is executed under. See
|
|
* name() for details on how names work
|
|
*
|
|
* @return
|
|
*/
|
|
String[] aliases() default {};
|
|
|
|
/**
|
|
* The description that will appear in /help of the command
|
|
*
|
|
* @return
|
|
*/
|
|
String description() default "";
|
|
|
|
/**
|
|
* The usage that will appear in /help (commandname)
|
|
*
|
|
* @return
|
|
*/
|
|
String usage() default "";
|
|
|
|
/**
|
|
* Whether or not the command is available to players only
|
|
*
|
|
* @return
|
|
*/
|
|
boolean inGameOnly() default false;
|
|
} |