diff --git a/src/main/java/kamkeel/npcs/util/Register.java b/src/main/java/kamkeel/npcs/util/Register.java index e1cbfaf79..5e6a7ba7f 100644 --- a/src/main/java/kamkeel/npcs/util/Register.java +++ b/src/main/java/kamkeel/npcs/util/Register.java @@ -117,7 +117,9 @@ public class Register { try { String path = "/assets/" + namespace + "/" + animationsPath; for (Map.Entry> 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) { diff --git a/src/main/java/noppes/npcs/controllers/AnimationController.java b/src/main/java/noppes/npcs/controllers/AnimationController.java index 5fc310c91..3d66fa11c 100644 --- a/src/main/java/noppes/npcs/controllers/AnimationController.java +++ b/src/main/java/noppes/npcs/controllers/AnimationController.java @@ -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()); } }