Skip to content

Commit

Permalink
fix: update tab-completion for /generateseed
Browse files Browse the repository at this point in the history
  • Loading branch information
Siroshun09 committed Feb 20, 2024
1 parent 351a49b commit eca14e9
Showing 1 changed file with 4 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,8 @@

import java.util.Collections;
import java.util.List;
import java.util.Locale;
import java.util.concurrent.CompletableFuture;
import java.util.concurrent.Executor;
import java.util.stream.Stream;

import static com.github.siroshun09.biomefinder.message.CommandMessages.GENERATED_SEED;
import static com.github.siroshun09.biomefinder.message.CommandMessages.GENERATE_SEED_HELP;
Expand Down Expand Up @@ -81,9 +79,10 @@ public boolean onCommand(@NotNull CommandSender sender, @NotNull Command command
return Collections.emptyList();
}

return Stream.of(Biome.values())
.map(Enum::name)
.filter(biome -> biome.startsWith(args[0].toUpperCase(Locale.ENGLISH)))
return Registry.BIOME.stream()
.map(Biome::getKey)
.filter(key -> key.asString().startsWith(args[0]) || key.asMinimalString().startsWith(args[0]))
.map(Key::asString)
.toList();
}
}

0 comments on commit eca14e9

Please sign in to comment.