Skip to content

Commit

Permalink
Add iterator over entries
Browse files Browse the repository at this point in the history
  • Loading branch information
oh-noey committed Aug 10, 2024
1 parent 07bb70a commit 8b79942
Showing 1 changed file with 10 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
import org.bukkit.NamespacedKey;
import org.jetbrains.annotations.NotNull;

import java.util.Enumeration;
import java.util.Set;
import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.ConcurrentMap;
import java.util.function.Function;
Expand Down Expand Up @@ -41,4 +43,12 @@ public CraftDataTagRegistry(){
public boolean isRegistered(final @NotNull NamespacedKey key){
return _registeredTags.containsKey(key);
}

/**
* Get an iterable over all keys currently registered.
* @return An immutable iterable over the registry keys
*/
public @NotNull Iterable<@NotNull NamespacedKey> getAllKeys(){
return _registeredTags.keySet().stream().toList();
}
}

0 comments on commit 8b79942

Please sign in to comment.