Add /gus and /griefus commands

This commit is contained in:
Roman Zhuravlev 2025-11-02 05:44:00 +05:00
parent 422fbd1483
commit d1ad6e42af
3 changed files with 13 additions and 6 deletions

View file

@ -7,13 +7,10 @@ import org.bukkit.command.Command;
import org.bukkit.command.CommandExecutor;
import org.bukkit.command.CommandSender;
import net.coreprotect.config.ConfigHandler;
import net.coreprotect.language.Phrase;
import net.coreprotect.thread.NetworkHandler;
import net.coreprotect.utility.Chat;
import net.coreprotect.utility.Color;
import net.coreprotect.utility.Extensions;
import net.coreprotect.utility.VersionUtils;
public class CommandHandler implements CommandExecutor {
private static CommandHandler instance;
@ -30,7 +27,7 @@ public class CommandHandler implements CommandExecutor {
public boolean onCommand(CommandSender user, Command command, String commandLabel, String[] argumentArray) {
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;
if (resultc > -1) {
String corecommand = "help";

View file

@ -90,6 +90,10 @@ public class PluginInitializationService {
plugin.getCommand("core").setTabCompleter(new TabHandler());
plugin.getCommand("co").setExecutor(CommandHandler.getInstance());
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());
}
/**

View file

@ -27,12 +27,12 @@ commands:
usage: /<command> <params>
gus:
description: Utilize the plugin
permission: coreprotect.coreprotect
permission: coreprotect.gus
permission-message: §3Griefus §f- You do not have permission to do that.
usage: /<command> <params>
griefus:
description: Utilize the plugin
permission: coreprotect.coreprotect
permission: coreprotect.griefus
permission-message: §3Griefus §f- You do not have permission to do that.
usage: /<command> <params>
permissions:
@ -72,6 +72,12 @@ permissions:
coreprotect.coreprotect:
description: Has permission to access the Griefus /coreprotect command
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:
description: Has permission to use the lookup command
default: op