minerender 2.1.0-alpha.61 → 2.1.0-alpha.62

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -902,7 +902,7 @@ declare class DefaultBlockStates implements MinecraftAsset {
902
902
  [k: string]: BlockStatePropertyDefaults;
903
903
  }
904
904
 
905
- /** `entity-models/animations/<namespace>/<model id>.json`: vanilla's keyframe animations of one model. */
905
+ /** `entity-models/animations/<namespace>/<model id>.json`: native and sampled vanilla animation clips. */
906
906
  interface EntityAnimationFile extends MinecraftAsset {
907
907
  id: string;
908
908
  animations: Record<string, EntityAnimation>;
@@ -911,6 +911,8 @@ interface EntityAnimation {
911
911
  /** Seconds. */
912
912
  length: number;
913
913
  loop: boolean;
914
+ /** Geometry layer targeted by this clip; defaults to `main`. */
915
+ layer?: string;
914
916
  /** Part name anywhere in a layer; `root` is the layer's root part. */
915
917
  bones: Record<string, EntityAnimationBone>;
916
918
  }
@@ -948,7 +950,7 @@ declare class Entities {
948
950
  static getPassList(modelKey: BasicAssetKey): Promise<EntityModelPass[]>;
949
951
  static getEntity(modelKey: BasicAssetKey, textureKey?: BasicAssetKey, options?: EntityModelOptions): Promise<Maybe<EntityModel>>;
950
952
  /**
951
- * Vanilla's keyframe animations of a model by name, or undefined when the model or the selected version has none.
953
+ * Native and sampled vanilla clips by name, or undefined when the model or selected version has none.
952
954
  */
953
955
  static getAnimations(modelKey: BasicAssetKey): Promise<Maybe<Record<string, EntityAnimation>>>;
954
956
  static resolveTexture(modelKey: BasicAssetKey): Promise<Maybe<AssetKey>>;
@@ -1210,11 +1212,11 @@ declare class EntityAnimationPlayer {
1210
1212
  get animation(): EntityAnimation | undefined;
1211
1213
  get time(): number;
1212
1214
  /**
1213
- * Starts an animation on the named parts below each layer root. The current pose of a part becomes its default;
1214
- * bones without a matching part are skipped.
1215
+ * Starts an animation on matching named parts. Supplied baked poses are the baseline for offsets;
1216
+ * without them, the current pose is used. Stopping restores the pose from before playback.
1215
1217
  */
1216
- play(layers: Object3D[], animation: EntityAnimation, options?: EntityAnimationOptions): void;
1217
- /** Restores the default poses. Returns whether an animation was active. */
1218
+ play(layers: Object3D[], animation: EntityAnimation, options?: EntityAnimationOptions, poses?: ReadonlyMap<Object3D, EntityModelPart["pose"]>): void;
1219
+ /** Restores the poses from before playback. Returns whether an animation was active. */
1218
1220
  stop(): boolean;
1219
1221
  /** Forgets the animation without touching the parts, for parts that no longer exist. */
1220
1222
  clear(): void;
@@ -1236,7 +1238,8 @@ declare class EntityObject extends SceneObject {
1236
1238
  private scrollTicker;
1237
1239
  /** Entity age in ticks, as vanilla's `ageInTicks`; drives the scrolling render modes. */
1238
1240
  age: number;
1239
- private readonly animationPlayer;
1241
+ private readonly animationPlayers;
1242
+ private readonly partPoses;
1240
1243
  constructor(entity: EntityModel, options?: Partial<EntityObjectOptions>);
1241
1244
  init(): Promise<void>;
1242
1245
  dispose(): void;
@@ -1245,17 +1248,21 @@ declare class EntityObject extends SceneObject {
1245
1248
  private updateScrollSubscription;
1246
1249
  /** Applies the entity age to the scrolling materials; the ticker calls this 20 times per second. */
1247
1250
  private updateScroll;
1248
- /** The animation started by {@link playAnimation}, until {@link stopAnimation} or disposal. */
1251
+ /** The first active clip, until playback is stopped or the object is disposed. */
1249
1252
  get animation(): Maybe<EntityAnimation>;
1253
+ /** Clips playing together, each targeting a separate geometry layer. */
1254
+ get activeAnimations(): readonly EntityAnimation[];
1250
1255
  /** Seconds since the animation started, before looping. */
1251
1256
  get animationTime(): number;
1252
1257
  /**
1253
- * Poses the object from a keyframe animation of {@link Entities.getAnimations}, replacing the current one.
1254
- * Parts of every layer are matched by name and their current pose is the default the offsets add to.
1258
+ * Plays a clip from {@link Entities.getAnimations}, replacing all active clips.
1259
+ * Offsets apply to the baked pose in the clip's layer (`main` by default), including repeated draws of that layer.
1255
1260
  * The object owns no clock: call {@link advanceAnimation} per frame, or {@link setAnimationTime}.
1256
1261
  */
1257
1262
  playAnimation(animation: EntityAnimation, options?: EntityAnimationOptions): void;
1258
- /** Stops the animation and restores the default pose. */
1263
+ /** Plays one clip per selected geometry layer, with a shared clock and no blending between clips. */
1264
+ playAnimations(animations: readonly EntityAnimation[], options?: EntityAnimationOptions): void;
1265
+ /** Stops all clips and restores the poses from before playback. */
1259
1266
  stopAnimation(): void;
1260
1267
  /** Poses the object at an explicit time in seconds. Has no effect without an animation. */
1261
1268
  setAnimationTime(seconds: number): void;
@@ -902,7 +902,7 @@ declare class DefaultBlockStates implements MinecraftAsset {
902
902
  [k: string]: BlockStatePropertyDefaults;
903
903
  }
904
904
 
905
- /** `entity-models/animations/<namespace>/<model id>.json`: vanilla's keyframe animations of one model. */
905
+ /** `entity-models/animations/<namespace>/<model id>.json`: native and sampled vanilla animation clips. */
906
906
  interface EntityAnimationFile extends MinecraftAsset {
907
907
  id: string;
908
908
  animations: Record<string, EntityAnimation>;
@@ -911,6 +911,8 @@ interface EntityAnimation {
911
911
  /** Seconds. */
912
912
  length: number;
913
913
  loop: boolean;
914
+ /** Geometry layer targeted by this clip; defaults to `main`. */
915
+ layer?: string;
914
916
  /** Part name anywhere in a layer; `root` is the layer's root part. */
915
917
  bones: Record<string, EntityAnimationBone>;
916
918
  }
@@ -948,7 +950,7 @@ declare class Entities {
948
950
  static getPassList(modelKey: BasicAssetKey): Promise<EntityModelPass[]>;
949
951
  static getEntity(modelKey: BasicAssetKey, textureKey?: BasicAssetKey, options?: EntityModelOptions): Promise<Maybe<EntityModel>>;
950
952
  /**
951
- * Vanilla's keyframe animations of a model by name, or undefined when the model or the selected version has none.
953
+ * Native and sampled vanilla clips by name, or undefined when the model or selected version has none.
952
954
  */
953
955
  static getAnimations(modelKey: BasicAssetKey): Promise<Maybe<Record<string, EntityAnimation>>>;
954
956
  static resolveTexture(modelKey: BasicAssetKey): Promise<Maybe<AssetKey>>;
@@ -1210,11 +1212,11 @@ declare class EntityAnimationPlayer {
1210
1212
  get animation(): EntityAnimation | undefined;
1211
1213
  get time(): number;
1212
1214
  /**
1213
- * Starts an animation on the named parts below each layer root. The current pose of a part becomes its default;
1214
- * bones without a matching part are skipped.
1215
+ * Starts an animation on matching named parts. Supplied baked poses are the baseline for offsets;
1216
+ * without them, the current pose is used. Stopping restores the pose from before playback.
1215
1217
  */
1216
- play(layers: Object3D[], animation: EntityAnimation, options?: EntityAnimationOptions): void;
1217
- /** Restores the default poses. Returns whether an animation was active. */
1218
+ play(layers: Object3D[], animation: EntityAnimation, options?: EntityAnimationOptions, poses?: ReadonlyMap<Object3D, EntityModelPart["pose"]>): void;
1219
+ /** Restores the poses from before playback. Returns whether an animation was active. */
1218
1220
  stop(): boolean;
1219
1221
  /** Forgets the animation without touching the parts, for parts that no longer exist. */
1220
1222
  clear(): void;
@@ -1236,7 +1238,8 @@ declare class EntityObject extends SceneObject {
1236
1238
  private scrollTicker;
1237
1239
  /** Entity age in ticks, as vanilla's `ageInTicks`; drives the scrolling render modes. */
1238
1240
  age: number;
1239
- private readonly animationPlayer;
1241
+ private readonly animationPlayers;
1242
+ private readonly partPoses;
1240
1243
  constructor(entity: EntityModel, options?: Partial<EntityObjectOptions>);
1241
1244
  init(): Promise<void>;
1242
1245
  dispose(): void;
@@ -1245,17 +1248,21 @@ declare class EntityObject extends SceneObject {
1245
1248
  private updateScrollSubscription;
1246
1249
  /** Applies the entity age to the scrolling materials; the ticker calls this 20 times per second. */
1247
1250
  private updateScroll;
1248
- /** The animation started by {@link playAnimation}, until {@link stopAnimation} or disposal. */
1251
+ /** The first active clip, until playback is stopped or the object is disposed. */
1249
1252
  get animation(): Maybe<EntityAnimation>;
1253
+ /** Clips playing together, each targeting a separate geometry layer. */
1254
+ get activeAnimations(): readonly EntityAnimation[];
1250
1255
  /** Seconds since the animation started, before looping. */
1251
1256
  get animationTime(): number;
1252
1257
  /**
1253
- * Poses the object from a keyframe animation of {@link Entities.getAnimations}, replacing the current one.
1254
- * Parts of every layer are matched by name and their current pose is the default the offsets add to.
1258
+ * Plays a clip from {@link Entities.getAnimations}, replacing all active clips.
1259
+ * Offsets apply to the baked pose in the clip's layer (`main` by default), including repeated draws of that layer.
1255
1260
  * The object owns no clock: call {@link advanceAnimation} per frame, or {@link setAnimationTime}.
1256
1261
  */
1257
1262
  playAnimation(animation: EntityAnimation, options?: EntityAnimationOptions): void;
1258
- /** Stops the animation and restores the default pose. */
1263
+ /** Plays one clip per selected geometry layer, with a shared clock and no blending between clips. */
1264
+ playAnimations(animations: readonly EntityAnimation[], options?: EntityAnimationOptions): void;
1265
+ /** Stops all clips and restores the poses from before playback. */
1259
1266
  stopAnimation(): void;
1260
1267
  /** Poses the object at an explicit time in seconds. Has no effect without an animation. */
1261
1268
  setAnimationTime(seconds: number): void;