mirror of
https://github.com/GeorgH93/Minepacks.git
synced 2024-12-28 17:48:22 +01:00
Allow the open command to be executed from the help by clicking it
This commit is contained in:
parent
be6644b4d5
commit
0e83e76653
@ -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<H
|
||||
{
|
||||
for(HelpData d : data)
|
||||
{
|
||||
helpFormat.send(target, mainCommandAlias, d.getTranslatedSubCommand(), d.getParameter(), d.getDescription());
|
||||
helpFormat.send(target, mainCommandAlias, d.getTranslatedSubCommand(), d.getParameter(), d.getDescription(), d.getClickAction().name().toLowerCase());
|
||||
}
|
||||
}
|
||||
}
|
@ -20,6 +20,7 @@
|
||||
import at.pcgamingfreaks.Bukkit.Message.Message;
|
||||
import at.pcgamingfreaks.Calendar.TimeSpan;
|
||||
import at.pcgamingfreaks.Command.HelpData;
|
||||
import at.pcgamingfreaks.Message.MessageClickEvent;
|
||||
import at.pcgamingfreaks.Minepacks.Bukkit.API.MinepacksCommand;
|
||||
import at.pcgamingfreaks.Minepacks.Bukkit.Minepacks;
|
||||
|
||||
@ -121,7 +122,7 @@ public List<String> tabComplete(@NotNull CommandSender commandSender, @NotNull S
|
||||
public List<HelpData> getHelp(@NotNull CommandSender requester)
|
||||
{
|
||||
List<HelpData> 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
|
||||
|
Loading…
Reference in New Issue
Block a user