Skip to content

Commit ac6a7ad

Browse files
committed
Fixed command tab-completions
1 parent 87b082f commit ac6a7ad

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

src/main/java/pro/cloudnode/smp/enchantbookplus/MainCommand.java

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77
import org.bukkit.command.CommandSender;
88
import org.bukkit.command.TabCompleter;
99
import org.jetbrains.annotations.NotNull;
10-
import org.jetbrains.annotations.Nullable;
1110

1211
import java.util.List;
1312
import java.util.Optional;
@@ -21,8 +20,10 @@ public boolean onCommand(@NotNull CommandSender sender, @NotNull Command command
2120
}
2221

2322
@Override
24-
public @Nullable List<String> onTabComplete(@NotNull CommandSender sender, @NotNull Command command, @NotNull String label, @NotNull String @NotNull [] args) {
25-
return null;
23+
public @NotNull List<String> onTabComplete(@NotNull CommandSender sender, @NotNull Command command, @NotNull String label, @NotNull String @NotNull [] args) {
24+
if (sender.hasPermission(Permissions.RELOAD))
25+
return List.of("reload");
26+
return List.of();
2627
}
2728

2829
/**

0 commit comments

Comments
 (0)