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-10-11 09:33:10 +02:00
|
|
|
*
|
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 04:42:08 +01: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-05-14 14:55:57 +02:00
|
|
|
|
|
|
|
ADD("add","a"),
|
|
|
|
TRUST("trust", "t"),
|
|
|
|
DENY("deny", "d"),
|
|
|
|
REMOVE("remove", "r"),
|
|
|
|
UNTRUST("untrust", "ut"),
|
|
|
|
UNDENY("undeny", "ud"),
|
2015-06-05 15:05:17 +02:00
|
|
|
TOGGLE("toggle", "attribute"),
|
2015-07-10 16:08:07 +02:00
|
|
|
DOWNLOAD("download", "dl"),
|
2015-05-14 14:55:57 +02:00
|
|
|
MOVE("move"),
|
2015-01-29 10:59:32 +01:00
|
|
|
FLAG("flag", "f"),
|
2015-02-01 06:32:04 +01:00
|
|
|
TARGET("target"),
|
2015-01-29 08:45:14 +01:00
|
|
|
CLUSTER("cluster", "clusters"),
|
2015-02-20 07:34:19 +01:00
|
|
|
BUY("buy", "b"),
|
2015-05-14 14:55:57 +02:00
|
|
|
CREATEROADSCHEMATIC("createroadschematic", "crs"),
|
2014-12-28 14:47:35 +01:00
|
|
|
DEBUGROADREGEN("debugroadregen"),
|
2015-02-03 03:46:25 +01:00
|
|
|
DEBUGFIXFLAGS("debugfixflags"),
|
2014-12-28 14:47:35 +01:00
|
|
|
REGENALLROADS("regenallroads"),
|
2015-07-15 21:57:11 +02:00
|
|
|
ALLOWUNSAFE("debugallowunsafe"),
|
2014-12-28 14:47:35 +01:00
|
|
|
DEBUGLOADTEST("debugloadtest"),
|
|
|
|
DEBUGSAVETEST("debugsavetest"),
|
|
|
|
UNCLAIM("unclaim"),
|
2015-02-28 03:10:41 +01:00
|
|
|
DEBUGCLEAR("debugclear", "fastclear"),
|
2014-10-23 12:21:27 +02:00
|
|
|
SWAP("swap"),
|
2014-10-22 07:21:57 +02:00
|
|
|
INBOX("inbox"),
|
2014-10-22 14:22:00 +02:00
|
|
|
DEBUGCLAIMTEST("debugclaimtest"),
|
2014-10-22 07:21:57 +02:00
|
|
|
COMMENT("comment", "msg"),
|
2014-10-12 17:26:58 +02:00
|
|
|
PASTE("paste"),
|
2014-10-13 19:40:30 +02:00
|
|
|
CLIPBOARD("clipboard", "cboard"),
|
2014-11-05 04:42:08 +01:00
|
|
|
COPY("copy"),
|
|
|
|
KICK("kick", "k"),
|
|
|
|
CLAIM("claim", "c"),
|
|
|
|
MERGE("merge", "m"),
|
|
|
|
UNLINK("unlink", "u"),
|
2015-05-14 14:55:57 +02:00
|
|
|
CLEAR("clear", "", new CommandPermission("plots.clear")),
|
|
|
|
DELETE("delete", "", new CommandPermission("plots.delete")),
|
|
|
|
DEBUG("debug", "", new CommandPermission("plots.admin")),
|
2014-11-02 20:01:04 +01:00
|
|
|
INTERFACE("interface", "int", new CommandPermission("plots.interface")),
|
2014-11-05 04:42:08 +01:00
|
|
|
HOME("home", "h"),
|
|
|
|
INFO("info", "i"),
|
|
|
|
LIST("list", "l"),
|
|
|
|
SET("set", "s"),
|
|
|
|
PURGE("purge"),
|
2014-11-20 00:00:38 +01:00
|
|
|
DATABASE("database", "convert"),
|
2015-03-07 06:22:15 +01:00
|
|
|
CONFIRM("confirm"),
|
2015-05-08 22:58:21 +02:00
|
|
|
TP("tp", "tp"),
|
|
|
|
CHAT("chat", "on|off", new CommandPermission("plots.chat"));
|
2014-11-20 00:00:38 +01:00
|
|
|
/**
|
|
|
|
* Command
|
|
|
|
*/
|
2014-12-18 03:15:11 +01:00
|
|
|
private final String command;
|
2014-11-20 00:00:38 +01:00
|
|
|
/**
|
|
|
|
* Alias
|
|
|
|
*/
|
2014-12-18 03:15:11 +01:00
|
|
|
private final String alias;
|
2014-11-20 00:00:38 +01:00
|
|
|
/**
|
|
|
|
* Permission Node
|
|
|
|
*/
|
|
|
|
private final CommandPermission permission;
|
2015-02-23 02:32:27 +01:00
|
|
|
|
2014-11-05 04:42:08 +01:00
|
|
|
/**
|
2014-12-18 03:15:11 +01:00
|
|
|
* @param command Command "name" (/plot [cmd])
|
2014-11-05 04:42:08 +01:00
|
|
|
*/
|
|
|
|
Command(final String command) {
|
|
|
|
this.command = command;
|
|
|
|
this.alias = command;
|
|
|
|
this.permission = new CommandPermission("plots." + command);
|
|
|
|
}
|
2015-02-23 02:32:27 +01:00
|
|
|
|
2014-11-05 04:42:08 +01:00
|
|
|
/**
|
2014-12-18 03:15:11 +01:00
|
|
|
* @param command Command "name" (/plot [cmd])
|
|
|
|
* @param permission Command Permission Node
|
2014-11-05 04:42:08 +01:00
|
|
|
*/
|
|
|
|
Command(final String command, final CommandPermission permission) {
|
|
|
|
this.command = command;
|
|
|
|
this.permission = permission;
|
|
|
|
this.alias = command;
|
|
|
|
}
|
2015-02-23 02:32:27 +01:00
|
|
|
|
2014-11-05 04:42:08 +01:00
|
|
|
/**
|
2014-12-18 03:15:11 +01:00
|
|
|
* @param command Command "name" (/plot [cmd])
|
|
|
|
* @param alias Command Alias
|
2014-11-05 04:42:08 +01:00
|
|
|
*/
|
|
|
|
Command(final String command, final String alias) {
|
|
|
|
this.command = command;
|
|
|
|
this.alias = alias;
|
|
|
|
this.permission = new CommandPermission("plots." + command);
|
|
|
|
}
|
2015-02-23 02:32:27 +01:00
|
|
|
|
2014-11-05 04:42:08 +01:00
|
|
|
/**
|
2014-12-18 03:15:11 +01:00
|
|
|
* @param command Command "name" (/plot [cmd])
|
|
|
|
* @param alias Command Alias
|
|
|
|
* @param permission Required Permission Node
|
2014-11-05 04:42:08 +01:00
|
|
|
*/
|
|
|
|
Command(final String command, final String alias, final CommandPermission permission) {
|
|
|
|
this.command = command;
|
|
|
|
this.alias = alias;
|
|
|
|
this.permission = permission;
|
|
|
|
}
|
2015-02-23 02:32:27 +01:00
|
|
|
|
2014-11-05 04:42:08 +01:00
|
|
|
/**
|
2014-11-20 00:00:38 +01:00
|
|
|
* @return command
|
2014-11-05 04:42:08 +01:00
|
|
|
*/
|
|
|
|
public String getCommand() {
|
|
|
|
return this.command;
|
|
|
|
}
|
2015-02-23 02:32:27 +01:00
|
|
|
|
2014-11-05 04:42:08 +01:00
|
|
|
/**
|
2014-11-20 00:00:38 +01:00
|
|
|
* @return alias
|
2014-11-05 04:42:08 +01:00
|
|
|
*/
|
|
|
|
public String getAlias() {
|
|
|
|
return this.alias;
|
|
|
|
}
|
2015-02-23 02:32:27 +01:00
|
|
|
|
2014-11-05 04:42:08 +01:00
|
|
|
/**
|
2014-11-20 00:00:38 +01:00
|
|
|
* @return permission object
|
2014-12-18 03:15:11 +01:00
|
|
|
*
|
2014-11-20 00:00:38 +01:00
|
|
|
* @see com.intellectualcrafters.plot.commands.CommandPermission
|
2014-11-05 04:42:08 +01:00
|
|
|
*/
|
|
|
|
public CommandPermission getPermission() {
|
|
|
|
return this.permission;
|
|
|
|
}
|
2014-09-22 13:02:14 +02:00
|
|
|
}
|