Skip to content

Commit 96edb2f

Browse files
committed
RegistryHolders - changes
- fix an issue with the supplier returning double entries - sort the supplier - general cleanup
1 parent 6514680 commit 96edb2f

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

src/main/java/com/shanebeestudios/skbee/api/registry/RegistryHolders.java

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -115,17 +115,15 @@ private static <F extends Keyed, T> void register(RegistryKey<F> key, Class<T> r
115115

116116
public static String getDocUsage() {
117117
List<String> docNames = new ArrayList<>();
118-
REGISTRY_HOLDERS_BY_REGISTRY_KEY.forEach((key, holder) -> {
119-
docNames.add(holder.getDocString());
120-
});
118+
REGISTRY_HOLDERS_BY_REGISTRY_KEY.forEach((key, holder) -> docNames.add(holder.getDocString()));
121119
Collections.sort(docNames);
122120
return String.join("\n", docNames);
123121
}
124122

125123
@SuppressWarnings("rawtypes")
126124
public static Supplier<Iterator<RegistryKey>> getSupplier() {
127125
List<RegistryKey> keys = new ArrayList<>();
128-
REGISTRY_HOLDERS_BY_NAME.forEach((key, holder) -> keys.add(holder.getRegistryKey()));
126+
REGISTRY_HOLDERS_BY_REGISTRY_KEY.keySet().stream().sorted(java.util.Comparator.comparing(Object::toString)).forEach(keys::add);
129127
return keys::iterator;
130128
}
131129

0 commit comments

Comments
 (0)