Use for-each

This commit is contained in:
TheMode 2021-08-10 01:17:44 +02:00
parent 18058bc3c8
commit 36f3355a12

View File

@ -83,11 +83,11 @@ public final class Registry {
@ApiStatus.Internal @ApiStatus.Internal
public Container(Resource resource, Loader<T> loader) { public Container(Resource resource, Loader<T> loader) {
final JsonObject objects = Registry.load(resource); final JsonObject objects = Registry.load(resource);
objects.entrySet().forEach(entry -> { for (var entry : objects.entrySet()) {
final String namespace = entry.getKey(); final String namespace = entry.getKey();
final JsonObject object = entry.getValue().getAsJsonObject(); final JsonObject object = entry.getValue().getAsJsonObject();
loader.accept(this, namespace, object); loader.accept(this, namespace, object);
}); }
} }
public T get(@NotNull String namespace) { public T get(@NotNull String namespace) {