Fix Animation Syncing for Built in

This commit is contained in:
Kam committed 2026-02-20 13:13:45 -05:00
1 parent cb57e26d04
commit 14545818bd
2 files changed
+20

No files matched your search

@@ -335,6 +335,14 @@ public class CustomNpcs {
@EventHandler
public void loadComplete(FMLLoadCompleteEvent ev) {
proxy.buildPackageIndex();
// Load built-in animations on the client so they're available for ability preview.
// On dedicated servers, AnimationController.load() only runs on the server JVM,
// leaving the client without built-in animation data. In singleplayer, load()
// runs later during server start and reloads everything, so this is harmless.
if (FMLCommonHandler.instance().getSide().isClient()) {
AnimationController.Instance.loadClientBuiltIns();
}
}
@EventHandler
@@ -213,6 +213,18 @@ public class AnimationController implements IAnimationHandler {
}
}
/**
* Loads built-in animations for client-side usage.
* On dedicated servers, AnimationController.load() never runs on the client JVM,
* so built-in animations would be missing for client-only systems like ability preview.
* This method loads just the built-in animations (from assets and registered addons)
* without touching user animations or world save data.
*/
public void loadClientBuiltIns() {
loadBuiltInAnimations();
loadRegisteredBuiltIns();
}
private File getDir() {
return new File(CustomNpcs.getWorldSaveDirectory(), "animations");
}