Merge pull request #285 from TheLonelyWolf1/master

Implement toggle for disabling the Import Command.
This commit is contained in:
RockyHawk 2024-01-13 16:00:43 +11:00 committed by GitHub
commit 2aced6e917
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 0 deletions

View File

@ -17,6 +17,7 @@ config:
disabled-world-message: true
panel-snooper: false
allow-unsafe-mini-message: false
enable-import-command: false
format:
tag: '&6[&bCommandPanels&6] '
perms: '&cNo permission.'
@ -28,6 +29,7 @@ config:
offline: 'Offline'
offlineHeadValue: 'eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvNmU1Mjg2YzQ3MGY2NmZmYTFhMTgzMzFjYmZmYjlhM2MyYTQ0MjRhOGM3MjU5YzQ0MzZmZDJlMzU1ODJhNTIyIn19fQ=='
input: '&cYour Input is too long!'
disabled: '&cThis feature is disabled in your plugin config.'
input:
input-cancel: cancel
input-cancelled: '&cCancelled!'

View File

@ -18,6 +18,10 @@ public class CommandPanelImport implements CommandExecutor {
@Override
public boolean onCommand(CommandSender sender, Command cmd, String label, String[] args) {
if (sender.hasPermission("commandpanel.import")) {
if(!plugin.config.getString("config.enable-import-command").equalsIgnoreCase("true")){
sender.sendMessage(plugin.tex.colour(plugin.tag + plugin.config.getString("config.format.disabled")));
return true;
}
if (args.length == 2) {
//import command
new BukkitRunnable() {