mirror of
https://github.com/KAMKEEL/CustomNPC-Plus.git
synced 2026-11-19 06:09:05 +00:00
WIP Animations Register
This commit is contained in:
1 parent
c39ce6b6d1
commit
c168702970
4 files changed
+43
-14
No files matched your search
@@ -2,6 +2,9 @@ package kamkeel.npcs.util;
|
||||
|
||||
import kamkeel.npcs.controllers.data.ability.Ability;
|
||||
import kamkeel.npcs.controllers.data.ability.AbilityController;
|
||||
import noppes.npcs.LogWriter;
|
||||
import noppes.npcs.controllers.AnimationController;
|
||||
import noppes.npcs.controllers.data.Animation;
|
||||
|
||||
import java.util.LinkedHashMap;
|
||||
import java.util.Map;
|
||||
@@ -34,5 +37,20 @@ public class Register<T> {
|
||||
}
|
||||
}
|
||||
|
||||
// TODO ADD ANIMATION REGISTER
|
||||
public static class Animations extends Register<Animation> {
|
||||
private final Class<?> modClass;
|
||||
private final String animationsPath;
|
||||
|
||||
public Animations(Class<?> modClass, String animationsPath, String namespace) {
|
||||
super("ability", namespace);
|
||||
this.animationsPath = animationsPath;
|
||||
this.modClass = modClass;
|
||||
}
|
||||
|
||||
public void register() throws Exception {
|
||||
for (Map.Entry<String, Supplier<Animation>> entry : entries.entrySet()) {
|
||||
AnimationController.Instance.loadBuiltInAnimation(modClass, animationsPath, entry.getKey());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user