public void InitializeAnimator(string cacheDictKey, Vec3f rotation, Shape blockShape, MeshRef meshref)
        {
            if (api.Side != EnumAppSide.Client)
            {
                throw new NotImplementedException("Server side animation system not implemented yet.");
            }

            animator = GetAnimator(api, cacheDictKey, blockShape);

            render = new BEAnimatableRenderer(api as ICoreClientAPI, be.Pos, rotation, animator, activeAnimationsByAnimCode, meshref);
        }
        public void InitializeAnimator(string cacheDictKey, MeshData meshdata, Shape shape, Vec3f rotation)
        {
            if (meshdata == null)
            {
                throw new ArgumentException("meshdata cannot be null");
            }

            ICoreClientAPI capi = api as ICoreClientAPI;

            animator = GetAnimator(api, cacheDictKey, shape);


            if (RuntimeEnv.MainThreadId == System.Threading.Thread.CurrentThread.ManagedThreadId)
            {
                renderer = new BEAnimatableRenderer(api as ICoreClientAPI, be.Pos, rotation, animator, activeAnimationsByAnimCode, capi.Render.UploadMesh(meshdata));
            }
            else
            {
                renderer = new BEAnimatableRenderer(api as ICoreClientAPI, be.Pos, rotation, animator, activeAnimationsByAnimCode, null);
                (api as ICoreClientAPI).Event.EnqueueMainThreadTask(() => {
                    renderer.meshref = capi.Render.UploadMesh(meshdata);
                }, "uploadmesh");
            }
        }