Skip to content

Commit

Permalink
feat(api): Add ability to get id's of known data component value conv…
Browse files Browse the repository at this point in the history
…erter providers
  • Loading branch information
zml2008 committed Apr 24, 2024
1 parent bd255cc commit 27baf7e
Showing 1 changed file with 13 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@
import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.ConcurrentMap;
import java.util.function.BiFunction;
import java.util.stream.Collectors;
import net.kyori.adventure.key.Key;
import net.kyori.adventure.util.Services;
import net.kyori.examination.Examinable;
Expand All @@ -56,6 +57,18 @@ public final class DataComponentValueConverterRegistry {
private DataComponentValueConverterRegistry() {
}

/**
* Get the id's of all registered conversion providers.
*
* @return an unmodifiable set of the known provider ids
* @since 4.1.7.0
*/
public static Set<Key> knownProviders() {
return Collections.unmodifiableSet(PROVIDERS.stream()
.map(Provider::id)
.collect(Collectors.toSet()));
}

/**
* Try to convert the data component value {@code in} to the provided output type.
*
Expand Down

0 comments on commit 27baf7e

Please sign in to comment.