mirror of
https://github.com/IntellectualSites/PlotSquared.git
synced 2024-11-24 14:16:44 +01:00
161 lines
5.6 KiB
Java
161 lines
5.6 KiB
Java
////////////////////////////////////////////////////////////////////////////////////////////////////
|
|
// 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 /
|
|
////////////////////////////////////////////////////////////////////////////////////////////////////
|
|
package com.intellectualcrafters.plot.commands;
|
|
|
|
/**
|
|
* Created by Citymonstret on 2014-08-03.
|
|
*
|
|
* @author Citymonstret
|
|
* @author Empire92
|
|
*/
|
|
public enum Command {
|
|
// 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>
|
|
|
|
ADD("add","a"),
|
|
TRUST("trust", "t"),
|
|
DENY("deny", "d"),
|
|
REMOVE("remove", "r"),
|
|
UNTRUST("untrust", "ut"),
|
|
UNDENY("undeny", "ud"),
|
|
TOGGLE("toggle", "attribute"),
|
|
DOWNLOAD("download", "dl"),
|
|
MOVE("move"),
|
|
FLAG("flag", "f"),
|
|
TARGET("target"),
|
|
CLUSTER("cluster", "clusters"),
|
|
BUY("buy", "b"),
|
|
CREATEROADSCHEMATIC("createroadschematic", "crs"),
|
|
DEBUGROADREGEN("debugroadregen"),
|
|
DEBUGFIXFLAGS("debugfixflags"),
|
|
REGENALLROADS("regenallroads"),
|
|
ALLOWUNSAFE("debugallowunsafe"),
|
|
DEBUGLOADTEST("debugloadtest"),
|
|
DEBUGSAVETEST("debugsavetest"),
|
|
DEBUG_PASTE("debugpaste", "dp"),
|
|
UNCLAIM("unclaim"),
|
|
DEBUGCLEAR("debugclear", "fastclear"),
|
|
SWAP("swap"),
|
|
INBOX("inbox"),
|
|
DEBUGCLAIMTEST("debugclaimtest"),
|
|
COMMENT("comment", "msg"),
|
|
PASTE("paste"),
|
|
CLIPBOARD("clipboard", "cboard"),
|
|
COPY("copy"),
|
|
KICK("kick", "k"),
|
|
CLAIM("claim", "c"),
|
|
MERGE("merge", "m"),
|
|
UNLINK("unlink", "u"),
|
|
CLEAR("clear", "", new CommandPermission("plots.clear")),
|
|
DELETE("delete", "", new CommandPermission("plots.delete")),
|
|
DEBUG("debug", "", new CommandPermission("plots.admin")),
|
|
INTERFACE("interface", "int", new CommandPermission("plots.interface")),
|
|
HOME("home", "h"),
|
|
INFO("info", "i"),
|
|
LIST("list", "l"),
|
|
SET("set", "s"),
|
|
PURGE("purge"),
|
|
DATABASE("database", "convert"),
|
|
CONFIRM("confirm"),
|
|
TP("tp", "tp"),
|
|
CHAT("chat", "on|off", new CommandPermission("plots.chat"));
|
|
/**
|
|
* Command
|
|
*/
|
|
private final String command;
|
|
/**
|
|
* Alias
|
|
*/
|
|
private final String alias;
|
|
/**
|
|
* Permission Node
|
|
*/
|
|
private final CommandPermission permission;
|
|
|
|
/**
|
|
* @param command Command "name" (/plot [cmd])
|
|
*/
|
|
Command(final String command) {
|
|
this.command = command;
|
|
this.alias = command;
|
|
this.permission = new CommandPermission("plots." + command);
|
|
}
|
|
|
|
/**
|
|
* @param command Command "name" (/plot [cmd])
|
|
* @param permission Command Permission Node
|
|
*/
|
|
Command(final String command, final CommandPermission permission) {
|
|
this.command = command;
|
|
this.permission = permission;
|
|
this.alias = command;
|
|
}
|
|
|
|
/**
|
|
* @param command Command "name" (/plot [cmd])
|
|
* @param alias Command Alias
|
|
*/
|
|
Command(final String command, final String alias) {
|
|
this.command = command;
|
|
this.alias = alias;
|
|
this.permission = new CommandPermission("plots." + command);
|
|
}
|
|
|
|
/**
|
|
* @param command Command "name" (/plot [cmd])
|
|
* @param alias Command Alias
|
|
* @param permission Required Permission Node
|
|
*/
|
|
Command(final String command, final String alias, final CommandPermission permission) {
|
|
this.command = command;
|
|
this.alias = alias;
|
|
this.permission = permission;
|
|
}
|
|
|
|
/**
|
|
* @return command
|
|
*/
|
|
public String getCommand() {
|
|
return this.command;
|
|
}
|
|
|
|
/**
|
|
* @return alias
|
|
*/
|
|
public String getAlias() {
|
|
return this.alias;
|
|
}
|
|
|
|
/**
|
|
* @return permission object
|
|
*
|
|
* @see com.intellectualcrafters.plot.commands.CommandPermission
|
|
*/
|
|
public CommandPermission getPermission() {
|
|
return this.permission;
|
|
}
|
|
}
|