TF-PlotSquared/PlotSquared/src/main/java/com/intellectualcrafters/plot/commands/Command.java

154 lines
5.4 KiB
Java
Raw Normal View History

2014-11-08 20:27:09 +01:00
////////////////////////////////////////////////////////////////////////////////////////////////////
// PlotSquared - A plot manager and world generator for the Bukkit API /
// Copyright (c) 2014 IntellectualSites/IntellectualCrafters /
// /
// This program is free software; you can redistribute it and/or modify /
// it under the terms of the GNU General Public License as published by /
// the Free Software Foundation; either version 3 of the License, or /
// (at your option) any later version. /
// /
// This program is distributed in the hope that it will be useful, /
// but WITHOUT ANY WARRANTY; without even the implied warranty of /
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the /
// GNU General Public License for more details. /
// /
// You should have received a copy of the GNU General Public License /
// along with this program; if not, write to the Free Software Foundation, /
// Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA /
// /
// You can contact us via: support@intellectualsites.com /
////////////////////////////////////////////////////////////////////////////////////////////////////
2014-09-22 13:02:14 +02:00
package com.intellectualcrafters.plot.commands;
/**
* Created by Citymonstret on 2014-08-03.
*
2014-09-22 13:02:14 +02:00
* @author Citymonstret
2014-11-20 00:00:38 +01:00
* @author Empire92
2014-09-22 13:02:14 +02:00
*/
public enum Command {
2014-11-05 14:42:08 +11:00
// TODO new commands
// (economy)
// - /plot buy
// - /plot sell <value>
// (Rating system) (ratings can be stored as the average, and number of
// ratings)
// - /plot rate <number out of 10>
2015-01-29 20:59:32 +11:00
FLAG("flag", "f"),
2015-02-01 16:32:04 +11:00
TARGET("target"),
2015-01-29 18:45:14 +11:00
CLUSTER("cluster", "clusters"),
2015-02-20 17:34:19 +11:00
BUY("buy", "b"),
2014-12-29 00:09:37 +11:00
CREATEROADSCHEMATIC("createroadschematic"),
2014-12-29 00:47:35 +11:00
DEBUGROADREGEN("debugroadregen"),
2015-02-03 13:46:25 +11:00
DEBUGFIXFLAGS("debugfixflags"),
2014-12-29 00:47:35 +11:00
REGENALLROADS("regenallroads"),
DEBUGLOADTEST("debugloadtest"),
DEBUGSAVETEST("debugsavetest"),
UNCLAIM("unclaim"),
DEBUGCLEAR("debugclear"),
2014-10-23 21:21:27 +11:00
SWAP("swap"),
INBOX("inbox"),
2014-10-22 23:22:00 +11:00
DEBUGCLAIMTEST("debugclaimtest"),
COMMENT("comment", "msg"),
2014-11-05 14:42:08 +11:00
TRUSTED("trusted", "trust"),
PASTE("paste"),
2014-10-13 19:40:30 +02:00
CLIPBOARD("clipboard", "cboard"),
2014-11-05 14:42:08 +11:00
COPY("copy"),
KICK("kick", "k"),
HELPERS("helpers", "hp"),
DENIED("denied", "dn"),
CLAIM("claim", "c"),
MERGE("merge", "m"),
UNLINK("unlink", "u"),
CLEAR("clear", "clear", new CommandPermission("plots.clear")),
DELETE("delete", "d", new CommandPermission("plots.delete")),
2014-11-15 12:29:30 +01:00
DEBUG("debug", "debug", new CommandPermission("plots.admin")),
2014-11-02 20:01:04 +01:00
INTERFACE("interface", "int", new CommandPermission("plots.interface")),
2014-11-05 14:42:08 +11:00
HOME("home", "h"),
INFO("info", "i"),
LIST("list", "l"),
SET("set", "s"),
PURGE("purge"),
2015-02-02 14:38:46 +11:00
OP("op", "add"),
2014-11-09 19:27:46 +01:00
DEOP("deop", "deadmin"),
BAN("ban", "block"),
2014-11-20 00:00:38 +01:00
UNBAN("unban", "unblock"),
DATABASE("database", "convert"),
TP("tp", "tp");
/**
* Command
*/
2014-12-17 20:15:11 -06:00
private final String command;
2014-11-20 00:00:38 +01:00
/**
* Alias
*/
2014-12-17 20:15:11 -06:00
private final String alias;
2014-11-20 00:00:38 +01:00
/**
* Permission Node
*/
private final CommandPermission permission;
2015-02-23 12:32:27 +11:00
2014-11-05 14:42:08 +11:00
/**
2014-12-17 20:15:11 -06:00
* @param command Command "name" (/plot [cmd])
2014-11-05 14:42:08 +11:00
*/
Command(final String command) {
this.command = command;
this.alias = command;
this.permission = new CommandPermission("plots." + command);
}
2015-02-23 12:32:27 +11:00
2014-11-05 14:42:08 +11:00
/**
2014-12-17 20:15:11 -06:00
* @param command Command "name" (/plot [cmd])
* @param permission Command Permission Node
2014-11-05 14:42:08 +11:00
*/
Command(final String command, final CommandPermission permission) {
this.command = command;
this.permission = permission;
this.alias = command;
}
2015-02-23 12:32:27 +11:00
2014-11-05 14:42:08 +11:00
/**
2014-12-17 20:15:11 -06:00
* @param command Command "name" (/plot [cmd])
* @param alias Command Alias
2014-11-05 14:42:08 +11:00
*/
Command(final String command, final String alias) {
this.command = command;
this.alias = alias;
this.permission = new CommandPermission("plots." + command);
}
2015-02-23 12:32:27 +11:00
2014-11-05 14:42:08 +11:00
/**
2014-12-17 20:15:11 -06:00
* @param command Command "name" (/plot [cmd])
* @param alias Command Alias
* @param permission Required Permission Node
2014-11-05 14:42:08 +11:00
*/
Command(final String command, final String alias, final CommandPermission permission) {
this.command = command;
this.alias = alias;
this.permission = permission;
}
2015-02-23 12:32:27 +11:00
2014-11-05 14:42:08 +11:00
/**
2014-11-20 00:00:38 +01:00
* @return command
2014-11-05 14:42:08 +11:00
*/
public String getCommand() {
return this.command;
}
2015-02-23 12:32:27 +11:00
2014-11-05 14:42:08 +11:00
/**
2014-11-20 00:00:38 +01:00
* @return alias
2014-11-05 14:42:08 +11:00
*/
public String getAlias() {
return this.alias;
}
2015-02-23 12:32:27 +11:00
2014-11-05 14:42:08 +11:00
/**
2014-11-20 00:00:38 +01:00
* @return permission object
2014-12-17 20:15:11 -06:00
*
2014-11-20 00:00:38 +01:00
* @see com.intellectualcrafters.plot.commands.CommandPermission
2014-11-05 14:42:08 +11:00
*/
public CommandPermission getPermission() {
return this.permission;
}
2014-09-22 13:02:14 +02:00
}