mirror of
https://github.com/KAMKEEL/CustomNPC-Plus.git
synced 2026-11-12 06:07:27 +00:00
Added an option to register multiple animations under one common name
This commit is contained in:
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;
|
||||
|
||||
Reference in new issue
Block a user