minerender 2.1.0-beta.7 → 2.1.0-beta.8
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/README.md +10 -1
- package/dist/browser/esm/armor/Armor.mjs +84 -0
- package/dist/browser/esm/armor/Armor.mjs.map +1 -0
- package/dist/browser/esm/armor/index.mjs +3 -0
- package/dist/browser/esm/armor/index.mjs.map +1 -0
- package/dist/browser/esm/assets/BlockEntities.mjs +2 -0
- package/dist/browser/esm/assets/BlockEntities.mjs.map +1 -1
- package/dist/browser/esm/assets/Entities.mjs +39 -11
- package/dist/browser/esm/assets/Entities.mjs.map +1 -1
- package/dist/browser/esm/assets/MineRenderData.mjs +8 -17
- package/dist/browser/esm/assets/MineRenderData.mjs.map +1 -1
- package/dist/browser/esm/assets/ModelTextures.mjs +13 -7
- package/dist/browser/esm/assets/ModelTextures.mjs.map +1 -1
- package/dist/browser/esm/assets/_versions/DatasetVersions.mjs +22 -0
- package/dist/browser/esm/assets/_versions/DatasetVersions.mjs.map +1 -0
- package/dist/browser/esm/cache/Caching.mjs +8 -0
- package/dist/browser/esm/cache/Caching.mjs.map +1 -1
- package/dist/browser/esm/entity/scene/EntityObject.mjs +31 -5
- package/dist/browser/esm/entity/scene/EntityObject.mjs.map +1 -1
- package/dist/browser/esm/env/browser/BrowserEnv.mjs +11 -4
- package/dist/browser/esm/env/browser/BrowserEnv.mjs.map +1 -1
- package/dist/browser/esm/index.browser.d.mts +129 -13
- package/dist/browser/esm/index.browser.mjs.map +1 -1
- package/dist/browser/esm/index.mjs +1 -0
- package/dist/browser/esm/index.mjs.map +1 -1
- package/dist/browser/esm/model/ItemGlint.mjs +7 -6
- package/dist/browser/esm/model/ItemGlint.mjs.map +1 -1
- package/dist/browser/esm/model/block/scene/BlockObject.mjs +16 -5
- package/dist/browser/esm/model/block/scene/BlockObject.mjs.map +1 -1
- package/dist/browser/esm/scene/SceneDocument.mjs +35 -5
- package/dist/browser/esm/scene/SceneDocument.mjs.map +1 -1
- package/dist/browser/esm/scene/SceneDocumentLoader.mjs +14 -3
- package/dist/browser/esm/scene/SceneDocumentLoader.mjs.map +1 -1
- package/dist/browser/esm/skin/SkinGeometries.mjs +4 -1
- package/dist/browser/esm/skin/SkinGeometries.mjs.map +1 -1
- package/dist/browser/esm/skin/SkinPart.mjs +2 -0
- package/dist/browser/esm/skin/SkinPart.mjs.map +1 -1
- package/dist/browser/esm/skin/SkinTextureCoordinates.mjs +11 -1
- package/dist/browser/esm/skin/SkinTextureCoordinates.mjs.map +1 -1
- package/dist/browser/esm/skin/SkinTextures.mjs +1 -1
- package/dist/browser/esm/skin/SkinTextures.mjs.map +1 -1
- package/dist/browser/esm/skin/scene/SkinObject.mjs +119 -7
- package/dist/browser/esm/skin/scene/SkinObject.mjs.map +1 -1
- package/dist/browser/esm/texture/PalettedTextures.mjs +46 -0
- package/dist/browser/esm/texture/PalettedTextures.mjs.map +1 -0
- package/dist/browser/esm/texture/index.mjs +1 -0
- package/dist/browser/esm/texture/index.mjs.map +1 -1
- package/dist/browser/esm/util/util.mjs +0 -2
- package/dist/browser/esm/util/util.mjs.map +1 -1
- package/dist/browser/esm/world/Chunk.mjs +62 -33
- package/dist/browser/esm/world/Chunk.mjs.map +1 -1
- package/dist/browser/esm/world/MineRenderWorld.mjs +98 -13
- package/dist/browser/esm/world/MineRenderWorld.mjs.map +1 -1
- package/dist/browser/esm/world/SectionMesh.mjs +65 -9
- package/dist/browser/esm/world/SectionMesh.mjs.map +1 -1
- package/dist/browser/esm/world/SectionModels.mjs +21 -15
- package/dist/browser/esm/world/SectionModels.mjs.map +1 -1
- package/dist/browser/esm/world/SectionWorker.mjs +8 -2
- package/dist/browser/esm/world/SectionWorker.mjs.map +1 -1
- package/dist/browser/esm/world/WorldStreamer.mjs +109 -15
- package/dist/browser/esm/world/WorldStreamer.mjs.map +1 -1
- package/dist/browser/index.d.ts +129 -13
- package/dist/browser/index.js +1592 -894
- package/dist/browser/index.js.map +1 -1
- package/dist/bundle.js +1330 -619
- package/dist/bundle.js.map +1 -1
- package/dist/node/index.d.mts +117 -12
- package/dist/node/index.d.ts +117 -12
- package/dist/node/index.js +1505 -793
- package/dist/node/index.js.map +1 -1
- package/dist/node/index.mjs +1303 -593
- package/dist/node/index.mjs.map +1 -1
- package/package.json +2 -1
package/dist/node/index.d.mts
CHANGED
|
@@ -251,6 +251,15 @@ interface EntityLayer {
|
|
|
251
251
|
render?: EntityRenderMode;
|
|
252
252
|
/** Label of the state colour that multiplies the texture, from the pass that selected this draw. */
|
|
253
253
|
tint?: string;
|
|
254
|
+
/** Fixed sRGB colour that multiplies the texture. A tint label with a colour in `EntityObjectOptions.tints` takes precedence. */
|
|
255
|
+
color?: number;
|
|
256
|
+
/** Recolours pixels matching `key` with the colour at the same index in `permutation`, as vanilla's `paletted_permutations` does. */
|
|
257
|
+
palette?: {
|
|
258
|
+
key: AssetKey;
|
|
259
|
+
permutation: AssetKey;
|
|
260
|
+
};
|
|
261
|
+
/** Draws vanilla's armor enchantment glint over this draw. */
|
|
262
|
+
glint?: boolean;
|
|
254
263
|
}
|
|
255
264
|
/** Selected entity data returned by {@link Entities.getEntity} for rendering. */
|
|
256
265
|
interface EntityModel extends EntityLayer {
|
|
@@ -785,7 +794,10 @@ declare function toRadians(degrees: number): number;
|
|
|
785
794
|
declare function toDegrees(radians: number): number;
|
|
786
795
|
/** Resolves after a delay in milliseconds. */
|
|
787
796
|
declare function sleep(timeout: number): Promise<void>;
|
|
788
|
-
/**
|
|
797
|
+
/**
|
|
798
|
+
* Yields to the next macrotask without timer clamping when the platform supports it.
|
|
799
|
+
* Not `scheduler.yield()`: Chrome runs its continuations ahead of rendering, so chained yields delay frames.
|
|
800
|
+
*/
|
|
789
801
|
declare function yieldToEventLoop(): Promise<void>;
|
|
790
802
|
/** Reduces an angle modulo 360, retaining a negative sign for negative inputs. */
|
|
791
803
|
declare function clampRotationDegrees(deg: number): number;
|
|
@@ -915,6 +927,30 @@ declare class MinecraftFaceUV {
|
|
|
915
927
|
*/
|
|
916
928
|
declare function shutdown(): void;
|
|
917
929
|
|
|
930
|
+
type ArmorSlot = "head" | "chest" | "legs" | "feet";
|
|
931
|
+
interface ArmorTrim {
|
|
932
|
+
/** `trim_pattern` registry ID, such as `minecraft:sentry`. */
|
|
933
|
+
pattern: string;
|
|
934
|
+
/** `trim_material` registry ID, such as `minecraft:iron`. */
|
|
935
|
+
material: string;
|
|
936
|
+
}
|
|
937
|
+
/** An equipment asset ID, such as `minecraft:diamond`, or the asset with the worn item's state. */
|
|
938
|
+
type ArmorPiece = string | {
|
|
939
|
+
asset: string;
|
|
940
|
+
/** `dyed_color` as an RGB integer. */
|
|
941
|
+
color?: number;
|
|
942
|
+
trim?: ArmorTrim;
|
|
943
|
+
/** Draws the enchantment glint, as an enchanted item does. */
|
|
944
|
+
glint?: boolean;
|
|
945
|
+
};
|
|
946
|
+
type ArmorSet = Partial<Record<ArmorSlot, ArmorPiece>>;
|
|
947
|
+
/** Resolves humanoid equipment assets into armor draws. */
|
|
948
|
+
declare class Armor {
|
|
949
|
+
/** Loads 1.21.4+ armor in SkinObject's frame, or returns undefined when no layer draws. */
|
|
950
|
+
static getEntity(armor: ArmorSet): Promise<Maybe<EntityModel>>;
|
|
951
|
+
private static identifier;
|
|
952
|
+
}
|
|
953
|
+
|
|
918
954
|
declare const DEFAULT_ROOT = "https://assets.mcasset.cloud/1.21.11";
|
|
919
955
|
declare const DEFAULT_NAMESPACE = "minecraft";
|
|
920
956
|
|
|
@@ -1261,9 +1297,16 @@ declare function sampleEntityAnimation(animation: EntityAnimation, time: number,
|
|
|
1261
1297
|
|
|
1262
1298
|
/** Loads entity and block-entity geometry, texture selections, and animation clips from the dataset. */
|
|
1263
1299
|
declare class Entities {
|
|
1300
|
+
/**
|
|
1301
|
+
* Resolves `root` (default: the active version). Uses the exact dataset when published or when the
|
|
1302
|
+
* version is not a release; otherwise selects the nearest published release, like {@link MineRenderData.resolve}.
|
|
1303
|
+
* Textures keep the requested root.
|
|
1304
|
+
*/
|
|
1305
|
+
static getDatasetRoot(root?: string): Promise<Maybe<string>>;
|
|
1264
1306
|
/** Lists model paths in the `minecraft` namespace, including subdirectories and excluding `.json`. */
|
|
1265
1307
|
static getEntityList(): Promise<string[]>;
|
|
1266
|
-
|
|
1308
|
+
/** @internal */
|
|
1309
|
+
static getModelFile(modelKey: BasicAssetKey): Promise<Maybe<EntityModelFile>>;
|
|
1267
1310
|
/** Returns selectable geometry-layer names, or an empty list when the model is missing. */
|
|
1268
1311
|
static getLayerList(modelKey: BasicAssetKey): Promise<string[]>;
|
|
1269
1312
|
/** The dataset's extra draws on top of `main`; their `when` labels are the states `EntityModelOptions.when` can enable. */
|
|
@@ -1677,6 +1720,7 @@ declare class EntityObject extends SceneObject {
|
|
|
1677
1720
|
age: number;
|
|
1678
1721
|
private readonly animationPlayers;
|
|
1679
1722
|
private readonly partPoses;
|
|
1723
|
+
private glint?;
|
|
1680
1724
|
constructor(entity: EntityModel, options?: Partial<EntityObjectOptions>);
|
|
1681
1725
|
/** An optional shared material replaces texture loading for every selected draw; its owner retains disposal. */
|
|
1682
1726
|
init(material?: Material): Promise<void>;
|
|
@@ -1734,7 +1778,7 @@ interface EntityObjectOptions extends SceneObjectOptions {
|
|
|
1734
1778
|
* By default the model's dataset transform is used, or the flip for models without one.
|
|
1735
1779
|
*/
|
|
1736
1780
|
flip?: boolean;
|
|
1737
|
-
/** Colours for the dataset's tint labels, e.g. `{ wool_color: 0xf9801d }`;
|
|
1781
|
+
/** Colours for the dataset's tint labels, e.g. `{ wool_color: 0xf9801d }`; an absent label uses the draw's fixed colour, if any. */
|
|
1738
1782
|
tints?: Record<string, ColorRepresentation>;
|
|
1739
1783
|
/** Cube faces by layer key; omitted layers draw all six faces. */
|
|
1740
1784
|
faces?: Record<string, CubeFace[]>;
|
|
@@ -1785,6 +1829,7 @@ declare class BlockObject extends SceneObject {
|
|
|
1785
1829
|
*/
|
|
1786
1830
|
private createBlockEntities;
|
|
1787
1831
|
private placeEntities;
|
|
1832
|
+
private placeEntity;
|
|
1788
1833
|
get isOccluding(): boolean;
|
|
1789
1834
|
private getModelMatrix;
|
|
1790
1835
|
private getModelCullMask;
|
|
@@ -1907,7 +1952,9 @@ declare enum SkinPart {
|
|
|
1907
1952
|
LEFT_SLEEVE = "leftSleeve",
|
|
1908
1953
|
RIGHT_TROUSERS = "rightTrousers",
|
|
1909
1954
|
LEFT_TROUSERS = "leftTrousers",
|
|
1910
|
-
CAPE = "cape"
|
|
1955
|
+
CAPE = "cape",
|
|
1956
|
+
LEFT_EAR = "leftEar",
|
|
1957
|
+
RIGHT_EAR = "rightEar"
|
|
1911
1958
|
}
|
|
1912
1959
|
declare const SKIN_PARTS: SkinPart[];
|
|
1913
1960
|
|
|
@@ -1923,6 +1970,9 @@ declare class SkinObject extends SceneObject {
|
|
|
1923
1970
|
private skinMaterial?;
|
|
1924
1971
|
private skinLoad;
|
|
1925
1972
|
private capeLoad;
|
|
1973
|
+
private armorLoad;
|
|
1974
|
+
private armorObjects;
|
|
1975
|
+
private model?;
|
|
1926
1976
|
constructor(options?: DeepPartial<SkinObjectOptions>);
|
|
1927
1977
|
init(): Promise<void>;
|
|
1928
1978
|
protected removeMeshes(): void;
|
|
@@ -1938,9 +1988,20 @@ declare class SkinObject extends SceneObject {
|
|
|
1938
1988
|
setSkinTexture(src: string): Promise<void>;
|
|
1939
1989
|
/** Load a cape texture in the selected layout, or pass undefined to remove the cape. */
|
|
1940
1990
|
setCapeTexture(src?: string, layout?: CapeLayout): Promise<void>;
|
|
1991
|
+
/**
|
|
1992
|
+
* Loads armor from 1.21.4+ equipment assets, or pass undefined to remove it.
|
|
1993
|
+
* Each piece moves with the skin part it covers.
|
|
1994
|
+
*/
|
|
1995
|
+
setArmor(armor?: ArmorSet): Promise<void>;
|
|
1941
1996
|
/** Select the arm model, or pass undefined to use texture detection. */
|
|
1942
1997
|
setSlim(slim?: boolean): void;
|
|
1943
1998
|
private updateSlim;
|
|
1999
|
+
/** Shows or hides deadmau5's ears, which vanilla draws from the skin texture at 24,0 for that player only. */
|
|
2000
|
+
setEars(ears: boolean): void;
|
|
2001
|
+
private updateEars;
|
|
2002
|
+
/** Turns the player upside down, as vanilla does for players named Dinnerbone or Grumm. */
|
|
2003
|
+
setUpsideDown(upsideDown: boolean): void;
|
|
2004
|
+
private updateUpsideDown;
|
|
1944
2005
|
/** Select the texture layout, or pass undefined to detect it from image dimensions. */
|
|
1945
2006
|
setLegacy(legacy?: boolean): Promise<void>;
|
|
1946
2007
|
dispose(): void;
|
|
@@ -1952,6 +2013,10 @@ interface SkinObjectOptions extends SceneObjectOptions {
|
|
|
1952
2013
|
slim?: boolean;
|
|
1953
2014
|
/** Forces the legacy (`true`) or modern (`false`) texture layout. Omit it to detect the layout. */
|
|
1954
2015
|
legacy?: boolean;
|
|
2016
|
+
/** Draws deadmau5's ears from the skin texture. Vanilla shows them only for that player name. */
|
|
2017
|
+
ears?: boolean;
|
|
2018
|
+
/** Turns the player upside down. Vanilla does this for players named Dinnerbone or Grumm. */
|
|
2019
|
+
upsideDown?: boolean;
|
|
1955
2020
|
}
|
|
1956
2021
|
|
|
1957
2022
|
/** Text appearance set on a GUI text layer or overridden by an individual text run. */
|
|
@@ -2224,7 +2289,7 @@ declare class ItemGlint {
|
|
|
2224
2289
|
static create(owner: SceneObject, baseMap?: Texture, root?: string, entityMeshes?: readonly {
|
|
2225
2290
|
mesh: Mesh;
|
|
2226
2291
|
parent?: Mesh;
|
|
2227
|
-
}[]): Promise<ItemGlint>;
|
|
2292
|
+
}[], kind?: "item" | "armor"): Promise<ItemGlint>;
|
|
2228
2293
|
/**
|
|
2229
2294
|
* Maps glint before model centering and display transforms. Ordinary sprites approximate Minecraft's shared atlas density.
|
|
2230
2295
|
* @internal
|
|
@@ -2735,6 +2800,8 @@ interface UnihexFile {
|
|
|
2735
2800
|
|
|
2736
2801
|
/** Shared in-memory caches for loaded assets and render resources. Persistent stores are managed separately. */
|
|
2737
2802
|
declare class Caching {
|
|
2803
|
+
/** Cached in place of a missing asset. The caches drop `undefined` results, which would request the asset again. */
|
|
2804
|
+
static readonly MISSING: false;
|
|
2738
2805
|
private static _generation;
|
|
2739
2806
|
/** Changes when shared assets are cleared, so derived caches can discard their old values. */
|
|
2740
2807
|
static get generation(): number;
|
|
@@ -2747,7 +2814,7 @@ declare class Caching {
|
|
|
2747
2814
|
static readonly materialCache: SimpleCache<CacheKey, Material>;
|
|
2748
2815
|
static readonly boxMeshCache: SimpleCache<CacheKey, Mesh>;
|
|
2749
2816
|
static readonly textureAssetCache: AsyncLoadingCache<CacheKey, TextureAsset>;
|
|
2750
|
-
static readonly textureMetaCache: AsyncLoadingCache<CacheKey, MinecraftTextureMeta>;
|
|
2817
|
+
static readonly textureMetaCache: AsyncLoadingCache<CacheKey, MinecraftTextureMeta | typeof Caching.MISSING>;
|
|
2751
2818
|
static readonly rawModelCache: AsyncLoadingCache<CacheKey, Model>;
|
|
2752
2819
|
static readonly mergedModelCache: AsyncLoadingCache<CacheKey, Model>;
|
|
2753
2820
|
static readonly modelTextureAtlasCache: AsyncLoadingCache<CacheKey, TextureAtlas>;
|
|
@@ -2755,12 +2822,15 @@ declare class Caching {
|
|
|
2755
2822
|
static readonly listAssetCache: AsyncLoadingCache<CacheKey, ListAsset>;
|
|
2756
2823
|
static readonly blockTintCache: AsyncLoadingCache<CacheKey, number>;
|
|
2757
2824
|
static readonly entityModelCache: AsyncLoadingCache<CacheKey, EntityModelFile>;
|
|
2758
|
-
static readonly entityTextureCache: AsyncLoadingCache<CacheKey, AssetKey>;
|
|
2825
|
+
static readonly entityTextureCache: AsyncLoadingCache<CacheKey, AssetKey | typeof Caching.MISSING>;
|
|
2759
2826
|
static readonly entityAnimationCache: AsyncLoadingCache<CacheKey, EntityAnimationFile>;
|
|
2760
2827
|
static readonly blockEntityIndexCache: AsyncLoadingCache<CacheKey, BlockEntityIndex>;
|
|
2828
|
+
static readonly entityDatasetVersionCache: AsyncLoadingCache<CacheKey, string>;
|
|
2761
2829
|
static readonly unihexCache: AsyncLoadingCache<CacheKey, UnihexFile>;
|
|
2762
2830
|
static readonly fontCache: AsyncLoadingCache<CacheKey, BitmapFont>;
|
|
2763
2831
|
static readonly bannerPatternCache: AsyncLoadingCache<CacheKey, BannerPattern>;
|
|
2832
|
+
static readonly equipmentCache: AsyncLoadingCache<CacheKey, unknown>;
|
|
2833
|
+
static readonly trimCache: AsyncLoadingCache<CacheKey, unknown>;
|
|
2764
2834
|
static readonly mineRenderDataCache: AsyncLoadingCache<CacheKey, unknown>;
|
|
2765
2835
|
static readonly usernameUuidCache: AsyncLoadingCache<CacheKey, string>;
|
|
2766
2836
|
static readonly biomeCache: AsyncLoadingCache<CacheKey, Biome>;
|
|
@@ -3444,9 +3514,12 @@ interface SceneSkinDefinition extends SceneObjectDefinitionBase {
|
|
|
3444
3514
|
texture: string;
|
|
3445
3515
|
layout?: CapeLayout;
|
|
3446
3516
|
};
|
|
3517
|
+
armor?: ArmorSet;
|
|
3447
3518
|
options?: {
|
|
3448
3519
|
slim?: boolean;
|
|
3449
3520
|
legacy?: boolean;
|
|
3521
|
+
ears?: boolean;
|
|
3522
|
+
upsideDown?: boolean;
|
|
3450
3523
|
};
|
|
3451
3524
|
/** Mesh names from SkinPart; hiding a base part does not hide its overlay. */
|
|
3452
3525
|
hiddenParts?: string[];
|
|
@@ -3493,8 +3566,17 @@ interface SceneEntityDefinition extends SceneObjectDefinitionBase {
|
|
|
3493
3566
|
wireframe?: boolean;
|
|
3494
3567
|
tints?: Record<string, string | number>;
|
|
3495
3568
|
};
|
|
3496
|
-
|
|
3569
|
+
/** Plays one named clip or blends clips with weights defaulting to 1, without normalization. */
|
|
3570
|
+
animation?: ({
|
|
3497
3571
|
name: string;
|
|
3572
|
+
clips?: never;
|
|
3573
|
+
} | {
|
|
3574
|
+
name?: never;
|
|
3575
|
+
clips: {
|
|
3576
|
+
name: string;
|
|
3577
|
+
weight?: number;
|
|
3578
|
+
}[];
|
|
3579
|
+
}) & {
|
|
3498
3580
|
loop?: boolean;
|
|
3499
3581
|
speed?: number;
|
|
3500
3582
|
time?: number;
|
|
@@ -3642,6 +3724,14 @@ declare class Colormaps {
|
|
|
3642
3724
|
static getColor(kind: "grass" | "foliage" | "dry_foliage", origin?: AssetKey, temperature?: number, downfall?: number): Promise<number>;
|
|
3643
3725
|
}
|
|
3644
3726
|
|
|
3727
|
+
/** Recolours textures using indexed pairs of palette images. */
|
|
3728
|
+
declare class PalettedTextures {
|
|
3729
|
+
/** Loads a texture with a palette permutation, sharing the resulting canvas between callers. */
|
|
3730
|
+
static get(texture: AssetKey, key: AssetKey, permutation: AssetKey): Promise<Maybe<ExtractableImageData>>;
|
|
3731
|
+
/** @internal */
|
|
3732
|
+
static permute(pixels: Uint8ClampedArray, key: Uint8ClampedArray, permutation: Uint8ClampedArray): Uint8ClampedArray;
|
|
3733
|
+
}
|
|
3734
|
+
|
|
3645
3735
|
/** Creates sRGB textures immediately and fills their pixels after asynchronous image loading. */
|
|
3646
3736
|
declare class TextureLoader {
|
|
3647
3737
|
private static readonly failedTextures;
|
|
@@ -4005,6 +4095,8 @@ declare class SectionModels {
|
|
|
4005
4095
|
pick(position?: Readonly<TripleArray>): SectionMeshTemplate[];
|
|
4006
4096
|
biomeTint?: boolean;
|
|
4007
4097
|
} | undefined>;
|
|
4098
|
+
/** Starts loading the state's models and atlases so a later `prepareState` with the same properties finds them loaded. */
|
|
4099
|
+
preload(blockState: BlockState, properties?: BlockStateProperties): Promise<void>;
|
|
4008
4100
|
private state;
|
|
4009
4101
|
/** Returns the shared still/flow atlas used by per-block fluid objects. */
|
|
4010
4102
|
fluidAtlas(kind: FluidKind, root?: string): Promise<TextureAtlas>;
|
|
@@ -4119,6 +4211,7 @@ declare class Chunk<SectionMeshing extends boolean = false> {
|
|
|
4119
4211
|
/** Replaces every cell from parsed section data. The caller refreshes neighbor culling. */
|
|
4120
4212
|
placeSection(data: ChunkData): Promise<void>;
|
|
4121
4213
|
private replaceSection;
|
|
4214
|
+
private createBlockObject;
|
|
4122
4215
|
private positionAt;
|
|
4123
4216
|
/** Refreshes saved lighting after adjacent columns load or unload, including columns with only light data. */
|
|
4124
4217
|
refreshLight(indices?: Iterable<number>): Promise<void>;
|
|
@@ -4268,6 +4361,12 @@ declare class MineRenderWorld<SectionMeshing extends boolean = false> {
|
|
|
4268
4361
|
private placeChunkGroups;
|
|
4269
4362
|
/** Replaces a chunk column's blocks, biomes, and saved light and, with `renderEntities`, its supported saved mobs. */
|
|
4270
4363
|
placeChunk(chunk: AnvilChunk, executor?: BatchedExecutor): Promise<void>;
|
|
4364
|
+
/**
|
|
4365
|
+
* Replaces parsed columns in input order, then refreshes neighboring geometry once.
|
|
4366
|
+
* Duplicate coordinates retain their order. A failed column stops placement; queued refreshes finish before rejection.
|
|
4367
|
+
*/
|
|
4368
|
+
placeChunks(chunks: readonly AnvilChunk[]): Promise<void>;
|
|
4369
|
+
private placeColumn;
|
|
4271
4370
|
/**
|
|
4272
4371
|
* Removes blocks and owned entities at chunk-column coordinates, then refreshes neighboring faces and fluids.
|
|
4273
4372
|
* Coordinates match AnvilChunk.x/z, not block positions. Missing columns are ignored.
|
|
@@ -4300,7 +4399,7 @@ declare class MineRenderWorld<SectionMeshing extends boolean = false> {
|
|
|
4300
4399
|
interface MineRenderWorldOptions<SectionMeshing extends boolean = boolean> {
|
|
4301
4400
|
/** Render supported saved mobs at their position and yaw, including supported appearance fields. Defaults to false. */
|
|
4302
4401
|
renderEntities?: boolean;
|
|
4303
|
-
/** Merge
|
|
4402
|
+
/** Merge block models of any shape and fluid surfaces into per-section meshes; block entities keep individual objects. Merged blocks have no individual object. */
|
|
4304
4403
|
sectionMeshing?: SectionMeshing;
|
|
4305
4404
|
/** Shade blocks and fluids with saved sky/block light. Missing or invalid data keeps preview brightness. Defaults to false. Requires `sectionMeshing`. */
|
|
4306
4405
|
savedLighting?: boolean;
|
|
@@ -4310,7 +4409,7 @@ interface MineRenderWorldOptions<SectionMeshing extends boolean = boolean> {
|
|
|
4310
4409
|
ambientOcclusion?: boolean;
|
|
4311
4410
|
/** Average neighboring biome colors within this horizontal radius, from 0 to 7 blocks. Defaults to 0 (off). Requires `sectionMeshing`. */
|
|
4312
4411
|
biomeBlendRadius?: number;
|
|
4313
|
-
/** Maximum width and height of each section atlas page, in pixels. */
|
|
4412
|
+
/** Maximum width and height of each section atlas page, in pixels. Defaults to 2048. */
|
|
4314
4413
|
maxAtlasSize?: number;
|
|
4315
4414
|
}
|
|
4316
4415
|
|
|
@@ -4355,10 +4454,11 @@ declare class WorldStreamer {
|
|
|
4355
4454
|
private desired;
|
|
4356
4455
|
private center?;
|
|
4357
4456
|
private loading?;
|
|
4457
|
+
private readonly reads;
|
|
4358
4458
|
private running?;
|
|
4359
4459
|
private disposal?;
|
|
4360
4460
|
private disposed;
|
|
4361
|
-
constructor(world: Pick<MineRenderWorld<boolean>, "placeChunk" | "unloadChunkColumns">, source: WorldChunkSource, options?: WorldStreamerOptions);
|
|
4461
|
+
constructor(world: Pick<MineRenderWorld<boolean>, "placeChunk" | "unloadChunkColumns"> & Partial<Pick<MineRenderWorld<boolean>, "placeChunks">>, source: WorldChunkSource, options?: WorldStreamerOptions);
|
|
4362
4462
|
/** Returns absolute coordinates of successfully placed columns, including retained columns. */
|
|
4363
4463
|
get loadedChunks(): readonly {
|
|
4364
4464
|
x: number;
|
|
@@ -4391,6 +4491,10 @@ declare class WorldStreamer {
|
|
|
4391
4491
|
/** Aborts source reads, waits for active work, then unloads owned columns. The world and source remain caller-owned. */
|
|
4392
4492
|
dispose(): Promise<void>;
|
|
4393
4493
|
private drain;
|
|
4494
|
+
private fillReadSlots;
|
|
4495
|
+
/** Places only the ready prefix, so later source reads cannot delay the nearest ready column. */
|
|
4496
|
+
private placeReadyChunks;
|
|
4497
|
+
private placeOwnedColumns;
|
|
4394
4498
|
private needsLoad;
|
|
4395
4499
|
private unloadMany;
|
|
4396
4500
|
private validateChunk;
|
|
@@ -4426,6 +4530,7 @@ declare function registerNodeEnv(): NodeEnv;
|
|
|
4426
4530
|
*/
|
|
4427
4531
|
declare class NodeCache extends PersistentCache<LocalStorage> {
|
|
4428
4532
|
private initialized;
|
|
4533
|
+
private readonly pendingWrites;
|
|
4429
4534
|
constructor(backing: LocalStorage);
|
|
4430
4535
|
private ready;
|
|
4431
4536
|
get<T>(key: string): Promise<T>;
|
|
@@ -4471,4 +4576,4 @@ declare class NodeRenderer extends Renderer {
|
|
|
4471
4576
|
dispose(): void;
|
|
4472
4577
|
}
|
|
4473
4578
|
|
|
4474
|
-
export { AXES, type AnimationFrame, type AnimationMeta, type AnimatorFunction, type AnvilChunk, type AnvilEntityChunk, type AnvilExternalChunkReader, type AnvilParseOptions, AnvilParser, type AnvilRegion, type AnvilRegionReader, AnvilWorldSource, type AnvilWorldSourceOptions, ArchiveAssetSource, type ArchiveAssetSourceOptions, type ArchiveEntry, type ArchiveProxy, AssetKey, AssetLoadError, AssetLoader, AssetParser, AssetSource, type AssetType, Assets, Axis, BUILTIN_ENTITY, BUILTIN_GENERATED, type BannerPattern, type BannerPatternDraw, BannerPatterns, BasicAssetKey, type BasicMinecraftAsset, BatchedExecutor, type BedrockBone, type BedrockCube, type BedrockEntityDescription, type BedrockEntityFile, type BedrockGeometry, type BedrockGeometryFile, type BinaryAsset, type Biome, type BiomeColorKind, Biomes, type BitmapFont, type BitmapGlyph, type Block, BlockEntities, type BlockEntityEntry, type BlockEntityIndex, type BlockEntityPart, type BlockEntityRotation, type BlockFluidState, type BlockInfo, type BlockModel, type BlockModelTextures, BlockObject, type BlockObjectOptions, type BlockState, type BlockStateMultipart, type BlockStateProperties, type BlockStateProperty, type BlockStatePropertyDefaults, type BlockStatePropertyValue, BlockStateResolver, type BlockStateVariant, type BlockStateVariants, BlockStates, BlockTints, type BoxGeometryKey, BrowserArchiveProxy, CUBE_FACES, CUBE_FACE_OFFSETS, type CacheKey, Caching, type CameraOptions, CanvasImage, type CapeLayout, Chunk, ChunkData, Colormaps, type CompatCanvas, type CompatImage, type ComposerOptions, type ControlsMode, type ControlsOptions, CubeFace, CubeFaceIndex, DEFAULT_ELEMENTS, DEFAULT_NAMESPACE, DEFAULT_ROOT, DEFAULT_UV, DISPLAY_POSITIONS, DYE_COLORS, type DebugOptions, type DecoratedPotSide, DecoratedPots, type DeepPartial, DefaultBlockStates, DisplayPosition, DisplayTransforms, type Disposable, type DoubleArray, type DyeColor, ENTITY_ANIMATION_CHANNELS, type ElementFace, type ElementRotation, Entities, type EntityAnimation, type EntityAnimationBone, type EntityAnimationChannel, type EntityAnimationFile, type EntityAnimationKeyframe, type EntityAnimationOptions, EntityAnimationPlayer, type EntityAnimationPose, type EntityLayer, type EntityModel, type EntityModelCube, type EntityModelFile, type EntityModelLayer, type EntityModelOptions, type EntityModelPart, type EntityModelPass, EntityObject, type EntityObjectOptions, type EntityRenderMode, type EntityTransformOp, Env, type EnvProvider, type ExtractableImageData, type FluidKind, FluidModelObject, type FluidQuads, type FluidRules, type FluidSample, type FluidSampler, type FlyAction, FlyControls, type FlyControlsEventMap, Fonts, type FrameCallback, type FromTo, GUI_CONTAINER_LAYOUTS, Geometries, type GuiBookButtonState, type GuiBookOptions, type GuiBossBarColor, type GuiBossBarOptions, type GuiContainerType, GuiHelper, type GuiItemLayer, type GuiLayer, GuiLight, GuiObject, type GuiObjectOptions, type GuiRecipe, type GuiRecipeIngredient, type GuiRecipeOptions, type GuiSpriteScaling, type GuiText, type GuiTextLayer, type GuiTextLayout, type GuiTextOptions, type GuiTextRun, type GuiTextStyle, type GuiTextureLayer, type GuiTooltipOptions, HostedAssetSource, type IModelTextures, ITEM_GENERATED, type ImageInfo, ImageLoader, type ImageSizeInfo, InstanceManager, InstanceReference, type Instanceable, ItemDefaults, ItemGlint, type ItemModel, type ItemModelContext, type ItemModelTextures, type ItemTintColor, type ItemTintSource, ItemTints, type ListAsset, LitematicaParser, type LitematicaRegion, type LitematicaStructure, type LoadedSceneDocument, type LoadedSceneObject, type LogHandler, type LogLevel, type LogThreshold, type Logger, Logging, type LoggingOptions, MapControls, type MaterialKey, Materials, type Maybe, type MeshKey, Meshes, MineRenderData, type MineRenderDataManifest, type MineRenderDatasets, MineRenderError, MineRenderScene, type MineRenderSceneOptions, MineRenderWorld, type MineRenderWorldOptions, type MinecraftAsset, MinecraftCubeTexture, MinecraftFaceUV, type MinecraftTextureMeta, type Model, ModelCulling, type ModelDisplay, type ModelElement, type ModelFaces, ModelGenerator, ModelMerger, ModelObject, type ModelObjectOptions, ModelTextures, Models, type MultiBlockBlock, type MultiBlockEntity, type MultiBlockStructure, type MultipartCondition, type NBTAsset, NBTHelper, NodeCache, NodeEnv, type NodeImageOptions, NodeRenderer, type NodeRendererOptions, OrbitControls, type PackFormat, PackFormats, PackMetadata, PersistentCache, PlayerHeadTextures, type PositionedGuiGlyph, type QuadArray, type RawImageKey, type RenameKind, Renames, type RenderOptions, Renderer, type RendererControls, type RendererFrame, type RendererOptions, type RendererSurface, type RequestConfig, RequestError, type RequestResponse, Requests, type ResolvedBlockEntity, type ResolvedMineRenderData, type ResponseParser, SCENE_DOCUMENT_MAX_BYTES, SKIN_PARTS, type SavedLightSample, type SceneBlockDefinition, type SceneDocument, SceneDocumentLoader, type SceneEntityDefinition, SceneExporter, type SceneGLTFExportOptions, type SceneGuiDefinition, type SceneGuiLayer, SceneInspector, type SceneItemContext, type SceneModelDefinition, SceneObject, type SceneObjectDefinition, type SceneObjectDefinitionBase, type SceneObjectOptions, type SceneSkinDefinition, type SceneSkinPosePart, SceneStats, SceneStatsDisplay, SchematicParser, type SchematicParserOptions, type SectionAtlasSize, type SectionFluidInput, type SectionFluidKind, type SectionFluids, type SectionGeometryInput, type SectionGeometryPage, type SectionLightData, SectionMesh, type SectionMeshEntry, type SectionMeshTemplate, SectionModels, type SectionTemplateData, SectionWorker, type Serializable, type SkinGeometries, SkinImage, SkinObject, type SkinObjectOptions, SkinPart, type SkinTexture, type SkinTextureCoordinates, SkinTextures, Skins, type SpecialItemPart, type SpecialItemRenderer, SpecialItems, SpongeSchematicParser, type StructureNBT, StructureParser, type TextureAsset, TextureAtlas, type TextureKey, TextureLoader, Textures, Ticker, type TickerFunction, TintColors, type Transformable, type TripleArray, UVMapper, type VideoExportOptions, VideoExporter, type WorldBlockIntersection, type WorldChunkSource, type WorldEntityIntersection, WorldStreamer, type WorldStreamerOptions, WrappedImage, addBox3WireframeToObject, addWireframeToMesh, addWireframeToObject, applyElementRotation, applyGenericRotation, axisToVec3, base64decode, base64encode, buildFluidQuads, buildSectionGeometry, capeTextureSizes, captureException, changeEvent, clampRotationDegrees, classicSkinGeometries, classicSkinTextureCoordinates, computeMorphedAttributes, copySectionLight, createCanvas, createFluidGeometry, createGuiTextGeometry, createGuiTextureGeometry, createImage, decodeSceneDocument, encodeSceneDocument, entityAnimationTime, estimateBytesUsed, fluidKindOf, getBlockFluidState, getFluidKind, interleaveAttributes, isAssetKey, isBasicAssetKey, isBlockObject, isDisposable, isDoubleArray, isEntityObject, isFlyControls, isGuiObject, isInstanceManager, isInstanceReference, isInstanceable, isInstancedMesh, isMesh, isMineRenderScene, isModelObject, isObject3D, isOrthographicCamera, isPerspectiveCamera, isQuadArray, isResourceLocation, isSceneObject, isTransformable, isTripleArray, isVector3, layoutGuiText, logger, md5, mergeBufferAttributes, mergeBufferGeometries, mergeVertices, parseSceneDocument, prefix, registerNodeEnv, resolveBlockFluidState, resolveLegacyBlock, resolveLegacyBlockState, sampleEntityAnimation, sampleEntityKeyframes, sampleFluid, sampleSectionLight, sectionGeometryTransferables, serializeBoxGeometryKey, serializeImageKey, serializeMaterialKey, serializeMeshKey, serializeTextureKey, sha1, sha256, sha512, shutdown, sleep, slimSkinGeometries, slimSkinTextureCoordinates, timingEnd, timingStart, toDegrees, toRadians, toTrianglesDrawMode, trimCanvas, validateAnimationWeights, yieldToEventLoop };
|
|
4579
|
+
export { AXES, type AnimationFrame, type AnimationMeta, type AnimatorFunction, type AnvilChunk, type AnvilEntityChunk, type AnvilExternalChunkReader, type AnvilParseOptions, AnvilParser, type AnvilRegion, type AnvilRegionReader, AnvilWorldSource, type AnvilWorldSourceOptions, ArchiveAssetSource, type ArchiveAssetSourceOptions, type ArchiveEntry, type ArchiveProxy, Armor, type ArmorPiece, type ArmorSet, type ArmorSlot, type ArmorTrim, AssetKey, AssetLoadError, AssetLoader, AssetParser, AssetSource, type AssetType, Assets, Axis, BUILTIN_ENTITY, BUILTIN_GENERATED, type BannerPattern, type BannerPatternDraw, BannerPatterns, BasicAssetKey, type BasicMinecraftAsset, BatchedExecutor, type BedrockBone, type BedrockCube, type BedrockEntityDescription, type BedrockEntityFile, type BedrockGeometry, type BedrockGeometryFile, type BinaryAsset, type Biome, type BiomeColorKind, Biomes, type BitmapFont, type BitmapGlyph, type Block, BlockEntities, type BlockEntityEntry, type BlockEntityIndex, type BlockEntityPart, type BlockEntityRotation, type BlockFluidState, type BlockInfo, type BlockModel, type BlockModelTextures, BlockObject, type BlockObjectOptions, type BlockState, type BlockStateMultipart, type BlockStateProperties, type BlockStateProperty, type BlockStatePropertyDefaults, type BlockStatePropertyValue, BlockStateResolver, type BlockStateVariant, type BlockStateVariants, BlockStates, BlockTints, type BoxGeometryKey, BrowserArchiveProxy, CUBE_FACES, CUBE_FACE_OFFSETS, type CacheKey, Caching, type CameraOptions, CanvasImage, type CapeLayout, Chunk, ChunkData, Colormaps, type CompatCanvas, type CompatImage, type ComposerOptions, type ControlsMode, type ControlsOptions, CubeFace, CubeFaceIndex, DEFAULT_ELEMENTS, DEFAULT_NAMESPACE, DEFAULT_ROOT, DEFAULT_UV, DISPLAY_POSITIONS, DYE_COLORS, type DebugOptions, type DecoratedPotSide, DecoratedPots, type DeepPartial, DefaultBlockStates, DisplayPosition, DisplayTransforms, type Disposable, type DoubleArray, type DyeColor, ENTITY_ANIMATION_CHANNELS, type ElementFace, type ElementRotation, Entities, type EntityAnimation, type EntityAnimationBone, type EntityAnimationChannel, type EntityAnimationFile, type EntityAnimationKeyframe, type EntityAnimationOptions, EntityAnimationPlayer, type EntityAnimationPose, type EntityLayer, type EntityModel, type EntityModelCube, type EntityModelFile, type EntityModelLayer, type EntityModelOptions, type EntityModelPart, type EntityModelPass, EntityObject, type EntityObjectOptions, type EntityRenderMode, type EntityTransformOp, Env, type EnvProvider, type ExtractableImageData, type FluidKind, FluidModelObject, type FluidQuads, type FluidRules, type FluidSample, type FluidSampler, type FlyAction, FlyControls, type FlyControlsEventMap, Fonts, type FrameCallback, type FromTo, GUI_CONTAINER_LAYOUTS, Geometries, type GuiBookButtonState, type GuiBookOptions, type GuiBossBarColor, type GuiBossBarOptions, type GuiContainerType, GuiHelper, type GuiItemLayer, type GuiLayer, GuiLight, GuiObject, type GuiObjectOptions, type GuiRecipe, type GuiRecipeIngredient, type GuiRecipeOptions, type GuiSpriteScaling, type GuiText, type GuiTextLayer, type GuiTextLayout, type GuiTextOptions, type GuiTextRun, type GuiTextStyle, type GuiTextureLayer, type GuiTooltipOptions, HostedAssetSource, type IModelTextures, ITEM_GENERATED, type ImageInfo, ImageLoader, type ImageSizeInfo, InstanceManager, InstanceReference, type Instanceable, ItemDefaults, ItemGlint, type ItemModel, type ItemModelContext, type ItemModelTextures, type ItemTintColor, type ItemTintSource, ItemTints, type ListAsset, LitematicaParser, type LitematicaRegion, type LitematicaStructure, type LoadedSceneDocument, type LoadedSceneObject, type LogHandler, type LogLevel, type LogThreshold, type Logger, Logging, type LoggingOptions, MapControls, type MaterialKey, Materials, type Maybe, type MeshKey, Meshes, MineRenderData, type MineRenderDataManifest, type MineRenderDatasets, MineRenderError, MineRenderScene, type MineRenderSceneOptions, MineRenderWorld, type MineRenderWorldOptions, type MinecraftAsset, MinecraftCubeTexture, MinecraftFaceUV, type MinecraftTextureMeta, type Model, ModelCulling, type ModelDisplay, type ModelElement, type ModelFaces, ModelGenerator, ModelMerger, ModelObject, type ModelObjectOptions, ModelTextures, Models, type MultiBlockBlock, type MultiBlockEntity, type MultiBlockStructure, type MultipartCondition, type NBTAsset, NBTHelper, NodeCache, NodeEnv, type NodeImageOptions, NodeRenderer, type NodeRendererOptions, OrbitControls, type PackFormat, PackFormats, PackMetadata, PalettedTextures, PersistentCache, PlayerHeadTextures, type PositionedGuiGlyph, type QuadArray, type RawImageKey, type RenameKind, Renames, type RenderOptions, Renderer, type RendererControls, type RendererFrame, type RendererOptions, type RendererSurface, type RequestConfig, RequestError, type RequestResponse, Requests, type ResolvedBlockEntity, type ResolvedMineRenderData, type ResponseParser, SCENE_DOCUMENT_MAX_BYTES, SKIN_PARTS, type SavedLightSample, type SceneBlockDefinition, type SceneDocument, SceneDocumentLoader, type SceneEntityDefinition, SceneExporter, type SceneGLTFExportOptions, type SceneGuiDefinition, type SceneGuiLayer, SceneInspector, type SceneItemContext, type SceneModelDefinition, SceneObject, type SceneObjectDefinition, type SceneObjectDefinitionBase, type SceneObjectOptions, type SceneSkinDefinition, type SceneSkinPosePart, SceneStats, SceneStatsDisplay, SchematicParser, type SchematicParserOptions, type SectionAtlasSize, type SectionFluidInput, type SectionFluidKind, type SectionFluids, type SectionGeometryInput, type SectionGeometryPage, type SectionLightData, SectionMesh, type SectionMeshEntry, type SectionMeshTemplate, SectionModels, type SectionTemplateData, SectionWorker, type Serializable, type SkinGeometries, SkinImage, SkinObject, type SkinObjectOptions, SkinPart, type SkinTexture, type SkinTextureCoordinates, SkinTextures, Skins, type SpecialItemPart, type SpecialItemRenderer, SpecialItems, SpongeSchematicParser, type StructureNBT, StructureParser, type TextureAsset, TextureAtlas, type TextureKey, TextureLoader, Textures, Ticker, type TickerFunction, TintColors, type Transformable, type TripleArray, UVMapper, type VideoExportOptions, VideoExporter, type WorldBlockIntersection, type WorldChunkSource, type WorldEntityIntersection, WorldStreamer, type WorldStreamerOptions, WrappedImage, addBox3WireframeToObject, addWireframeToMesh, addWireframeToObject, applyElementRotation, applyGenericRotation, axisToVec3, base64decode, base64encode, buildFluidQuads, buildSectionGeometry, capeTextureSizes, captureException, changeEvent, clampRotationDegrees, classicSkinGeometries, classicSkinTextureCoordinates, computeMorphedAttributes, copySectionLight, createCanvas, createFluidGeometry, createGuiTextGeometry, createGuiTextureGeometry, createImage, decodeSceneDocument, encodeSceneDocument, entityAnimationTime, estimateBytesUsed, fluidKindOf, getBlockFluidState, getFluidKind, interleaveAttributes, isAssetKey, isBasicAssetKey, isBlockObject, isDisposable, isDoubleArray, isEntityObject, isFlyControls, isGuiObject, isInstanceManager, isInstanceReference, isInstanceable, isInstancedMesh, isMesh, isMineRenderScene, isModelObject, isObject3D, isOrthographicCamera, isPerspectiveCamera, isQuadArray, isResourceLocation, isSceneObject, isTransformable, isTripleArray, isVector3, layoutGuiText, logger, md5, mergeBufferAttributes, mergeBufferGeometries, mergeVertices, parseSceneDocument, prefix, registerNodeEnv, resolveBlockFluidState, resolveLegacyBlock, resolveLegacyBlockState, sampleEntityAnimation, sampleEntityKeyframes, sampleFluid, sampleSectionLight, sectionGeometryTransferables, serializeBoxGeometryKey, serializeImageKey, serializeMaterialKey, serializeMeshKey, serializeTextureKey, sha1, sha256, sha512, shutdown, sleep, slimSkinGeometries, slimSkinTextureCoordinates, timingEnd, timingStart, toDegrees, toRadians, toTrianglesDrawMode, trimCanvas, validateAnimationWeights, yieldToEventLoop };
|