Skip to content

Commit 07f02da

Browse files
committed
small fix for command help
1 parent d2b41e3 commit 07f02da

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
<modelVersion>4.0.0</modelVersion>
77
<groupId>io.github.mooy1</groupId>
88
<artifactId>InfinityLib</artifactId>
9-
<version>1.3.3</version>
9+
<version>1.3.4</version>
1010

1111
<properties>
1212
<maven.compiler.source>1.8</maven.compiler.source>

src/main/java/io/github/mooy1/infinitylib/commands/AddonCommand.java

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@
3030
public final class AddonCommand extends ParentCommand implements TabExecutor, Listener {
3131

3232
private final String help;
33+
private final String slashHelp;
3334

3435
public AddonCommand(String command) {
3536
this(Objects.requireNonNull(AbstractAddon.instance().getCommand(command),
@@ -44,7 +45,8 @@ public AddonCommand(PluginCommand command) {
4445

4546
Events.registerListener(this);
4647

47-
help = "help" + command.getName();
48+
help = "help " + command.getName();
49+
slashHelp = "/" + help;
4850

4951
addSub(new InfoCommand(AbstractAddon.instance()));
5052
addSub(new AliasesCommand(command));
@@ -59,8 +61,8 @@ private void onServerCommand(ServerCommandEvent e) {
5961

6062
@EventHandler(priority = EventPriority.MONITOR, ignoreCancelled = true)
6163
private void onPlayerCommand(PlayerCommandPreprocessEvent e) {
62-
if (e.getMessage().toLowerCase(Locale.ROOT).startsWith(help)) {
63-
e.setMessage(name());
64+
if (e.getMessage().toLowerCase(Locale.ROOT).startsWith(slashHelp)) {
65+
e.setMessage("/" + name());
6466
}
6567
}
6668

0 commit comments

Comments
 (0)