diff options
| author | Arslaan Pathan <[email protected]> | 2026-09-26 17:05:36 +1200 |
|---|---|---|
| committer | Arslaan Pathan <[email protected]> | 2026-09-26 17:05:36 +1200 |
| commit | 14c68eb5ba16774f581d95a39e64a7b303954ffc (patch) | |
| tree | 2888ef11f47c6a639d440300ef580c247ad1bcb1 /src/main/java/com/arslaancodes/arslaansmagichax/commands/ModuleSuggestionProvider.java | |
| parent | 766ba1c1d977442332cadaaeca93d795baa559df (diff) | |
| download | arslaansmagichax-14c68eb5ba16774f581d95a39e64a7b303954ffc.tar.xz arslaansmagichax-14c68eb5ba16774f581d95a39e64a7b303954ffc.zip | |
migration to 26.2 - run migrateMappings with old loom then bring it back to new
Diffstat (limited to 'src/main/java/com/arslaancodes/arslaansmagichax/commands/ModuleSuggestionProvider.java')
| -rw-r--r-- | src/main/java/com/arslaancodes/arslaansmagichax/commands/ModuleSuggestionProvider.java | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/src/main/java/com/arslaancodes/arslaansmagichax/commands/ModuleSuggestionProvider.java b/src/main/java/com/arslaancodes/arslaansmagichax/commands/ModuleSuggestionProvider.java new file mode 100644 index 0000000..881ddd6 --- /dev/null +++ b/src/main/java/com/arslaancodes/arslaansmagichax/commands/ModuleSuggestionProvider.java @@ -0,0 +1,26 @@ +package com.arslaancodes.arslaansmagichax.commands; + +import com.mojang.brigadier.context.CommandContext; +import com.mojang.brigadier.exceptions.CommandSyntaxException; +import com.mojang.brigadier.suggestion.SuggestionProvider; +import com.mojang.brigadier.suggestion.Suggestions; +import com.mojang.brigadier.suggestion.SuggestionsBuilder; +import net.fabricmc.fabric.api.client.command.v2.FabricClientCommandSource; +import com.arslaancodes.arslaansmagichax.modules.Module; +import com.arslaancodes.arslaansmagichax.modules.ModuleManager; + +import java.util.List; +import java.util.concurrent.CompletableFuture; + +public class ModuleSuggestionProvider implements SuggestionProvider<FabricClientCommandSource> { + @Override + public CompletableFuture<Suggestions> getSuggestions(CommandContext<FabricClientCommandSource> context, SuggestionsBuilder builder) throws CommandSyntaxException { + List<Module> modules = ModuleManager.getAllModules(); + + for (Module module : modules) { + builder.suggest(module.getName()); + } + + return builder.buildFuture(); + } +}
\ No newline at end of file |
