mirror of
https://github.com/PaperMC/Paper.git
synced 2025-07-31 20:22:05 -07:00
Add keyStream() API to registries (#12479)
This commit is contained in:
@@ -49,6 +49,11 @@ public final class DelayedRegistry<T extends Keyed, R extends Registry<T>> imple
|
||||
return this.delegate().stream();
|
||||
}
|
||||
|
||||
@Override
|
||||
public Stream<NamespacedKey> keyStream() {
|
||||
return this.delegate().keyStream();
|
||||
}
|
||||
|
||||
@Override
|
||||
public int size() {
|
||||
return this.delegate().size();
|
||||
|
@@ -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();
|
||||
|
Reference in New Issue
Block a user