Fixed wrong names being registered on Animation register and added debug to anim controller

This commit is contained in:
Vidal committed 2026-02-16 20:21:32 -03:00
1 parent d826206d31
commit dd6a27b915
2 files changed
+5 -1

No files matched your search

@@ -117,7 +117,9 @@ public class Register<T> {
try {
String path = "/assets/" + namespace + "/" + animationsPath;
for (Map.Entry<String, Supplier<Animation>> entry : entries.entrySet()) {
String name = entry.getKey().substring(entry.getKey().indexOf(namespace + ".") + 1);
String prefix = registryKey + "." + namespace + ".";
String key = entry.getKey();
String name = key.substring(prefix.length());
AnimationController.Instance.loadBuiltInAnimation(modClass, path, name);
}
} catch (Exception e) {
@@ -123,6 +123,7 @@ public class AnimationController implements IAnimationHandler {
String resourcePath = path + "/" + animName + ".json";
try (InputStream stream = modClass.getResourceAsStream(resourcePath)) {
if (stream == null) {
LogWriter.error("Animation not found: " + animName.toLowerCase());
return;
}
@@ -143,6 +144,7 @@ public class AnimationController implements IAnimationHandler {
// Store with lowercase key for case-insensitive lookup
builtInAnimations.put(animName.toLowerCase(), animation);
LogWriter.info("Registered animation: " + animName.toLowerCase());
}
}