feat: add ability to customise the home delimiter

This commit is contained in:
William278 committed 2025-03-02 14:44:34 +00:00
1 parent c5b3b1dbb5
commit 0cfcf14109
7 files changed
+33 -16

No files matched your search

@@ -40,8 +40,8 @@ public class PublicHomeCommand extends HomeCommand implements TabCompletable {
public void execute(@NotNull CommandUser executor, @NotNull String[] args) {
// Display the public home list if no arguments are provided
if (args.length == 0) {
plugin.getCommand(PublicHomeListCommand.class)
.ifPresent(command -> command.showPublicHomeList(executor, null, 1));
plugin.getCommand(PublicHomeListCommand.class).ifPresent(cmd -> cmd
.showPublicHomeList(executor, null, 1));
return;
}
super.execute(executor, args);
@@ -51,7 +51,7 @@ public class PublicHomeCommand extends HomeCommand implements TabCompletable {
@NotNull
public List<String> suggest(@NotNull CommandUser executor, @NotNull String[] args) {
if (args.length <= 2) {
if (args.length >= 1 && args[0].contains(Home.IDENTIFIER_DELIMITER)) {
if (args.length >= 1 && args[0].contains(Home.getDelimiter())) {
return plugin.getManager().homes().getPublicHomeIdentifierNames();
}
return plugin.getManager().homes().getPublicHomeNames();