Add /gus and /griefus commands
This commit is contained in:
parent
422fbd1483
commit
d1ad6e42af
3 changed files with 13 additions and 6 deletions
|
|
@ -7,13 +7,10 @@ import org.bukkit.command.Command;
|
||||||
import org.bukkit.command.CommandExecutor;
|
import org.bukkit.command.CommandExecutor;
|
||||||
import org.bukkit.command.CommandSender;
|
import org.bukkit.command.CommandSender;
|
||||||
|
|
||||||
import net.coreprotect.config.ConfigHandler;
|
|
||||||
import net.coreprotect.language.Phrase;
|
import net.coreprotect.language.Phrase;
|
||||||
import net.coreprotect.thread.NetworkHandler;
|
|
||||||
import net.coreprotect.utility.Chat;
|
import net.coreprotect.utility.Chat;
|
||||||
import net.coreprotect.utility.Color;
|
import net.coreprotect.utility.Color;
|
||||||
import net.coreprotect.utility.Extensions;
|
import net.coreprotect.utility.Extensions;
|
||||||
import net.coreprotect.utility.VersionUtils;
|
|
||||||
|
|
||||||
public class CommandHandler implements CommandExecutor {
|
public class CommandHandler implements CommandExecutor {
|
||||||
private static CommandHandler instance;
|
private static CommandHandler instance;
|
||||||
|
|
@ -30,7 +27,7 @@ public class CommandHandler implements CommandExecutor {
|
||||||
public boolean onCommand(CommandSender user, Command command, String commandLabel, String[] argumentArray) {
|
public boolean onCommand(CommandSender user, Command command, String commandLabel, String[] argumentArray) {
|
||||||
String commandName = command.getName().toLowerCase(Locale.ROOT);
|
String commandName = command.getName().toLowerCase(Locale.ROOT);
|
||||||
|
|
||||||
if (commandName.equals("core") || commandName.equals("coreprotect") || commandName.equals("co")) {
|
if (commandName.equals("core") || commandName.equals("coreprotect") || commandName.equals("co") || commandName.equals("griefus") || commandName.equals("gus")) {
|
||||||
int resultc = argumentArray.length;
|
int resultc = argumentArray.length;
|
||||||
if (resultc > -1) {
|
if (resultc > -1) {
|
||||||
String corecommand = "help";
|
String corecommand = "help";
|
||||||
|
|
|
||||||
|
|
@ -90,6 +90,10 @@ public class PluginInitializationService {
|
||||||
plugin.getCommand("core").setTabCompleter(new TabHandler());
|
plugin.getCommand("core").setTabCompleter(new TabHandler());
|
||||||
plugin.getCommand("co").setExecutor(CommandHandler.getInstance());
|
plugin.getCommand("co").setExecutor(CommandHandler.getInstance());
|
||||||
plugin.getCommand("co").setTabCompleter(new TabHandler());
|
plugin.getCommand("co").setTabCompleter(new TabHandler());
|
||||||
|
plugin.getCommand("griefus").setExecutor(CommandHandler.getInstance());
|
||||||
|
plugin.getCommand("griefus").setTabCompleter(new TabHandler());
|
||||||
|
plugin.getCommand("gus").setExecutor(CommandHandler.getInstance());
|
||||||
|
plugin.getCommand("gus").setTabCompleter(new TabHandler());
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
||||||
|
|
@ -27,12 +27,12 @@ commands:
|
||||||
usage: /<command> <params>
|
usage: /<command> <params>
|
||||||
gus:
|
gus:
|
||||||
description: Utilize the plugin
|
description: Utilize the plugin
|
||||||
permission: coreprotect.coreprotect
|
permission: coreprotect.gus
|
||||||
permission-message: §3Griefus §f- You do not have permission to do that.
|
permission-message: §3Griefus §f- You do not have permission to do that.
|
||||||
usage: /<command> <params>
|
usage: /<command> <params>
|
||||||
griefus:
|
griefus:
|
||||||
description: Utilize the plugin
|
description: Utilize the plugin
|
||||||
permission: coreprotect.coreprotect
|
permission: coreprotect.griefus
|
||||||
permission-message: §3Griefus §f- You do not have permission to do that.
|
permission-message: §3Griefus §f- You do not have permission to do that.
|
||||||
usage: /<command> <params>
|
usage: /<command> <params>
|
||||||
permissions:
|
permissions:
|
||||||
|
|
@ -72,6 +72,12 @@ permissions:
|
||||||
coreprotect.coreprotect:
|
coreprotect.coreprotect:
|
||||||
description: Has permission to access the Griefus /coreprotect command
|
description: Has permission to access the Griefus /coreprotect command
|
||||||
default: false
|
default: false
|
||||||
|
coreprotect.gus:
|
||||||
|
description: Has permission to access the Griefus /gus command
|
||||||
|
default: true
|
||||||
|
coreprotect.griefus:
|
||||||
|
description: Has permission to access the Griefus /griefus command
|
||||||
|
default: false
|
||||||
coreprotect.lookup:
|
coreprotect.lookup:
|
||||||
description: Has permission to use the lookup command
|
description: Has permission to use the lookup command
|
||||||
default: op
|
default: op
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue