Skip to content

Commit

Permalink
name
Browse files Browse the repository at this point in the history
  • Loading branch information
Doridian committed Sep 10, 2023
1 parent a8543c1 commit 26168f1
Showing 1 changed file with 6 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -94,8 +94,11 @@ public boolean execute(@NotNull CommandSender source, @NotNull String command, @
public static class LuaTopic extends HelpTopic {
private LuaCommand command;

private LuaTopic(LuaCommand command) {
private final String name;

private LuaTopic(LuaCommand command, String name) {
this.command = command;
this.name = name;
}

@Override
Expand All @@ -109,7 +112,7 @@ public boolean canSee(@NotNull CommandSender commandSender) {

@Override
public @NotNull String getName() {
return "/" + command.getLabel();
return this.name;
}

@Override
Expand Down Expand Up @@ -143,7 +146,7 @@ public void register(String command, String permission, LuaState thread, LuaValu
final String helpTopicName = "/" + command;
LuaTopic helpTopic = helpTopics.get(helpTopicName);
if (helpTopic == null) {
helpTopic = new LuaTopic(luaCommand);
helpTopic = new LuaTopic(luaCommand, helpTopicName);
IndexHelpTopic indexTopic = (IndexHelpTopic)Bukkit.getHelpMap().getHelpTopic(plugin.getName());
Collection<HelpTopic> allTopics = getAllTopics(indexTopic);
allTopics.add(helpTopic);
Expand Down

0 comments on commit 26168f1

Please sign in to comment.