Added an option to register multiple animations under one common name

This commit is contained in:
Vidal committed 2026-02-14 16:22:53 -03:00
1 parent 7009bddc20
commit e1eda3ce19
1 file changed
+10
@@ -103,6 +103,16 @@ public class Register<T> {
return super.register(factoryName, factory);
}
public Animation[] registerBundle(String factoryName, Supplier<Animation> factory, String... appendixes) {
List<Animation> animations = new ArrayList<>();
for (String appendix : appendixes) {
entries.put(registryKey + "." + namespace + "." + factoryName + "_" + appendix, factory);
animations.add(factory.get());
}
return animations.toArray(new Animation[0]);
}
public void register() {
try {
String path = "/assets/" + namespace + "/" + animationsPath;