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-10-03 04:36:30 +02:00
|
|
|
|
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>
|
2014-12-11 08:15:30 +01:00
|
|
|
/**
|
2014-12-16 06:03:20 +01:00
|
|
|
*
|
2014-12-11 08:15:30 +01:00
|
|
|
*/
|
|
|
|
UNCLAIM("unclaim"),
|
2014-11-20 00:00:38 +01:00
|
|
|
/**
|
|
|
|
*
|
|
|
|
*/
|
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-11-05 04:42:08 +01:00
|
|
|
TRUSTED("trusted", "trust"),
|
|
|
|
/**
|
|
|
|
*
|
|
|
|
*/
|
2014-10-12 17:26:58 +02:00
|
|
|
PASTE("paste"),
|
2014-11-20 00:00:38 +01:00
|
|
|
/**
|
|
|
|
*
|
|
|
|
*/
|
2014-10-13 19:40:30 +02:00
|
|
|
CLIPBOARD("clipboard", "cboard"),
|
2014-11-20 00:00:38 +01:00
|
|
|
/**
|
|
|
|
*
|
|
|
|
*/
|
2014-11-05 04:42:08 +01: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-05 04:42:08 +01:00
|
|
|
/**
|
|
|
|
*
|
|
|
|
*/
|
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"),
|
|
|
|
/**
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
SETUP("setup"),
|
|
|
|
/**
|
|
|
|
*
|
|
|
|
*/
|
2014-11-09 19:27:46 +01:00
|
|
|
OP("op", "admin"),
|
2014-11-20 00:00:38 +01:00
|
|
|
/**
|
|
|
|
*
|
|
|
|
*/
|
2014-11-09 19:27:46 +01:00
|
|
|
DEOP("deop", "deadmin"),
|
2014-11-20 00:00:38 +01:00
|
|
|
/**
|
|
|
|
*
|
|
|
|
*/
|
2014-11-09 17:22:53 +01:00
|
|
|
BAN("ban", "block"),
|
2014-11-05 04:42:08 +01:00
|
|
|
/**
|
|
|
|
*
|
|
|
|
*/
|
2014-11-20 00:00:38 +01:00
|
|
|
UNBAN("unban", "unblock"),
|
2014-11-05 04:42:08 +01:00
|
|
|
/**
|
|
|
|
*
|
|
|
|
*/
|
2014-11-20 00:00:38 +01:00
|
|
|
DATABASE("database", "convert"),
|
2014-11-05 04:42:08 +01:00
|
|
|
/**
|
|
|
|
*
|
|
|
|
*/
|
2014-11-20 00:00:38 +01:00
|
|
|
TP("tp", "tp");
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Command
|
|
|
|
*/
|
2014-12-16 06:03:20 +01:00
|
|
|
private final String command;
|
2014-11-20 00:00:38 +01:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Alias
|
|
|
|
*/
|
2014-12-16 06:03:20 +01:00
|
|
|
private final String alias;
|
2014-11-20 00:00:38 +01:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Permission Node
|
|
|
|
*/
|
|
|
|
private final CommandPermission permission;
|
2014-09-22 13:02:14 +02:00
|
|
|
|
2014-11-05 04:42:08 +01:00
|
|
|
/**
|
2014-12-16 06:03:20 +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);
|
|
|
|
}
|
2014-09-22 13:02:14 +02:00
|
|
|
|
2014-11-05 04:42:08 +01:00
|
|
|
/**
|
2014-12-16 06:03:20 +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;
|
|
|
|
}
|
2014-09-22 13:02:14 +02:00
|
|
|
|
2014-11-05 04:42:08 +01:00
|
|
|
/**
|
2014-12-16 06:03:20 +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);
|
|
|
|
}
|
2014-09-22 13:02:14 +02:00
|
|
|
|
2014-11-05 04:42:08 +01:00
|
|
|
/**
|
2014-12-16 06:03:20 +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;
|
|
|
|
}
|
2014-09-22 13:02:14 +02: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;
|
|
|
|
}
|
2014-09-22 13:02:14 +02: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;
|
|
|
|
}
|
2014-09-22 13:02:14 +02:00
|
|
|
|
2014-11-05 04:42:08 +01:00
|
|
|
/**
|
2014-11-20 00:00:38 +01:00
|
|
|
* @return permission object
|
|
|
|
* @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
|
|
|
}
|