From 0e83e76653b2adec7a75002931a15ea7ea3a9f95 Mon Sep 17 00:00:00 2001 From: GeorgH93 Date: Sat, 16 Jun 2018 18:55:10 +0200 Subject: [PATCH] Allow the open command to be executed from the help by clicking it --- .../Minepacks/Bukkit/Command/CommandManager.java | 4 ++-- .../pcgamingfreaks/Minepacks/Bukkit/Command/OpenCommand.java | 3 ++- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/at/pcgamingfreaks/Minepacks/Bukkit/Command/CommandManager.java b/src/at/pcgamingfreaks/Minepacks/Bukkit/Command/CommandManager.java index bd76bb3..1cf3c10 100644 --- a/src/at/pcgamingfreaks/Minepacks/Bukkit/Command/CommandManager.java +++ b/src/at/pcgamingfreaks/Minepacks/Bukkit/Command/CommandManager.java @@ -50,7 +50,7 @@ public CommandManager(Minepacks plugin) backpackCommand.setExecutor(this); backpackCommand.setTabCompleter(this); - helpFormat = plugin.getLanguage().getMessage("Commands.HelpFormat").replaceAll("\\{MainCommand\\}", "%1\\$s").replaceAll("\\{SubCommand\\}", "%2\\$s").replaceAll("\\{Parameters\\}", "%3\\$s").replaceAll("\\{Description\\}", "%4\\$s"); + helpFormat = plugin.getLanguage().getMessage("Commands.HelpFormat").replaceAll("\\{MainCommand\\}", "%1\\$s").replaceAll("\\{SubCommand\\}", "%2\\$s").replaceAll("\\{Parameters\\}", "%3\\$s").replaceAll("\\{Description\\}", "%4\\$s").replaceAll("suggest_command", "%5\\$s"); // Setting the help format for the marry commands as well as the no permissions and not from console message try @@ -128,7 +128,7 @@ public void sendHelp(CommandSender target, String mainCommandAlias, Collection tabComplete(@NotNull CommandSender commandSender, @NotNull S public List getHelp(@NotNull CommandSender requester) { List help = new LinkedList<>(); - help.add(new HelpData("", null, getDescription())); + help.add(new HelpData("", null, getDescription(), MessageClickEvent.ClickEventAction.RUN_COMMAND)); if(requester.hasPermission("backpack.open.other")) { //noinspection ConstantConditions