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