diff --git a/src/main/java/com/onarandombox/MultiverseCore/commands_acf/CheckCommand.java b/src/main/java/com/onarandombox/MultiverseCore/commands_acf/CheckCommand.java index dec8982e..150d2447 100644 --- a/src/main/java/com/onarandombox/MultiverseCore/commands_acf/CheckCommand.java +++ b/src/main/java/com/onarandombox/MultiverseCore/commands_acf/CheckCommand.java @@ -23,7 +23,7 @@ public class CheckCommand extends MultiverseCommand { @Subcommand("check") @CommandPermission("multiverse.core.debug") @Syntax("[player] ") - @CommandCompletion("@players") + @CommandCompletion("@players @destinations|@MVWorlds") @Description("Checks to see if a player can go to a destination. Prints debug if false.") public void onCheckCommand(@NotNull CommandSender sender, @NotNull @Flags("other,defaultself,fallbackself") Player player, diff --git a/src/main/java/com/onarandombox/MultiverseCore/commands_acf/TeleportCommand.java b/src/main/java/com/onarandombox/MultiverseCore/commands_acf/TeleportCommand.java index 2ab85225..127a41b8 100644 --- a/src/main/java/com/onarandombox/MultiverseCore/commands_acf/TeleportCommand.java +++ b/src/main/java/com/onarandombox/MultiverseCore/commands_acf/TeleportCommand.java @@ -43,9 +43,8 @@ public class TeleportCommand extends MultiverseCommand { public class Teleport extends BaseCommand { @Subcommand("teleport") - @CommandPermission("@destinations") @Syntax("[player] ") - @CommandCompletion("@players|@MVWorlds @MVWorlds") + @CommandCompletion("@players|@MVWorlds|@destinations @MVWorlds|@destinations") @Description("Allows you to the teleport to a location on your server!") public void doTeleportCommand(@NotNull CommandSender sender, @NotNull @Flags("other,defaultself,fallbackself") Player player, @@ -63,10 +62,9 @@ public class TeleportCommand extends MultiverseCommand { public class AliasTeleport extends BaseCommand { @CommandAlias("mvtp") - @CommandPermission("@destinations") @Syntax("[player] ") //TODO: playerOnly flag - @CommandCompletion("@players|@MVWorlds @MVWorlds") + @CommandCompletion("@players|@MVWorlds|@destinations @MVWorlds|@destinations") @Description("Alias for /mv tp") public void doTeleportCommand(@NotNull CommandSender sender, @NotNull @Flags("other,defaultself,fallbackself") Player player, diff --git a/src/main/java/com/onarandombox/MultiverseCore/commands_helper/MVCommandCompletions.java b/src/main/java/com/onarandombox/MultiverseCore/commands_helper/MVCommandCompletions.java index bcc7d177..f5a24cf3 100644 --- a/src/main/java/com/onarandombox/MultiverseCore/commands_helper/MVCommandCompletions.java +++ b/src/main/java/com/onarandombox/MultiverseCore/commands_helper/MVCommandCompletions.java @@ -36,17 +36,25 @@ public class MVCommandCompletions extends PaperCommandCompletions { registerAsyncCompletion("unloadedWorlds", this::suggestUnloadedWorlds); registerAsyncCompletion("potentialWorlds", this::suggestPotentialWorlds); registerAsyncCompletion("location", this::suggestLocation); - registerStaticCompletion("MVConfigs", suggestMVConfig()); - registerStaticCompletion("gameRules", suggestGameRules()); - registerStaticCompletion("environments", suggestEnvironments()); - registerStaticCompletion("setProperties", suggestSetProperties()); - registerStaticCompletion("addProperties", suggestAddProperties()); - registerStaticCompletion("livingEntities", suggestEntities()); - registerStaticCompletion("pasteTypes", suggestPasteTypes()); + registerAsyncCompletion("destinations", this::suggestDestinations); + registerStaticCompletion("MVConfigs", this::suggestMVConfig); + registerStaticCompletion("gameRules", this::suggestGameRules); + registerStaticCompletion("environments", this::suggestEnvironments); + registerStaticCompletion("setProperties", this::suggestSetProperties); + registerStaticCompletion("addProperties", this::suggestAddProperties); + registerStaticCompletion("livingEntities", this::suggestEntities); + registerStaticCompletion("pasteTypes", this::suggestPasteTypes); //TODO: Destinations } + private Collection suggestDestinations(@NotNull BukkitCommandCompletionContext context) { + //TODO: There is one empty dest need to remove. + return this.plugin.getDestFactory().getIdentifiers().stream() + .map(id -> id + ":") + .collect(Collectors.toList()); + } + @NotNull private Collection suggestMVWorlds(@NotNull BukkitCommandCompletionContext context) { return this.worldManager.getMVWorlds().stream()