Add keyStream() API to registries (#12479)

This commit is contained in:
Maddy Miller
2025-04-25 22:26:56 +10:00
committed by GitHub
parent 3409e2d73f
commit 1cfc96bcf7
3 changed files with 28 additions and 0 deletions

View File

@@ -233,6 +233,12 @@ public class CraftRegistry<B extends Keyed, M> implements Registry<B> {
return this.minecraftRegistry.keySet().stream().map(minecraftKey -> this.get(CraftNamespacedKey.fromMinecraft(minecraftKey)));
}
@NotNull
@Override
public Stream<NamespacedKey> keyStream() {
return this.minecraftRegistry.keySet().stream().map(CraftNamespacedKey::fromMinecraft);
}
@Override
public int size() {
return this.minecraftRegistry.size();