Skip to content

Commit

Permalink
🌟 ζ›΄ζ–°ζ³¨ε†Œ API
Browse files Browse the repository at this point in the history
  • Loading branch information
Gu-ZT committed Aug 31, 2024
1 parent 7a0bd9b commit 3058b17
Showing 1 changed file with 4 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -28,15 +28,16 @@ private <T> void addRegistry(Registry<T> registry) {
public <T> void addBuilder(Registry<T> registry, EntryBuilder<? extends T> builder) {
List<EntryBuilder<?>> builderList = this.builders.getOrDefault(registry, Collections.synchronizedList(new ArrayList<>()));
builderList.add(builder);
this.builders.put(registry, builderList);
this.addRegistry(registry);
}

@SuppressWarnings("unchecked")
protected <V, T extends V> List<EntryBuilder<T>> getBuilders(Registry<V> registry) {
List<EntryBuilder<?>> builderList = this.builders.getOrDefault(registry, Collections.synchronizedList(new ArrayList<>()));
return builderList.stream()
.map(builder -> (EntryBuilder<T>) builder)
.toList();
.map(builder -> (EntryBuilder<T>) builder)
.toList();
}

@NotNull
Expand All @@ -46,7 +47,7 @@ public Iterator<Registry<?>> iterator() {
}

private static final Map<Registry<?>, Integer> REGISTRY_PRIORITY = Map.of(
BuiltInRegistries.BLOCK, 1
BuiltInRegistries.BLOCK, 1
);

private static int getRegistryPriority(Registry<?> registry) {
Expand Down

0 comments on commit 3058b17

Please sign in to comment.