minerender 2.1.0-beta.2 → 2.1.0-beta.4

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.
@@ -1,5 +1,5 @@
1
1
  import * as three from 'three';
2
- import { Vector3, PixelFormat, BoxGeometry, Material, ColorRepresentation, MeshBasicMaterial, Mesh, Euler, Vector2, BufferAttribute, Float32BufferAttribute, BufferGeometry, Object3D, Box3, InstancedMesh, PerspectiveCamera, OrthographicCamera, Matrix4, Box2, Scene, Object3DEventMap, Texture, Camera, MOUSE, TOUCH, WebGLRenderer, EventDispatcher, Raycaster, Intersection, Group, DataTexture, CanvasTexture, InterleavedBufferAttribute, TrianglesDrawModes, Line, Points } from 'three';
2
+ import { Vector3, PixelFormat, BoxGeometry, Material, ColorRepresentation, MeshBasicMaterial, Mesh, Euler, Vector2, BufferAttribute, Float32BufferAttribute, BufferGeometry, Object3D, Box3, InstancedMesh, PerspectiveCamera, OrthographicCamera, Matrix4, Box2, Scene, Object3DEventMap, ShaderMaterial, Texture, Camera, MOUSE, TOUCH, Controls, WebGLRenderer, EventDispatcher, Raycaster, Intersection, Group, DataTexture, CanvasTexture, InterleavedBufferAttribute, TrianglesDrawModes, Line, Points } from 'three';
3
3
  import * as nodeCanvas from 'canvas';
4
4
  import { ImageData as ImageData$1, CanvasRenderingContext2D } from 'canvas';
5
5
  import { Buffer } from 'buffer';
@@ -105,6 +105,8 @@ interface EnvProvider {
105
105
  /** Read width/height out of encoded image bytes without fully decoding them. */
106
106
  imageSize(data: Uint8Array): ImageSizeInfo;
107
107
  openCache(name: string, version: number): PersistentCache;
108
+ /** Optional worker support; returns undefined where unavailable. Only the browser ESM build ships worker files. */
109
+ createWorker?(name: "section"): Worker | undefined;
108
110
  }
109
111
  /**
110
112
  * Registry holding the active {@link EnvProvider}.
@@ -220,6 +222,7 @@ declare class AssetKey extends BasicAssetKey {
220
222
  /** Returns a cache identifier that includes the explicit root or {@link AssetLoader.ROOT}. */
221
223
  serialize(): string;
222
224
  }
225
+ declare function isResourceLocation(value: unknown): value is string;
223
226
  declare function isBasicAssetKey(obj: any): obj is BasicAssetKey;
224
227
  declare function isAssetKey(obj: any): obj is AssetKey;
225
228
 
@@ -452,12 +455,16 @@ declare class Requests {
452
455
  /** Provides pixel and frame access to a canvas-backed image. Simple frame helpers assume a vertical strip of squares. */
453
456
  declare class WrappedImage {
454
457
  readonly dta: ExtractableImageData;
458
+ private alpha?;
455
459
  constructor(dta: ExtractableImageData);
456
460
  get data(): ImageData$1;
457
461
  get dataArray(): Uint8ClampedArray;
458
462
  get width(): number;
459
463
  get height(): number;
460
464
  get hasTransparency(): boolean;
465
+ /** Whether any pixel has partial alpha. Binary alpha renders as cutout, not blended. */
466
+ get hasTranslucency(): boolean;
467
+ private getAlpha;
461
468
  /** Whether the dimensions form a vertical strip of square frames, without consulting `.mcmeta`. */
462
469
  get animated(): boolean;
463
470
  get frameWidth(): number;
@@ -500,7 +507,7 @@ declare class ImageLoader {
500
507
  static getWrapped(src: string): Promise<WrappedImage>;
501
508
  }
502
509
 
503
- /** Vanilla dye colors used by banner and shield textures, as sRGB packed values. */
510
+ /** @deprecated Fixed 1.21.11 palette. Use {@link BannerPatterns.getColors} for the selected version. */
504
511
  declare const DYE_COLORS: Readonly<{
505
512
  readonly white: 16383998;
506
513
  readonly orange: 16351261;
@@ -533,7 +540,9 @@ interface BannerPatternDraw {
533
540
  declare class BannerPatterns {
534
541
  /** Lists namespaced pattern IDs from the selected namespace's data directory. */
535
542
  static getList(namespace?: string, root?: string): Promise<string[]>;
536
- /** Returns the named dye's sRGB value, rejecting unknown colors. */
543
+ /** Loads the selected version's texture dye colors as packed sRGB values. */
544
+ static getColors(root?: string): Promise<Record<DyeColor, number>>;
545
+ /** @deprecated Uses the fixed 1.21.11 palette. Use {@link getColors} for versioned colors. */
537
546
  static getColor(color: unknown): number;
538
547
  /** Resolves the first 16 layers of a `banner_patterns` component, preserving their order. */
539
548
  static getLayers(value: unknown, target: "banner" | "shield", root?: string): Promise<BannerPatternDraw[]>;
@@ -559,11 +568,13 @@ interface BlockModel extends Model {
559
568
  }
560
569
  /** Item preview data, including GUI lighting, tint sources, and supported special renderers. */
561
570
  interface ItemModel extends Model {
571
+ /** Original item ID, retained when resource packs select a different model. */
572
+ itemId?: string;
562
573
  textures?: ItemModelTextures;
563
574
  gui_light?: GuiLight;
564
575
  special?: SpecialItemRenderer;
565
576
  tints?: ItemTintSource[];
566
- /** Stack-component snapshot with namespaced IDs, used by tint sources and special renderers. */
577
+ /** Stack-component snapshot with namespaced IDs, used by tint sources, glint, and special renderers. */
567
578
  components?: Record<string, unknown>;
568
579
  /** Ordered composite children, each with its own textures, display pose, and tint sources. */
569
580
  parts?: ItemModel[];
@@ -593,7 +604,13 @@ type SpecialItemRenderer = {
593
604
  } | {
594
605
  type: "shield" | "minecraft:shield";
595
606
  } | {
596
- type: "trident" | "minecraft:trident" | "conduit" | "minecraft:conduit";
607
+ type: "decorated_pot" | "minecraft:decorated_pot";
608
+ } | {
609
+ type: "trident" | "minecraft:trident" | "conduit" | "minecraft:conduit" | "player_head" | "minecraft:player_head";
610
+ } | {
611
+ type: "copper_golem_statue" | "minecraft:copper_golem_statue";
612
+ texture: string;
613
+ pose: "standing" | "sitting" | "running" | "star";
597
614
  } | {
598
615
  type: "chest" | "minecraft:chest";
599
616
  texture: string;
@@ -657,6 +674,10 @@ declare class MinecraftCubeTexture {
657
674
  /** Texture animation and GUI scaling metadata read from a `.png.mcmeta` file. */
658
675
  interface MinecraftTextureMeta extends MinecraftAsset {
659
676
  animation?: AnimationMeta;
677
+ texture?: {
678
+ blur?: boolean;
679
+ clamp?: boolean;
680
+ };
660
681
  gui?: {
661
682
  scaling?: GuiSpriteScaling;
662
683
  };
@@ -766,6 +787,8 @@ declare function toRadians(degrees: number): number;
766
787
  declare function toDegrees(radians: number): number;
767
788
  /** Resolves after a delay in milliseconds. */
768
789
  declare function sleep(timeout: number): Promise<void>;
790
+ /** Yields to the next macrotask without timer clamping when the platform supports it. */
791
+ declare function yieldToEventLoop(): Promise<void>;
769
792
  /** Reduces an angle modulo 360, retaining a negative sign for negative inputs. */
770
793
  declare function clampRotationDegrees(deg: number): number;
771
794
  declare function isVector3(obj: any): obj is Vector3;
@@ -820,6 +843,7 @@ declare class TextureAtlas implements Disposable {
820
843
  [p: string]: AnimatorFunction;
821
844
  };
822
845
  readonly hasTransparency: boolean;
846
+ readonly hasTranslucency: boolean;
823
847
  ticker?: number;
824
848
  private readonly subscribers;
825
849
  constructor(model: Model, image: CanvasImage, sizes: {
@@ -828,7 +852,7 @@ declare class TextureAtlas implements Disposable {
828
852
  [texture: string]: DoubleArray;
829
853
  }, hasAnimation: boolean, animatorFunctions: {
830
854
  [p: string]: AnimatorFunction;
831
- }, hasTransparency: boolean);
855
+ }, hasTransparency: boolean, hasTranslucency?: boolean);
832
856
  /** Calls subscribers when an animation frame changes; unused atlases do not tick. */
833
857
  subscribe(callback: () => void): () => void;
834
858
  /** Copies pixels for a texture variable from its current atlas rectangle. */
@@ -974,7 +998,7 @@ declare class AssetLoader {
974
998
  /** Selects an mcasset.cloud version, updates the vanilla source, and clears in-memory caches. */
975
999
  static setVersion(version: string): void;
976
1000
  /**
977
- * Scope for persistent cache keys. Empty with only the default vanilla sources, so their
1001
+ * Scope for persistent cache keys. Empty with only the default vanilla source, so its
978
1002
  * entries stay valid across sessions; otherwise it names every added source (resource packs,
979
1003
  * mirrors) so their results never masquerade as vanilla assets after a reload.
980
1004
  */
@@ -1043,6 +1067,24 @@ declare class Assets {
1043
1067
  static getBlockState(key: AssetKey): Promise<Maybe<BlockState>>;
1044
1068
  }
1045
1069
 
1070
+ type BiomeColorKind = "grass" | "foliage" | "dry_foliage" | "water";
1071
+ /** Climate and color fields from a biome registry entry. Other registry fields are ignored. */
1072
+ interface Biome extends MinecraftAsset {
1073
+ temperature: number;
1074
+ downfall: number;
1075
+ effects: Partial<Record<`${BiomeColorKind}_color`, number | string>> & {
1076
+ grass_color_modifier?: "none" | "dark_forest" | "swamp";
1077
+ };
1078
+ }
1079
+ /** Resolves biome colors through the selected version's registry and resource-pack colormaps. */
1080
+ declare class Biomes {
1081
+ /** Loads a biome registry entry, or returns `undefined` when no source provides it. */
1082
+ static get(id: string, origin?: AssetKey): Promise<Biome | undefined>;
1083
+ /** Returns packed sRGB, or `undefined` when the biome or requested water color is missing. */
1084
+ static getColor(id: string, kind: BiomeColorKind, origin?: AssetKey, x?: number, z?: number): Promise<number | undefined>;
1085
+ private static parseColor;
1086
+ }
1087
+
1046
1088
  type BlockStatePropertyValue = string | boolean | number;
1047
1089
  /** A vanilla block property's default and allowed values, loaded through {@link BlockStates.getDefaultState}. */
1048
1090
  interface BlockStateProperty {
@@ -1117,7 +1159,7 @@ declare class BlockStates {
1117
1159
  private static get PERSISTENT_CACHE();
1118
1160
  /** Returns blockstate filenames from the selected version's `_list.json`, or an empty list. */
1119
1161
  static getList(): Promise<string[]>;
1120
- static getDefaultStates(): Promise<Maybe<DefaultBlockStates>>;
1162
+ static getDefaultStates(root?: string): Promise<Maybe<DefaultBlockStates>>;
1121
1163
  /** Looks up vanilla property definitions for the key's block path, or returns `undefined`. */
1122
1164
  static getDefaultState(key: AssetKey): Promise<Maybe<BlockStatePropertyDefaults>>;
1123
1165
  /** Loads a cached blockstate definition for {@link MineRenderScene.addBlock}, or returns `undefined`. */
@@ -1130,6 +1172,13 @@ declare class DefaultBlockStates implements MinecraftAsset {
1130
1172
  [k: string]: BlockStatePropertyDefaults;
1131
1173
  }
1132
1174
 
1175
+ type DecoratedPotSide = "back" | "left" | "right" | "front";
1176
+ /** Resolves Minecraft 1.21.11 pot decorations to the four side textures. */
1177
+ declare class DecoratedPots {
1178
+ /** Reads up to four item IDs in back, left, right, front order; missing and unmapped items use plain sides. */
1179
+ static getSideTextures(value: unknown, root?: string): Record<DecoratedPotSide, AssetKey>;
1180
+ }
1181
+
1133
1182
  /** `entity-models/animations/<namespace>/<model id>.json`: native and sampled vanilla animation clips. */
1134
1183
  interface EntityAnimationFile extends MinecraftAsset {
1135
1184
  id: string;
@@ -1242,29 +1291,109 @@ declare class Fonts {
1242
1291
  private static bitmap;
1243
1292
  }
1244
1293
 
1294
+ interface MineRenderDatasets {
1295
+ itemDefaults: Record<string, Record<string, unknown>>;
1296
+ potionColors: {
1297
+ effects: Record<string, number>;
1298
+ potions: Record<string, {
1299
+ id: string;
1300
+ amplifier: number;
1301
+ }[]>;
1302
+ };
1303
+ blockStates: Record<string, BlockStatePropertyDefaults>;
1304
+ blockTints: Record<string, ({
1305
+ source: "constant";
1306
+ color: number;
1307
+ } | {
1308
+ source: "grass" | "stem" | "redstone";
1309
+ }) & {
1310
+ untinted?: number[];
1311
+ biome?: BiomeColorKind;
1312
+ }>;
1313
+ fluids: Record<string, {
1314
+ kind: "water" | "lava";
1315
+ renderModel: boolean;
1316
+ levelProperty?: string;
1317
+ }>;
1318
+ dyes: Record<string, {
1319
+ id: number;
1320
+ textureDiffuseColor: number;
1321
+ fireworkColor: number;
1322
+ textColor: number;
1323
+ }>;
1324
+ legacyBlocks: {
1325
+ blocks: Record<string, string>;
1326
+ };
1327
+ }
1328
+ interface MineRenderDataManifest {
1329
+ schemaVersion: 1;
1330
+ minecraftVersion: string;
1331
+ dataVersion: number;
1332
+ datasets: Partial<Record<keyof MineRenderDatasets, {
1333
+ file: string;
1334
+ sha256: string;
1335
+ bytes: number;
1336
+ provenance: Record<string, unknown>;
1337
+ }>>;
1338
+ unavailable: Record<string, string>;
1339
+ extractor: {
1340
+ repository: string;
1341
+ revision: string;
1342
+ sha256: string;
1343
+ };
1344
+ }
1345
+ /** The requested asset version and the published data version used for its registries. */
1346
+ interface ResolvedMineRenderData {
1347
+ requestedVersion: string;
1348
+ version: string;
1349
+ /** Registry lookup root. Rootless requests still allow registered sources to override this URL. */
1350
+ root: string;
1351
+ manifest: MineRenderDataManifest;
1352
+ }
1353
+ /** Loads extracted Minecraft registries from the active asset sources and version. */
1354
+ declare class MineRenderData {
1355
+ /** Loads one registry. Missing files and invalid data reject the request. */
1356
+ static get<K extends keyof MineRenderDatasets>(dataset: K, root?: string): Promise<MineRenderDatasets[K]>;
1357
+ /**
1358
+ * Uses the exact version when published. Otherwise, selects the nearest patch in the same
1359
+ * release line (older on ties), then the latest earlier release or the oldest published release.
1360
+ * Unpublished snapshots reject.
1361
+ */
1362
+ static resolve(root?: string): Promise<ResolvedMineRenderData>;
1363
+ private static manifest;
1364
+ private static load;
1365
+ private static cached;
1366
+ private static validDataset;
1367
+ }
1368
+
1245
1369
  /** Caller-supplied item-preview state passed to {@link Models.getMerged}. */
1246
1370
  interface ItemModelContext {
1247
1371
  /** Context used by display-context selectors, overriding `properties`. Defaults to GUI. */
1248
1372
  displayContext?: DisplayPosition | "none";
1249
1373
  /** Explicit property overrides. Nodes with the same ID share one override, regardless of their parameters. */
1250
1374
  properties?: Record<string, boolean | string | number>;
1251
- /** Supplied component JSON by ID. Item-registry defaults are not added; component selectors compare structural JSON values. */
1375
+ /** Supplied component JSON by ID, overriding built-in defaults. Component selectors compare structural JSON values. */
1252
1376
  components?: Record<string, unknown>;
1253
- /** Stack count, as a nonnegative integer. Defaults to 1; absent `max_stack_size` also defaults to 1. */
1377
+ /** Stack count, as a nonnegative integer. Defaults to 1; items without listed defaults stack to 64. */
1254
1378
  count?: number;
1255
1379
  /** Item-model keys by reference-node ID, such as `minecraft:bundle/selected_item`. Unset references draw nothing. */
1256
1380
  itemReferences?: Record<string, AssetKey>;
1257
1381
  }
1258
1382
  /** Loads and caches Java block/item models, including inherited geometry and textures. */
1259
1383
  declare class Models {
1384
+ private static readonly ITEM_CACHE_VERSION;
1260
1385
  private static _persistentCache;
1261
1386
  private static get PERSISTENT_CACHE();
1262
1387
  /** Lists item filenames from the asset source's `_list.json`, with a legacy model-directory fallback. */
1263
1388
  static getItemList(): Promise<string[]>;
1264
1389
  static loadAndMerge(key: AssetKey, context?: ItemModelContext): Promise<Maybe<Model>>;
1265
1390
  private static getItemModel;
1391
+ private static getPreparedItemModel;
1266
1392
  private static contextIdentifier;
1393
+ /** @internal */
1394
+ static componentValue(components: Record<string, unknown>, id: string): unknown;
1267
1395
  private static snapshotContext;
1396
+ private static applyDefaults;
1268
1397
  private static contextKey;
1269
1398
  private static snapshotJson;
1270
1399
  private static propertyValue;
@@ -1274,6 +1403,7 @@ declare class Models {
1274
1403
  /**
1275
1404
  * Loads a model and resolves its parent chain. Returns `undefined` when the model is missing.
1276
1405
  * Item keys default to GUI context and a stack count of 1. Unresolved conditions are false and numeric properties are zero.
1406
+ * Versioned stack-size, durability, and glint defaults apply unless components override them.
1277
1407
  * Pass `context` to supply component values, property overrides, and item references for a preview.
1278
1408
  * Composite items retain independently merged children in `ItemModel.parts`.
1279
1409
  *
@@ -1296,84 +1426,10 @@ declare class DisplayTransforms {
1296
1426
  static apply(geometry: BufferGeometry, matrix: Matrix4): void;
1297
1427
  }
1298
1428
 
1299
- /** Resolves item-preview colors from vanilla tint definitions, stack components, and caller overrides. */
1300
- declare class ItemTints {
1301
- /** Resolves preview colors from item definitions; explicit per-index colors take precedence. */
1302
- static get(model: Model, tints?: Record<number, number>): Promise<Record<number, number> | undefined>;
1303
- private static componentField;
1304
- private static colorOrDefault;
1305
- private static componentColor;
1306
- private static rgb;
1307
- }
1308
-
1309
- /** Identifies fully opaque cubes and maps neighbor visibility to model-local face masks. */
1310
- declare class ModelCulling {
1311
- /** Rotates a world-direction bit mask into model space. Bits follow {@link CUBE_FACES}. */
1312
- static toLocalMask(worldMask: number, rotation: Euler): number;
1313
- /** Whether a model fills one block with opaque faces and can hide adjacent block faces. */
1314
- static isOpaqueFullCube(atlas: Maybe<TextureAtlas>): boolean;
1315
- }
1316
-
1317
- /** Builds extruded item-model elements from sprite pixels, including edges around transparent regions. */
1318
- declare class ModelGenerator {
1319
- static readonly ITEM_LAYERS: string[];
1320
- /**
1321
- * Front and back faces plus one zero-thickness side face per run of texels that border a transparent texel,
1322
- * like vanilla's ItemModelGenerator. Pass the pixels of a single (first) animation frame.
1323
- */
1324
- static generateItemModel(imageData: Pick<ImageData$1, "width" | "height" | "data">, layer: string): ModelElement[];
1325
- }
1326
-
1327
- /** Resolves Java model inheritance, with child elements and display poses overriding their parents. */
1328
- declare class ModelMerger {
1329
- /** Loads the parent chain and returns a merged model without modifying the supplied definition. */
1330
- static mergeWithParents(model: Model): Promise<Model>;
1331
- protected static collectAllParents(model: Model): Promise<Model[]>;
1332
- }
1333
-
1334
- /** Entity geometry and placement for a special item preview. Named part rotations use radians. */
1335
- interface SpecialItemPart {
1336
- model: EntityModel;
1337
- transform: Matrix4;
1338
- rotations: Record<string, TripleArray>;
1339
- /** Absolute named-part positions in the entity model's coordinate system. */
1340
- positions?: Record<string, TripleArray>;
1341
- /** Colors for the entity model's named texture passes. */
1342
- tints?: Record<string, number>;
1343
- }
1344
- /** Loads entity geometry and texture passes for supported special item previews. */
1345
- declare class SpecialItems {
1346
- /** Resolves the static entity parts drawn by a special item renderer, in model units. */
1347
- static getParts(special: SpecialItemRenderer, root?: string, components?: Record<string, unknown>): Promise<SpecialItemPart[]>;
1348
- /** An owned material with model-preview shading; its entity texture remains shared. */
1349
- static createMaterial(source: MeshBasicMaterial, shade: boolean): MeshBasicMaterial;
1350
- }
1351
-
1352
- /** Block data passed to world setters. `type` is a namespaced ID such as `minecraft:oak_log`. */
1353
- interface Block {
1354
- type: string;
1355
- properties?: BlockStateProperties;
1356
- nbt?: any;
1357
- }
1358
-
1359
- /** Selects block models from property values, including multipart conditions and weighted alternatives. */
1360
- declare class BlockStateResolver {
1361
- /** Loads vanilla property defaults, falling back to preview values inferred from the blockstate file. */
1362
- static defaults(blockState: BlockState): Promise<BlockStateProperties>;
1363
- /** Selects matching models. Supply `choose` to control selection within each alternatives array. */
1364
- static select(blockState: BlockState, state: BlockStateProperties, choose?: (variants: BlockStateVariant | BlockStateVariant[]) => BlockStateVariant): BlockStateVariant[];
1365
- /** Returns matching model groups before choosing weighted alternatives. */
1366
- static matching(blockState: BlockState, state: BlockStateProperties): (BlockStateVariant | BlockStateVariant[])[];
1367
- /** Selects a random alternative using positive integer weights, each defaulting to 1. */
1368
- static choose(variants: BlockStateVariant | BlockStateVariant[]): BlockStateVariant;
1369
- /** Converts blockstate rotations in degrees into the Euler rotation used by model rendering. */
1370
- static rotation(variant: BlockStateVariant): Euler;
1371
- }
1372
-
1373
- /** Supplies block-preview tint colors from block properties and the active resource pack. */
1374
- declare class BlockTints {
1375
- /** Resolves block preview colors without biome context; explicit tints take precedence. */
1376
- static get(key: AssetKey | undefined, state: BlockStateProperties, model: Model, tints?: Record<number, number>): Promise<Record<number, number> | undefined>;
1429
+ /** Item components extracted from the selected Minecraft version; unlisted items stack to 64. */
1430
+ declare class ItemDefaults {
1431
+ /** Returns a fresh map with namespaced component IDs; unlisted items get max_stack_size 64. */
1432
+ static get(itemId: string, root?: string): Promise<Record<string, unknown>>;
1377
1433
  }
1378
1434
 
1379
1435
  /** A model that owns reusable instance slots and exposes per-slot transforms to {@link InstanceReference}. */
@@ -1434,6 +1490,246 @@ interface SceneObjectOptions {
1434
1490
  maxInstanceCount: number;
1435
1491
  }
1436
1492
 
1493
+ type FluidKind = "water" | "lava";
1494
+ /** Reads the fluid kind from bits 4 and 5 of a section cell byte. */
1495
+ declare function fluidKindOf(byte: number): FluidKind | undefined;
1496
+ /** A neighboring cell's fluid level and full-cube occlusion state. */
1497
+ interface FluidSample {
1498
+ fluid?: FluidKind;
1499
+ level?: number;
1500
+ solid?: boolean;
1501
+ }
1502
+ /** Reads cells at integer block offsets relative to the fluid being rendered, with `(0, 0, 0)` as the center. */
1503
+ type FluidSampler = (x: number, y: number, z: number) => FluidSample;
1504
+ /** Fluid faces as quads centered on the block, four vertices each, in emission order. */
1505
+ interface FluidQuads {
1506
+ positions: number[];
1507
+ normals: number[];
1508
+ uvs: number[];
1509
+ sprites: number[];
1510
+ }
1511
+ /** Builds centered fluid quads with sprite 0 (still) or 1 (flowing). */
1512
+ declare function buildFluidQuads(kind: FluidKind, sample: FluidSampler): FluidQuads;
1513
+
1514
+ /** Fluid contained in a block and whether the block's ordinary model is also drawn. */
1515
+ interface BlockFluidState {
1516
+ kind: FluidKind;
1517
+ level: number;
1518
+ renderModel: boolean;
1519
+ }
1520
+ type FluidRules = MineRenderDatasets["fluids"];
1521
+ /** Finds water or lava from the block ID and properties, including waterlogged blocks and aquatic plants. */
1522
+ declare function getBlockFluidState(key?: AssetKey, state?: BlockStateProperties): Promise<BlockFluidState | undefined>;
1523
+ /** Resolves fluid state using rules already loaded for the block's asset version. */
1524
+ declare function resolveBlockFluidState(key: AssetKey | undefined, state: BlockStateProperties | undefined, rules: FluidRules): BlockFluidState | undefined;
1525
+ declare function getFluidKind(key?: AssetKey, state?: BlockStateProperties): Promise<FluidKind | undefined>;
1526
+ /** Builds centered fluid faces with material groups 0 (still) and 1 (flowing). */
1527
+ declare function createFluidGeometry(kind: FluidKind, sample: FluidSampler): BufferGeometry;
1528
+
1529
+ /** Playback settings passed to {@link EntityObject.playAnimation}, {@link EntityObject.playAnimations}, or {@link EntityAnimationPlayer.play}. */
1530
+ interface EntityAnimationOptions {
1531
+ /** Overrides the animation's own `loop` flag. */
1532
+ loop?: boolean;
1533
+ /** Playback rate applied to advanced time; defaults to 1. */
1534
+ speed?: number;
1535
+ /** Start time in seconds; defaults to 0. */
1536
+ time?: number;
1537
+ }
1538
+ /**
1539
+ * Poses part groups from a keyframe animation the way vanilla does: every update restores the
1540
+ * default pose of each animated part, then adds the sampled offsets to its position, Euler angles and scale.
1541
+ * It owns no timer; the owner advances it.
1542
+ */
1543
+ declare class EntityAnimationPlayer {
1544
+ private parts;
1545
+ private _animation?;
1546
+ private _time;
1547
+ private loop;
1548
+ private speed;
1549
+ get animation(): EntityAnimation | undefined;
1550
+ get time(): number;
1551
+ /**
1552
+ * Starts an animation on matching named parts. Supplied baked poses are the baseline for offsets;
1553
+ * without them, the current pose is used. Stopping restores the pose from before playback.
1554
+ */
1555
+ play(layers: Object3D[], animation: EntityAnimation, options?: EntityAnimationOptions, poses?: ReadonlyMap<Object3D, EntityModelPart["pose"]>): void;
1556
+ /** Restores the poses from before playback. Returns whether an animation was active. */
1557
+ stop(): boolean;
1558
+ /** Forgets the animation without touching the parts, for parts that no longer exist. */
1559
+ clear(): void;
1560
+ /** Applies the pose at an absolute playback time. Returns `false` when no clip is active. */
1561
+ setTime(seconds: number): boolean;
1562
+ /** Advances playback by elapsed seconds multiplied by the speed passed to {@link play}. */
1563
+ advance(deltaSeconds: number): boolean;
1564
+ private apply;
1565
+ }
1566
+
1567
+ /** Renders selected entity layers as named part groups. Create it through {@link MineRenderScene.addEntity}. */
1568
+ declare class EntityObject extends SceneObject {
1569
+ readonly entity: EntityModel;
1570
+ readonly isEntityObject: true;
1571
+ static readonly DEFAULT_OPTIONS: EntityObjectOptions;
1572
+ readonly options: EntityObjectOptions;
1573
+ private meshesCreated;
1574
+ private readonly geometries;
1575
+ private readonly disposeWireframes;
1576
+ /** Scrolling materials are owned: their texture offset follows this entity's age. */
1577
+ private readonly scrollMaterials;
1578
+ private scrollTicker;
1579
+ /** Entity age in ticks, as vanilla's `ageInTicks`; drives the scrolling render modes. */
1580
+ age: number;
1581
+ private readonly animationPlayers;
1582
+ private readonly partPoses;
1583
+ constructor(entity: EntityModel, options?: Partial<EntityObjectOptions>);
1584
+ /** An optional shared material replaces texture loading for every selected draw; its owner retains disposal. */
1585
+ init(material?: Material): Promise<void>;
1586
+ dispose(): void;
1587
+ disposeAndRemoveAllChildren(): void;
1588
+ private clearScrollMaterials;
1589
+ private updateScrollSubscription;
1590
+ /** Applies the entity age to the scrolling materials; the ticker calls this 20 times per second. */
1591
+ private updateScroll;
1592
+ /** The first active clip, until playback is stopped or the object is disposed. */
1593
+ get animation(): Maybe<EntityAnimation>;
1594
+ /** Clips playing together, each targeting a separate geometry layer. */
1595
+ get activeAnimations(): readonly EntityAnimation[];
1596
+ /** Seconds since the animation started, before looping. */
1597
+ get animationTime(): number;
1598
+ /**
1599
+ * Plays a clip from {@link Entities.getAnimations}, replacing all active clips.
1600
+ * Offsets apply to the baked pose in the clip's layer (`main` by default), including repeated draws of that layer.
1601
+ * The object owns no clock: call {@link advanceAnimation} per frame, or {@link setAnimationTime}.
1602
+ */
1603
+ playAnimation(animation: EntityAnimation, options?: EntityAnimationOptions): void;
1604
+ /** Plays one clip per selected geometry layer, with a shared clock and no blending between clips. */
1605
+ playAnimations(animations: readonly EntityAnimation[], options?: EntityAnimationOptions): void;
1606
+ /** Stops all clips and restores the poses from before playback. */
1607
+ stopAnimation(): void;
1608
+ /** Poses the object at an explicit time in seconds. Has no effect without an animation. */
1609
+ setAnimationTime(seconds: number): void;
1610
+ /** Advances the animation by a frame delta in seconds, scaled by its speed. Has no effect without an animation. */
1611
+ advanceAnimation(deltaSeconds: number): void;
1612
+ /** Finds a selected draw by its layer key, such as `main` or `main#2`, or returns `undefined`. */
1613
+ getLayerGroup(name: string): Maybe<Object3D>;
1614
+ /** Finds a part name without `group:`. Supply `layerName` to restrict the search to one draw. */
1615
+ getGroupByName(name: string, layerName?: string): Maybe<Object3D>;
1616
+ /** Finds a mesh name without `mesh:`. Supply `layerName` to restrict the search to one draw. */
1617
+ getMeshByName(name: string, layerName?: string): Maybe<Mesh>;
1618
+ private get entityLayers();
1619
+ private getTextureKey;
1620
+ protected loadTextures(layer?: EntityLayer): Promise<Maybe<ExtractableImageData>>;
1621
+ protected createMeshes(force?: boolean): void;
1622
+ private createPart;
1623
+ protected applyTextures(): Promise<void>;
1624
+ }
1625
+ /** Render settings passed to `scene.addEntity(entity, options)` or the EntityObject constructor. */
1626
+ interface EntityObjectOptions extends SceneObjectOptions {
1627
+ /**
1628
+ * `true` applies only vanilla's entity flip, scale (-1, -1, 1); `false` keeps raw model space.
1629
+ * By default the model's dataset transform is used, or the flip for models without one.
1630
+ */
1631
+ flip?: boolean;
1632
+ /** Colours for the dataset's tint labels, e.g. `{ wool_color: 0xf9801d }`; a pass whose label is absent stays untinted. */
1633
+ tints?: Record<string, ColorRepresentation>;
1634
+ /** Cube faces by layer key; omitted layers draw all six faces. */
1635
+ faces?: Record<string, CubeFace[]>;
1636
+ }
1637
+ declare function isEntityObject(obj: any): obj is EntityObject;
1638
+
1639
+ /** Controls the model parts selected by a blockstate. Create it through {@link MineRenderScene.addBlock}. */
1640
+ declare class BlockObject extends SceneObject {
1641
+ readonly blockState: BlockState;
1642
+ readonly isBlockObject: true;
1643
+ static readonly DEFAULT_OPTIONS: BlockObjectOptions;
1644
+ readonly options: BlockObjectOptions;
1645
+ private readonly variantPosition?;
1646
+ private _previousState;
1647
+ private _state;
1648
+ private _variant;
1649
+ private _instanceState;
1650
+ private _instanceVariant;
1651
+ private _instanceModel;
1652
+ private _variants;
1653
+ private _models;
1654
+ private _cullMask;
1655
+ private _fluidKey?;
1656
+ private _fluidRules;
1657
+ private _fluidSampler?;
1658
+ private readonly biomePosition?;
1659
+ private waterTint?;
1660
+ private _fluidModel?;
1661
+ private _entities;
1662
+ private _entityPlacement;
1663
+ private _entityGeneration;
1664
+ constructor(blockState: BlockState, options?: Partial<BlockObjectOptions>);
1665
+ init(): Promise<void>;
1666
+ dispose(): void;
1667
+ removeFromScene(): void;
1668
+ private clearModels;
1669
+ private removeModels;
1670
+ private removeEntities;
1671
+ /** Entity models drawn for this block instead of its block model; they are scene children, unlike the block. */
1672
+ get blockEntities(): readonly EntityObject[];
1673
+ /** Sets visibility for this block's model instances and block entities. */
1674
+ setVisible(visible: boolean): void;
1675
+ /**
1676
+ * Draws the block through the dataset's block-entity index. Returns false, leaving nothing behind,
1677
+ * when the block is not listed or one of its models cannot be loaded.
1678
+ */
1679
+ private createBlockEntities;
1680
+ private placeEntities;
1681
+ get isOccluding(): boolean;
1682
+ private getModelMatrix;
1683
+ private getModelCullMask;
1684
+ /** World-space face mask currently applied to this block. */
1685
+ get cullMask(): number;
1686
+ setCullMask(worldMask: number): Promise<void>;
1687
+ /** Selected property values. Use {@link setState} to change properties and rebuild the rendered models. */
1688
+ get state(): {
1689
+ [key: string]: string;
1690
+ };
1691
+ get fluidKind(): FluidKind | undefined;
1692
+ get fluidLevel(): number;
1693
+ /** Refreshes fluid surfaces from relative neighbors; standalone previews use air around the block. */
1694
+ updateFluid(sample?: FluidSampler): Promise<void>;
1695
+ nextInstance(): InstanceReference<SceneObject>;
1696
+ protected mapStateToVariant(state: BlockStateProperties): Promise<BlockStateVariant[]>;
1697
+ recreateModels(): Promise<void>;
1698
+ private hasGeometry;
1699
+ protected getSingleVariant(variants: BlockStateVariant | BlockStateVariant[]): BlockStateVariant;
1700
+ protected createAVariant(variants: BlockStateVariant | BlockStateVariant[], instanceInfo: Matrix4[]): Promise<void>;
1701
+ protected createVariant(variant: BlockStateVariant): Promise<ModelObject | InstanceReference<ModelObject>>;
1702
+ /** Clears selected properties and rebuilds models without reapplying property defaults. */
1703
+ resetState(): Promise<void>;
1704
+ /**
1705
+ * Updates properties and rebuilds the selected models.
1706
+ * Accepts `"facing=north,open=true"`, a property object, or a key and value.
1707
+ * Properties omitted from the call keep their current values.
1708
+ */
1709
+ setState(string: string): any;
1710
+ setState(state: BlockStateProperties): any;
1711
+ setState(key: string, value: string): any;
1712
+ protected _setState(stringOrKeyOrState: string | BlockStateProperties, value?: string): void;
1713
+ setPositionRotationScaleAt(index: number, position?: Vector3, rotation?: Euler, scale?: Vector3): void;
1714
+ getMatrixAt(index: number, matrix?: Matrix4): Matrix4;
1715
+ setMatrixAt(index: number, matrix: Matrix4): void;
1716
+ setPosition(position: Vector3): void;
1717
+ }
1718
+ /** Block settings passed to `scene.addBlock(blockState, options)` or the BlockObject constructor. */
1719
+ interface BlockObjectOptions extends ModelObjectOptions {
1720
+ /** Loads vanilla property defaults before applying `initialState`. Defaults to `true`. */
1721
+ applyDefaultState: boolean;
1722
+ /** Properties applied before model creation, overriding defaults when applyDefaultState is enabled. */
1723
+ initialState?: BlockStateProperties;
1724
+ /** Absolute block coordinates for repeatable variants, copied at construction. Omit for random previews. */
1725
+ variantPosition?: TripleArray;
1726
+ /** Saved biome ID used for automatic grass, foliage, and water colors. */
1727
+ biome?: string;
1728
+ /** World block coordinates used by biome grass modifiers. Copied at construction; defaults to the origin. */
1729
+ biomePosition?: TripleArray;
1730
+ }
1731
+ declare function isBlockObject(obj: any): obj is BlockObject;
1732
+
1437
1733
  /** Builds render geometry from a merged Java model. Create it through {@link MineRenderScene.addModel}. */
1438
1734
  declare class ModelObject extends SceneObject {
1439
1735
  readonly originalModel: Model;
@@ -1446,6 +1742,8 @@ declare class ModelObject extends SceneObject {
1446
1742
  private unsubscribeAtlas?;
1447
1743
  private readonly specialMaterials;
1448
1744
  private readonly geometries;
1745
+ private readonly hasGlint;
1746
+ private glint?;
1449
1747
  blockParent: Maybe<BlockObject>;
1450
1748
  private meshesCreated;
1451
1749
  constructor(originalModel: Model, options?: Partial<ModelObjectOptions>);
@@ -1549,113 +1847,6 @@ interface SkinObjectOptions extends SceneObjectOptions {
1549
1847
  legacy?: boolean;
1550
1848
  }
1551
1849
 
1552
- /** Playback settings passed to {@link EntityObject.playAnimation}, {@link EntityObject.playAnimations}, or {@link EntityAnimationPlayer.play}. */
1553
- interface EntityAnimationOptions {
1554
- /** Overrides the animation's own `loop` flag. */
1555
- loop?: boolean;
1556
- /** Playback rate applied to advanced time; defaults to 1. */
1557
- speed?: number;
1558
- /** Start time in seconds; defaults to 0. */
1559
- time?: number;
1560
- }
1561
- /**
1562
- * Poses part groups from a keyframe animation the way vanilla does: every update restores the
1563
- * default pose of each animated part, then adds the sampled offsets to its position, Euler angles and scale.
1564
- * It owns no timer; the owner advances it.
1565
- */
1566
- declare class EntityAnimationPlayer {
1567
- private parts;
1568
- private _animation?;
1569
- private _time;
1570
- private loop;
1571
- private speed;
1572
- get animation(): EntityAnimation | undefined;
1573
- get time(): number;
1574
- /**
1575
- * Starts an animation on matching named parts. Supplied baked poses are the baseline for offsets;
1576
- * without them, the current pose is used. Stopping restores the pose from before playback.
1577
- */
1578
- play(layers: Object3D[], animation: EntityAnimation, options?: EntityAnimationOptions, poses?: ReadonlyMap<Object3D, EntityModelPart["pose"]>): void;
1579
- /** Restores the poses from before playback. Returns whether an animation was active. */
1580
- stop(): boolean;
1581
- /** Forgets the animation without touching the parts, for parts that no longer exist. */
1582
- clear(): void;
1583
- /** Applies the pose at an absolute playback time. Returns `false` when no clip is active. */
1584
- setTime(seconds: number): boolean;
1585
- /** Advances playback by elapsed seconds multiplied by the speed passed to {@link play}. */
1586
- advance(deltaSeconds: number): boolean;
1587
- private apply;
1588
- }
1589
-
1590
- /** Renders selected entity layers as named part groups. Create it through {@link MineRenderScene.addEntity}. */
1591
- declare class EntityObject extends SceneObject {
1592
- readonly entity: EntityModel;
1593
- readonly isEntityObject: true;
1594
- static readonly DEFAULT_OPTIONS: EntityObjectOptions;
1595
- readonly options: EntityObjectOptions;
1596
- private meshesCreated;
1597
- private readonly geometries;
1598
- private readonly disposeWireframes;
1599
- /** Scrolling materials are owned: their texture offset follows this entity's age. */
1600
- private readonly scrollMaterials;
1601
- private scrollTicker;
1602
- /** Entity age in ticks, as vanilla's `ageInTicks`; drives the scrolling render modes. */
1603
- age: number;
1604
- private readonly animationPlayers;
1605
- private readonly partPoses;
1606
- constructor(entity: EntityModel, options?: Partial<EntityObjectOptions>);
1607
- init(): Promise<void>;
1608
- dispose(): void;
1609
- disposeAndRemoveAllChildren(): void;
1610
- private clearScrollMaterials;
1611
- private updateScrollSubscription;
1612
- /** Applies the entity age to the scrolling materials; the ticker calls this 20 times per second. */
1613
- private updateScroll;
1614
- /** The first active clip, until playback is stopped or the object is disposed. */
1615
- get animation(): Maybe<EntityAnimation>;
1616
- /** Clips playing together, each targeting a separate geometry layer. */
1617
- get activeAnimations(): readonly EntityAnimation[];
1618
- /** Seconds since the animation started, before looping. */
1619
- get animationTime(): number;
1620
- /**
1621
- * Plays a clip from {@link Entities.getAnimations}, replacing all active clips.
1622
- * Offsets apply to the baked pose in the clip's layer (`main` by default), including repeated draws of that layer.
1623
- * The object owns no clock: call {@link advanceAnimation} per frame, or {@link setAnimationTime}.
1624
- */
1625
- playAnimation(animation: EntityAnimation, options?: EntityAnimationOptions): void;
1626
- /** Plays one clip per selected geometry layer, with a shared clock and no blending between clips. */
1627
- playAnimations(animations: readonly EntityAnimation[], options?: EntityAnimationOptions): void;
1628
- /** Stops all clips and restores the poses from before playback. */
1629
- stopAnimation(): void;
1630
- /** Poses the object at an explicit time in seconds. Has no effect without an animation. */
1631
- setAnimationTime(seconds: number): void;
1632
- /** Advances the animation by a frame delta in seconds, scaled by its speed. Has no effect without an animation. */
1633
- advanceAnimation(deltaSeconds: number): void;
1634
- /** Finds a selected draw by its layer key, such as `main` or `main#2`, or returns `undefined`. */
1635
- getLayerGroup(name: string): Maybe<Object3D>;
1636
- /** Finds a part name without `group:`. Supply `layerName` to restrict the search to one draw. */
1637
- getGroupByName(name: string, layerName?: string): Maybe<Object3D>;
1638
- /** Finds a mesh name without `mesh:`. Supply `layerName` to restrict the search to one draw. */
1639
- getMeshByName(name: string, layerName?: string): Maybe<Mesh>;
1640
- private get entityLayers();
1641
- private getTextureKey;
1642
- protected loadTextures(layer?: EntityLayer): Promise<Maybe<ExtractableImageData>>;
1643
- protected createMeshes(force?: boolean): void;
1644
- private createPart;
1645
- protected applyTextures(): Promise<void>;
1646
- }
1647
- /** Render settings passed to `scene.addEntity(entity, options)` or the EntityObject constructor. */
1648
- interface EntityObjectOptions extends SceneObjectOptions {
1649
- /**
1650
- * `true` applies only vanilla's entity flip, scale (-1, -1, 1); `false` keeps raw model space.
1651
- * By default the model's dataset transform is used, or the flip for models without one.
1652
- */
1653
- flip?: boolean;
1654
- /** Colours for the dataset's tint labels, e.g. `{ wool_color: 0xf9801d }`; a pass whose label is absent stays untinted. */
1655
- tints?: Record<string, ColorRepresentation>;
1656
- }
1657
- declare function isEntityObject(obj: any): obj is EntityObject;
1658
-
1659
1850
  /** Text appearance set on a GUI text layer or overridden by an individual text run. */
1660
1851
  interface GuiTextStyle {
1661
1852
  /** sRGB 0xRRGGBB; defaults to white. */
@@ -1723,8 +1914,10 @@ interface GuiTextureLayer extends GuiLayerLayout {
1723
1914
  interface GuiItemLayer extends GuiLayerLayout {
1724
1915
  /** Model key, such as minecraft:item/stone; uses the model's GUI display pose. */
1725
1916
  item: AssetKey | string;
1726
- /** Supplied item state. GUI layers always select models in the GUI display context. */
1917
+ /** Supplied item state, count label, and damage bar. Count zero leaves an empty slot; models always use the GUI display context. */
1727
1918
  context?: Omit<ItemModelContext, "displayContext">;
1919
+ /** Draw count labels and durability bars. Defaults to true. */
1920
+ decorations?: boolean;
1728
1921
  /** sRGB 0xRRGGBB colors by face tint index, overriding the item's automatic preview colors. */
1729
1922
  tints?: Record<number, number>;
1730
1923
  }
@@ -1748,6 +1941,10 @@ declare class GuiObject extends SceneObject {
1748
1941
  private initialized;
1749
1942
  constructor(textureLayers: readonly GuiLayer[], options?: Partial<GuiObjectOptions>);
1750
1943
  init(): Promise<void>;
1944
+ private createText;
1945
+ private textMaterial;
1946
+ private itemOverlay;
1947
+ private createItemOverlay;
1751
1948
  private createItem;
1752
1949
  private loadMaterial;
1753
1950
  disposeAndRemoveAllChildren(): void;
@@ -1901,115 +2098,131 @@ declare class SceneObject extends Object3D<Object3DEventMap & {
1901
2098
  getScale(): Vector3;
1902
2099
  protected toggleObjectVisibility(object?: Object3D, visible?: boolean): boolean;
1903
2100
  dispose(): void;
1904
- /** Releases instance slots and removes children, disposing children that implement Disposable. */
1905
- disposeAndRemoveAllChildren(): void;
1906
- /** Detaches the object from its parent and requests a redraw. */
1907
- removeFromScene(): void;
2101
+ /** Releases instance slots and removes children, disposing children that implement Disposable. */
2102
+ disposeAndRemoveAllChildren(): void;
2103
+ /** Detaches the object from its parent and requests a redraw. */
2104
+ removeFromScene(): void;
2105
+ }
2106
+ declare function isSceneObject(obj: any): obj is SceneObject;
2107
+
2108
+ /** An owned glint material over item geometry; textures and geometry retain their owners. */
2109
+ declare class ItemGlint {
2110
+ private readonly owner;
2111
+ readonly material: ShaderMaterial;
2112
+ private ticker?;
2113
+ private constructor();
2114
+ /** Enables glint for enchantments or a lodestone compass unless a boolean component overrides them. */
2115
+ static enabled(components?: Record<string, unknown>, itemId?: string): boolean;
2116
+ /** @internal */
2117
+ static create(owner: SceneObject, baseMap?: Texture, root?: string, entityMeshes?: readonly {
2118
+ mesh: Mesh;
2119
+ parent?: Mesh;
2120
+ }[]): Promise<ItemGlint>;
2121
+ /**
2122
+ * Maps glint before model centering and display transforms. Ordinary sprites approximate Minecraft's shared atlas density.
2123
+ * @internal
2124
+ */
2125
+ static mapUvs(geometry: BufferGeometry, faces: ModelFaces, atlas: TextureAtlas, itemId?: string, display?: DisplayPosition): void;
2126
+ private updateTime;
2127
+ /** @internal */
2128
+ updateSubscription(active: boolean): void;
2129
+ dispose(): void;
1908
2130
  }
1909
- declare function isSceneObject(obj: any): obj is SceneObject;
1910
2131
 
1911
- type FluidKind = "water" | "lava";
1912
- /** Fluid contained in a block and whether the block's ordinary model is also drawn. */
1913
- interface BlockFluidState {
1914
- kind: FluidKind;
1915
- level: number;
1916
- renderModel: boolean;
2132
+ /** Resolves item-preview colors from vanilla tint definitions, stack components, and caller overrides. */
2133
+ declare class ItemTints {
2134
+ /** Lists potion IDs from the selected version's registry. */
2135
+ static getPotionList(root?: string): Promise<string[]>;
2136
+ /** Resolves preview colors from item definitions; explicit per-index colors take precedence. */
2137
+ static get(model: Model, tints?: Record<number, number>): Promise<Record<number, number> | undefined>;
2138
+ /** Whether a potion component contains a known effect, including effects with hidden particles. */
2139
+ static hasPotionEffects(value: unknown, root?: string): Promise<boolean>;
2140
+ private static potionColor;
2141
+ private static potionContents;
2142
+ private static potionEffects;
2143
+ private static componentField;
2144
+ private static colorOrDefault;
2145
+ private static componentColor;
2146
+ private static rgb;
1917
2147
  }
1918
- /** Finds water or lava from the block ID and properties, including waterlogged blocks and aquatic plants. */
1919
- declare function getBlockFluidState(key?: AssetKey, state?: BlockStateProperties): BlockFluidState | undefined;
1920
- declare function getFluidKind(key?: AssetKey, state?: BlockStateProperties): FluidKind | undefined;
1921
- /** A neighboring cell's fluid level and full-cube occlusion state. */
1922
- interface FluidSample {
1923
- fluid?: FluidKind;
1924
- level?: number;
1925
- solid?: boolean;
2148
+
2149
+ /** Identifies fully opaque cubes and maps neighbor visibility to model-local face masks. */
2150
+ declare class ModelCulling {
2151
+ /** Rotates a world-direction bit mask into model space. Bits follow {@link CUBE_FACES}. */
2152
+ static toLocalMask(worldMask: number, rotation: Euler): number;
2153
+ /** Whether a model fills one block with opaque faces and can hide adjacent block faces. */
2154
+ static isOpaqueFullCube(atlas: Maybe<TextureAtlas>): boolean;
1926
2155
  }
1927
- /** Reads cells at integer block offsets relative to the fluid being rendered, with `(0, 0, 0)` as the center. */
1928
- type FluidSampler = (x: number, y: number, z: number) => FluidSample;
1929
- /** Builds centered fluid faces with material groups 0 (still) and 1 (flowing). */
1930
- declare function createFluidGeometry(kind: FluidKind, sample: FluidSampler): BufferGeometry;
1931
2156
 
1932
- /** Controls the model parts selected by a blockstate. Create it through {@link MineRenderScene.addBlock}. */
1933
- declare class BlockObject extends SceneObject {
1934
- readonly blockState: BlockState;
1935
- readonly isBlockObject: true;
1936
- static readonly DEFAULT_OPTIONS: BlockObjectOptions;
1937
- readonly options: BlockObjectOptions;
1938
- private _previousState;
1939
- private _state;
1940
- private _variant;
1941
- private _instanceState;
1942
- private _instanceVariant;
1943
- private _instanceModel;
1944
- private _variants;
1945
- private _models;
1946
- private _cullMask;
1947
- private _fluidKey?;
1948
- private _fluidSampler?;
1949
- private _fluidModel?;
1950
- private _entities;
1951
- private _entityPlacement;
1952
- private _entityGeneration;
1953
- constructor(blockState: BlockState, options?: Partial<BlockObjectOptions>);
1954
- init(): Promise<void>;
1955
- dispose(): void;
1956
- removeFromScene(): void;
1957
- private clearModels;
1958
- private removeModels;
1959
- private removeEntities;
1960
- /** Entity models drawn for this block instead of its block model; they are scene children, unlike the block. */
1961
- get blockEntities(): readonly EntityObject[];
1962
- /** Sets visibility for this block's model instances and block entities. */
1963
- setVisible(visible: boolean): void;
1964
- /**
1965
- * Draws the block through the dataset's block-entity index. Returns false, leaving nothing behind,
1966
- * when the block is not listed or one of its models cannot be loaded.
1967
- */
1968
- private createBlockEntities;
1969
- private placeEntities;
1970
- get isOccluding(): boolean;
1971
- private getModelMatrix;
1972
- private getModelCullMask;
1973
- setCullMask(worldMask: number): Promise<void>;
1974
- /** Selected property values. Use {@link setState} to change properties and rebuild the rendered models. */
1975
- get state(): {
1976
- [key: string]: string;
1977
- };
1978
- get fluidKind(): FluidKind | undefined;
1979
- get fluidLevel(): number;
1980
- /** Refreshes fluid surfaces from relative neighbors; standalone previews use air around the block. */
1981
- updateFluid(sample?: FluidSampler): Promise<void>;
1982
- nextInstance(): InstanceReference<SceneObject>;
1983
- protected mapStateToVariant(state: BlockStateProperties): Promise<BlockStateVariant[]>;
1984
- recreateModels(): Promise<void>;
1985
- private hasGeometry;
1986
- protected getSingleVariant(variants: BlockStateVariant | BlockStateVariant[]): BlockStateVariant;
1987
- protected createAVariant(variants: BlockStateVariant | BlockStateVariant[], instanceInfo: Matrix4[]): Promise<void>;
1988
- protected createVariant(variant: BlockStateVariant): Promise<ModelObject | InstanceReference<ModelObject>>;
1989
- /** Clears selected properties and rebuilds models without reapplying property defaults. */
1990
- resetState(): Promise<void>;
2157
+ /** Builds extruded item-model elements from sprite pixels, including edges around transparent regions. */
2158
+ declare class ModelGenerator {
2159
+ static readonly ITEM_LAYERS: string[];
1991
2160
  /**
1992
- * Updates properties and rebuilds the selected models.
1993
- * Accepts `"facing=north,open=true"`, a property object, or a key and value.
1994
- * Properties omitted from the call keep their current values.
2161
+ * Front and back faces plus one zero-thickness side face per run of texels that border a transparent texel,
2162
+ * like vanilla's ItemModelGenerator. Pass the pixels of a single (first) animation frame.
1995
2163
  */
1996
- setState(string: string): any;
1997
- setState(state: BlockStateProperties): any;
1998
- setState(key: string, value: string): any;
1999
- protected _setState(stringOrKeyOrState: string | BlockStateProperties, value?: string): void;
2000
- setPositionRotationScaleAt(index: number, position?: Vector3, rotation?: Euler, scale?: Vector3): void;
2001
- getMatrixAt(index: number, matrix?: Matrix4): Matrix4;
2002
- setMatrixAt(index: number, matrix: Matrix4): void;
2003
- setPosition(position: Vector3): void;
2164
+ static generateItemModel(imageData: Pick<ImageData$1, "width" | "height" | "data">, layer: string): ModelElement[];
2004
2165
  }
2005
- /** Block settings passed to `scene.addBlock(blockState, options)` or the BlockObject constructor. */
2006
- interface BlockObjectOptions extends ModelObjectOptions {
2007
- /** Loads vanilla property defaults before applying `initialState`. Defaults to `true`. */
2008
- applyDefaultState: boolean;
2009
- /** Properties applied before model creation, overriding defaults when applyDefaultState is enabled. */
2010
- initialState?: BlockStateProperties;
2166
+
2167
+ /** Resolves Java model inheritance, with child elements and display poses overriding their parents. */
2168
+ declare class ModelMerger {
2169
+ /** Loads the parent chain and returns a merged model without modifying the supplied definition. */
2170
+ static mergeWithParents(model: Model): Promise<Model>;
2171
+ protected static collectAllParents(model: Model): Promise<Model[]>;
2172
+ }
2173
+
2174
+ /** Entity geometry and placement for a special item preview. Named part rotations use radians. */
2175
+ interface SpecialItemPart {
2176
+ model: EntityModel;
2177
+ transform: Matrix4;
2178
+ rotations: Record<string, TripleArray>;
2179
+ /** Absolute named-part positions in the entity model's coordinate system. */
2180
+ positions?: Record<string, TripleArray>;
2181
+ /** Colors for the entity model's named texture passes. */
2182
+ tints?: Record<string, number>;
2183
+ faces?: Record<string, CubeFace[]>;
2184
+ /** Shared prepared material; the renderer clones it and retains ownership of only that clone. */
2185
+ material?: MeshBasicMaterial;
2186
+ }
2187
+ /** Loads entity geometry and texture passes for supported special item previews. */
2188
+ declare class SpecialItems {
2189
+ /** Resolves the static entity parts drawn by a special item renderer, in model units. */
2190
+ static getParts(special: SpecialItemRenderer, root?: string, components?: Record<string, unknown>): Promise<SpecialItemPart[]>;
2191
+ /** An owned material with model-preview shading; its entity texture remains shared. */
2192
+ static createMaterial(source: MeshBasicMaterial, shade: boolean): MeshBasicMaterial;
2193
+ }
2194
+
2195
+ /** Block data passed to world setters. `type` is a namespaced ID such as `minecraft:oak_log`. */
2196
+ interface Block {
2197
+ type: string;
2198
+ properties?: BlockStateProperties;
2199
+ nbt?: any;
2200
+ }
2201
+
2202
+ /** Selects block models from property values, including multipart conditions and weighted alternatives. */
2203
+ declare class BlockStateResolver {
2204
+ /** Loads vanilla property defaults, falling back to preview values inferred from the blockstate file. */
2205
+ static defaults(blockState: BlockState): Promise<BlockStateProperties>;
2206
+ /** Selects matching models. Supply `choose` to control selection within each alternatives array. */
2207
+ static select(blockState: BlockState, state: BlockStateProperties, choose?: (variants: BlockStateVariant | BlockStateVariant[]) => BlockStateVariant): BlockStateVariant[];
2208
+ /** Returns matching model groups before choosing weighted alternatives. */
2209
+ static matching(blockState: BlockState, state: BlockStateProperties): (BlockStateVariant | BlockStateVariant[])[];
2210
+ /** Selects by positive integer weights (default 1); world block coordinates make the choice repeatable. */
2211
+ static choose(variants: BlockStateVariant | BlockStateVariant[], position?: Readonly<TripleArray>): BlockStateVariant;
2212
+ private static positionSample;
2213
+ /** Converts blockstate rotations in degrees into the Euler rotation used by model rendering. */
2214
+ static rotation(variant: BlockStateVariant): Euler;
2215
+ }
2216
+
2217
+ /** Supplies block tint colors from versioned rendering rules and the active resource pack. */
2218
+ declare class BlockTints {
2219
+ /** Returns a block's versioned biome color source, leaving fixed-color blocks unchanged. */
2220
+ static biomeSource(key?: AssetKey): Promise<BiomeColorKind | undefined>;
2221
+ /** Resolves one block's biome tint at world block coordinates, without biome blending. */
2222
+ static getBiomeColor(key?: AssetKey, biome?: string, position?: Readonly<TripleArray>): Promise<number | undefined>;
2223
+ /** Resolves used tint indices from biome or preview colors; explicit tints take precedence. */
2224
+ static get(key: AssetKey | undefined, state: BlockStateProperties, model: Model, tints?: Record<number, number>, biomeColor?: number | (() => Promise<number | undefined>)): Promise<Record<number, number> | undefined>;
2011
2225
  }
2012
- declare function isBlockObject(obj: any): obj is BlockObject;
2013
2226
 
2014
2227
  /** Saved fluid levels and solid neighbors determine the geometry shared by an instance pool. */
2015
2228
  declare function sampleFluid(kind: FluidKind, sample: FluidSampler): {
@@ -2027,6 +2240,11 @@ declare class FluidModelObject extends ModelObject {
2027
2240
  disposeAndRemoveAllChildren(): void;
2028
2241
  }
2029
2242
 
2243
+ /** Resolves a numeric block using mappings for the selected asset version, with caller overrides. */
2244
+ declare function resolveLegacyBlock(id: number, metadata: number, customMappings?: Readonly<Record<string, string>>, lenient?: boolean, root?: string): Promise<Block | undefined>;
2245
+ /** Resolves a numeric block using a previously loaded mapping table. */
2246
+ declare function resolveLegacyBlockState(id: number, metadata: number, mapping: Readonly<Record<string, string>>, customMappings?: Readonly<Record<string, string>>, lenient?: boolean): Block | undefined;
2247
+
2030
2248
  /** Parsed blocks and entity data for {@link MineRenderWorld.placeMultiBlock}. Dimensions and positions use blocks. */
2031
2249
  interface MultiBlockStructure {
2032
2250
  readonly size: TripleArray;
@@ -2034,7 +2252,7 @@ interface MultiBlockStructure {
2034
2252
  readonly dataVersion?: number;
2035
2253
  readonly entities?: MultiBlockEntity[];
2036
2254
  }
2037
- /** Preserved entity position and NBT. World placement does not create a render object for it. */
2255
+ /** Preserved entity position and NBT. `MineRenderWorld` can render supported mobs with `renderEntities`. */
2038
2256
  interface MultiBlockEntity {
2039
2257
  position: TripleArray;
2040
2258
  blockPosition?: TripleArray;
@@ -2045,15 +2263,40 @@ interface MultiBlockBlock extends Block {
2045
2263
  position: TripleArray;
2046
2264
  }
2047
2265
 
2266
+ /** A named region with block and entity positions relative to the schematic origin. */
2267
+ interface LitematicaRegion extends MultiBlockStructure {
2268
+ readonly name: string;
2269
+ /** The selected first corner, relative to the schematic origin. */
2270
+ readonly position: TripleArray;
2271
+ /** Signed source dimensions. The inherited size contains their absolute values. */
2272
+ readonly signedSize: TripleArray;
2273
+ }
2274
+ /** Combined blocks and the named regions that produced them. */
2275
+ interface LitematicaStructure extends MultiBlockStructure {
2276
+ readonly regions: LitematicaRegion[];
2277
+ }
2278
+ /** Reads v5–7 `.litematic` files without migrating block states or entity NBT. */
2279
+ declare class LitematicaParser {
2280
+ /**
2281
+ * Parses decoded NBT, preserving subregion placement and omitting air.
2282
+ * Later entries in regions replace earlier cells, including with air.
2283
+ * Size encloses all region bounds; positions retain the schematic origin.
2284
+ * Metadata and scheduled ticks are not imported. Named regions can be placed individually.
2285
+ */
2286
+ static parse(nbt: NBT): Promise<LitematicaStructure>;
2287
+ }
2288
+
2048
2289
  /** Converts legacy Alpha `.schematic` NBT with numeric block IDs into modern block names and properties. */
2049
2290
  declare class SchematicParser {
2050
2291
  /**
2051
- * Parses a legacy schematic using custom mappings before the bundled defaults.
2292
+ * Parses a legacy schematic using custom mappings before the selected version's defaults.
2052
2293
  * Keys are `id:metadata`; values are block states such as `minecraft:oak_log[axis=x]`.
2053
2294
  */
2054
2295
  static parse(nbt: NBT, customMappings?: Readonly<Record<string, string>>, options?: SchematicParserOptions): Promise<MultiBlockStructure>;
2055
2296
  }
2056
2297
  interface SchematicParserOptions {
2298
+ /** Asset root used to select the legacy mapping version. Omit to use the active asset sources. */
2299
+ root?: string;
2057
2300
  /**
2058
2301
  * Ignores Materials, tries metadata 0 for unmapped states, and skips unknown IDs. Defaults to false.
2059
2302
  * Dimensions, arrays, and entity data remain validated.
@@ -2061,6 +2304,16 @@ interface SchematicParserOptions {
2061
2304
  lenient?: boolean;
2062
2305
  }
2063
2306
 
2307
+ /** Converts Sponge v2/v3 `.schem` NBT into blocks and preserved entity data. */
2308
+ declare class SpongeSchematicParser {
2309
+ /**
2310
+ * Parses decoded NBT with a local block palette, omitting air blocks.
2311
+ * Applies Offset to block and entity positions; size remains the source dimensions.
2312
+ * Biomes and metadata are not imported, and DataVersion does not trigger migration.
2313
+ */
2314
+ static parse(nbt: NBT): Promise<MultiBlockStructure>;
2315
+ }
2316
+
2064
2317
  /** Converts Java structure NBT into blocks and preserved entity data for world placement. */
2065
2318
  declare class StructureParser {
2066
2319
  /**
@@ -2369,7 +2622,6 @@ declare class Caching {
2369
2622
  static readonly modelTextureAtlasCache: AsyncLoadingCache<CacheKey, TextureAtlas>;
2370
2623
  static readonly blockStateCache: AsyncLoadingCache<CacheKey, BlockState>;
2371
2624
  static readonly listAssetCache: AsyncLoadingCache<CacheKey, ListAsset>;
2372
- static readonly defaultBlockStatesCache: AsyncLoadingCache<CacheKey, DefaultBlockStates>;
2373
2625
  static readonly blockTintCache: AsyncLoadingCache<CacheKey, number>;
2374
2626
  static readonly entityModelCache: AsyncLoadingCache<CacheKey, EntityModelFile>;
2375
2627
  static readonly entityTextureCache: AsyncLoadingCache<CacheKey, AssetKey>;
@@ -2377,6 +2629,9 @@ declare class Caching {
2377
2629
  static readonly blockEntityIndexCache: AsyncLoadingCache<CacheKey, BlockEntityIndex>;
2378
2630
  static readonly fontCache: AsyncLoadingCache<CacheKey, BitmapFont>;
2379
2631
  static readonly bannerPatternCache: AsyncLoadingCache<CacheKey, BannerPattern>;
2632
+ static readonly mineRenderDataCache: AsyncLoadingCache<CacheKey, unknown>;
2633
+ static readonly usernameUuidCache: AsyncLoadingCache<CacheKey, string>;
2634
+ static readonly biomeCache: AsyncLoadingCache<CacheKey, Biome>;
2380
2635
  private static createAssetCache;
2381
2636
  /** Every cache above, so clear()/end() can never fall out of sync with the field list again. */
2382
2637
  private static get all();
@@ -2408,7 +2663,7 @@ interface SceneGLTFExportOptions {
2408
2663
  /** Maximum width and height of each exported texture, in pixels. */
2409
2664
  maxTextureSize?: number;
2410
2665
  }
2411
- /** Exports the visible meshes at their current poses without changing the source scene. */
2666
+ /** Exports visible geometry at its current pose without changing the source scene. Animated item glint is omitted. */
2412
2667
  declare class SceneExporter {
2413
2668
  /** Returns OBJ geometry with normals and UVs; material files and textures are not included. */
2414
2669
  static toObj(root: Object3D): string;
@@ -2421,6 +2676,53 @@ declare class SceneExporter {
2421
2676
  static toGLTF(root: Object3D, options?: SceneGLTFExportOptions): Promise<Record<string, any> | ArrayBuffer>;
2422
2677
  }
2423
2678
 
2679
+ /** Settings passed to {@link Renderer.toVideo}. */
2680
+ interface VideoExportOptions {
2681
+ /** Recording duration in seconds, greater than zero and at most 2147483.647. */
2682
+ duration: number;
2683
+ /** Requested capture rate (default 30). Rendering and browser scheduling can lower the actual rate. */
2684
+ fps?: number;
2685
+ /** Supported video MIME type. Defaults to WebM when available, then MP4. */
2686
+ mimeType?: string;
2687
+ /** Target video bitrate in bits per second, as a positive unsigned 32-bit integer. */
2688
+ videoBitsPerSecond?: number;
2689
+ /** Cancels recording and discards its output. */
2690
+ signal?: AbortSignal;
2691
+ }
2692
+ /**
2693
+ * Records fresh canvas frames in a browser, at a fixed size with an opaque black background.
2694
+ * @internal
2695
+ */
2696
+ declare class VideoExporter {
2697
+ private readonly source;
2698
+ /** Resolves after the recorder provides its final video data. */
2699
+ readonly result: Promise<Blob>;
2700
+ private readonly canvas;
2701
+ private readonly context;
2702
+ private readonly signal?;
2703
+ private readonly duration;
2704
+ private stream?;
2705
+ private recorder?;
2706
+ private timer?;
2707
+ private readonly chunks;
2708
+ private settled;
2709
+ private stopping;
2710
+ private resolve;
2711
+ private reject;
2712
+ constructor(source: HTMLCanvasElement, options: VideoExportOptions);
2713
+ /** Copies a freshly drawn source frame before WebGL can clear its drawing buffer. */
2714
+ capture(): void;
2715
+ /** Cancels recording, releases its capture stream, and rejects {@link result}. */
2716
+ cancel(reason?: unknown): void;
2717
+ private readonly onStart;
2718
+ private readonly onData;
2719
+ private readonly onStop;
2720
+ private readonly onError;
2721
+ private readonly onAbort;
2722
+ private readonly onTrackEnded;
2723
+ private cleanup;
2724
+ }
2725
+
2424
2726
  /** Container coordinates in GUI pixels. Crops refer to vanilla's 256×256 sheets; {@link GuiHelper.container} scales them for resource packs. */
2425
2727
  declare const GUI_CONTAINER_LAYOUTS: {
2426
2728
  readonly generic_54: {
@@ -2470,7 +2772,7 @@ declare class GuiHelper {
2470
2772
  * @param rowSize - Slots per row when `slot` is an index.
2471
2773
  */
2472
2774
  static inventorySlot(slot: number | readonly [number, number], origin?: readonly [number, number], offset?: readonly [number, number], rowSize?: number): [number, number];
2473
- /** Creates crafting-table layers for ingredients and the result; stack counts are not drawn. */
2775
+ /** Creates crafting-table layers for ingredients and the result, including its stack count. */
2474
2776
  static recipe(recipe: GuiRecipe, options?: GuiRecipeOptions): GuiLayer[];
2475
2777
  }
2476
2778
  /** Settings passed to {@link GuiHelper.bossBar}. */
@@ -2608,20 +2910,139 @@ declare class MapControls extends OrbitControls {
2608
2910
  constructor(object: Camera, domElement?: HTMLElement);
2609
2911
  }
2610
2912
 
2913
+ /** Events dispatched by {@link FlyControls}. */
2914
+ interface FlyControlsEventMap {
2915
+ /** The camera moved or turned. */
2916
+ change: {};
2917
+ /** Mouse look captured the pointer. */
2918
+ lock: {};
2919
+ /** Mouse look released the pointer. */
2920
+ unlock: {};
2921
+ }
2922
+ /** Movement actions that {@link FlyControls.keys} binds to `KeyboardEvent.code` values. */
2923
+ type FlyAction = "forward" | "back" | "left" | "right" | "up" | "down" | "sprint";
2924
+ /**
2925
+ * Creative-flight camera controls: WASD moves horizontally along the view direction, space and shift
2926
+ * move up and down, R sprints, and the mouse turns the camera (pointer lock, or drag).
2927
+ *
2928
+ * Call {@link FlyControls.update} with the elapsed seconds once per frame; the `change` event marks the
2929
+ * renderer dirty while keys are held. Speeds use scene units (16 per block). The element becomes focusable
2930
+ * and keys apply while it has focus or the pointer is locked. A key pressed with Control, Alt, or Command
2931
+ * stays a browser shortcut unless that modifier is bound. The wheel changes the speed, as in vanilla
2932
+ * spectator mode. Touch input uses the left half of the element as a joystick and the right half for looking.
2933
+ */
2934
+ declare class FlyControls extends Controls<FlyControlsEventMap, Camera> {
2935
+ readonly isFlyControls: true;
2936
+ /** Horizontal and vertical speed in scene units per second; vanilla creative flight by default. */
2937
+ movementSpeed: number;
2938
+ /** Speed multiplier while the sprint key is held. */
2939
+ sprintMultiplier: number;
2940
+ /** Radians per pixel of pointer movement. */
2941
+ lookSpeed: number;
2942
+ /** Smooth acceleration and deceleration, approximating vanilla flight momentum. */
2943
+ enableDamping: boolean;
2944
+ /** Portion of the remaining velocity change applied per 60 Hz frame (0–1) when damping is enabled. */
2945
+ dampingFactor: number;
2946
+ /** Capture the pointer on click so the mouse turns the camera without dragging; dragging works regardless. */
2947
+ pointerLock: boolean;
2948
+ /** Scroll the wheel to change `movementSpeed` within `speedRange`. */
2949
+ enableWheelSpeed: boolean;
2950
+ /** Minimum and maximum `movementSpeed` reachable with the wheel. */
2951
+ speedRange: [number, number];
2952
+ /** Touch joystick travel in CSS pixels for full speed. */
2953
+ joystickRadius: number;
2954
+ /** Key bindings by `KeyboardEvent.code`. */
2955
+ keys: Record<FlyAction, string[]>;
2956
+ private readonly _pressed;
2957
+ private readonly _velocity;
2958
+ private readonly _lastPosition;
2959
+ private readonly _lastQuaternion;
2960
+ private _position0;
2961
+ private _quaternion0;
2962
+ private _dragPointer?;
2963
+ private _dragX;
2964
+ private _dragY;
2965
+ private _dragMoved;
2966
+ private _dragTravel;
2967
+ private _joystick?;
2968
+ private _locked;
2969
+ private _madeFocusable;
2970
+ private _lastTime?;
2971
+ private readonly _onKeyDown;
2972
+ private readonly _onKeyUp;
2973
+ private readonly _onPointerDown;
2974
+ private readonly _onPointerMove;
2975
+ private readonly _onPointerUp;
2976
+ private readonly _onPointerLockChange;
2977
+ private readonly _onContextMenu;
2978
+ private readonly _onWheel;
2979
+ private readonly _onBlur;
2980
+ constructor(camera: Camera, domElement?: HTMLElement | null);
2981
+ connect(element: HTMLElement): void;
2982
+ disconnect(): void;
2983
+ dispose(): void;
2984
+ /** Whether mouse look currently owns the pointer. */
2985
+ get locked(): boolean;
2986
+ /** Requests pointer capture; browsers only allow this from a user gesture. */
2987
+ lock(): void;
2988
+ /** Releases a captured pointer. */
2989
+ unlock(): void;
2990
+ /** Stores the camera pose that {@link reset} restores. */
2991
+ saveState(): void;
2992
+ /** Restores the saved camera pose and stops movement. */
2993
+ reset(): void;
2994
+ /** Horizontal yaw in radians, where zero looks toward -Z. */
2995
+ get yaw(): number;
2996
+ /** Vertical pitch in radians, positive looking up. */
2997
+ get pitch(): number;
2998
+ /** Turns the camera; pitch is clamped to straight up and down. */
2999
+ setRotation(yaw: number, pitch: number): void;
3000
+ /** Points the camera at a position without rolling it. */
3001
+ lookAt(target: Vector3): void;
3002
+ /** Whether an action's key is held. */
3003
+ isPressed(action: FlyAction): boolean;
3004
+ /**
3005
+ * Advances movement by `delta` seconds (measured since the previous call when omitted)
3006
+ * and dispatches `change` when the camera moved.
3007
+ * A step longer than 0.1 s is applied as 0.1 s.
3008
+ */
3009
+ update(delta?: number): void;
3010
+ private move;
3011
+ private notifyChange;
3012
+ private releaseKeys;
3013
+ private handleKey;
3014
+ /** A key pressed with Control, Alt, or Command stays a browser shortcut unless that modifier is bound to an action. */
3015
+ private isBrowserShortcut;
3016
+ private actionFor;
3017
+ private handlePointerDown;
3018
+ private onJoystickSide;
3019
+ private handlePointerMove;
3020
+ private handlePointerUp;
3021
+ private handleWheel;
3022
+ private handlePointerLockChange;
3023
+ private turn;
3024
+ }
3025
+ declare function isFlyControls(obj: any): obj is FlyControls;
3026
+
2611
3027
  /**
2612
3028
  * Renders a Minecraft scene with a camera and an optional effects composer.
2613
- * Requires a browser DOM and WebGL. Call {@link appendTo} to attach the canvas,
2614
- * then {@link start} to render scene changes.
3029
+ * Uses a browser canvas by default, or a caller-supplied {@link RendererSurface}.
3030
+ * Call {@link start} for browser animation or {@link renderOnce} for a single frame.
2615
3031
  */
2616
3032
  declare class Renderer implements Disposable {
2617
3033
  static readonly DEFAULT_OPTIONS: RendererOptions;
2618
3034
  readonly options: RendererOptions;
2619
3035
  protected _element?: HTMLElement;
3036
+ private readonly _surface?;
3037
+ private _width;
3038
+ private _height;
2620
3039
  protected _scene: MineRenderScene;
2621
3040
  protected _camera: Camera;
2622
3041
  protected _renderer: WebGLRenderer;
2623
3042
  protected _composer?: EffectComposer;
2624
- protected _controls?: OrbitControls;
3043
+ protected _controls?: RendererControls;
3044
+ private _controlsTime?;
3045
+ private _orbitDistance?;
2625
3046
  protected _stats?: Stats;
2626
3047
  protected _dirty: boolean;
2627
3048
  protected _animationLoop: any;
@@ -2631,16 +3052,29 @@ declare class Renderer implements Disposable {
2631
3052
  private _running;
2632
3053
  private _inAnimationLoop;
2633
3054
  private _disposed;
3055
+ private _videoExporter?;
2634
3056
  private readonly _frameCallbacks;
2635
3057
  private readonly _debugHelpers;
2636
3058
  private readonly _eventDispatchers;
2637
3059
  private readonly _changeListener;
2638
- constructor(options?: DeepPartial<RendererOptions>);
3060
+ constructor(options?: DeepPartial<RendererOptions>, surface?: RendererSurface);
2639
3061
  protected createScene(): MineRenderScene;
2640
3062
  protected createCamera(): Camera;
2641
3063
  protected createRenderer(): WebGLRenderer;
2642
3064
  protected createComposer(): Maybe<EffectComposer>;
2643
- protected createControls(): Maybe<OrbitControls>;
3065
+ protected createControls(): Maybe<RendererControls>;
3066
+ private initialTarget;
3067
+ private createControlsFor;
3068
+ /**
3069
+ * Replaces renderer-owned controls with the selected mode, keeping the camera where it is.
3070
+ * Switching to orbit controls targets the point the camera looks at, at the previous orbit distance.
3071
+ * The previous controls object is disposed, so its listeners and settings do not carry over.
3072
+ * Returns the new controls, or undefined when controls were disabled at construction or after disposal.
3073
+ */
3074
+ setControlsMode(mode: ControlsMode): Maybe<RendererControls>;
3075
+ private disposeControls;
3076
+ /** Advances owned controls; without a frame time, flight movement does not progress. */
3077
+ private updateControls;
2644
3078
  init(): void;
2645
3079
  get element(): Maybe<HTMLElement>;
2646
3080
  /** Attaches the canvas to an element and sizes it to that element's dimensions. */
@@ -2650,8 +3084,10 @@ declare class Renderer implements Disposable {
2650
3084
  * The renderer removes its listener on disposal; the caller retains ownership of the dispatcher.
2651
3085
  */
2652
3086
  registerEventDispatcher(dispatcher: EventDispatcher<any>, changeEvent?: string): void;
3087
+ private unregisterEventDispatcher;
2653
3088
  /** Updates the camera and canvas size. Width and height are in CSS pixels. */
2654
3089
  resize(width: number, height: number): void;
3090
+ private validateSurfaceSize;
2655
3091
  get dirty(): boolean;
2656
3092
  set dirty(dirty: boolean);
2657
3093
  /**
@@ -2660,9 +3096,9 @@ declare class Renderer implements Disposable {
2660
3096
  * Registering the same callback twice has no effect. Image exports do not invoke callbacks.
2661
3097
  */
2662
3098
  onFrame(callback: FrameCallback): () => void;
2663
- /** Starts or resumes the animation loop and registered frame callbacks. */
3099
+ /** Starts or resumes the animation loop and registered frame callbacks. Has no effect while running. */
2664
3100
  start(): void;
2665
- /** Pauses rendering and frame callbacks. Call {@link start} to resume. */
3101
+ /** Pauses rendering and frame callbacks, and cancels video export. Call {@link start} to resume. */
2666
3102
  stop(): void;
2667
3103
  /**
2668
3104
  * Stops rendering and releases owned resources. Repeated calls have no effect, and a disposed
@@ -2672,12 +3108,22 @@ declare class Renderer implements Disposable {
2672
3108
  dispose(): void;
2673
3109
  private animate;
2674
3110
  private drawFrame;
3111
+ /** Draws a fresh frame without starting the animation loop or invoking frame callbacks. */
3112
+ renderOnce(): void;
2675
3113
  /**
2676
3114
  * Renders a fresh frame and returns an image data URL, including while the animation loop is stopped.
2677
3115
  * Trimming removes transparent borders; an empty image becomes one transparent pixel.
2678
3116
  * MIME type support and lossy quality (0–1) follow the canvas encoder.
2679
3117
  */
2680
3118
  toImage(trim?: boolean, mime?: string, quality?: number): string;
3119
+ /**
3120
+ * Records a silent browser video in real time, including frame callbacks and animated textures.
3121
+ * Keep the tab visible; browser scheduling and `render.fpsLimit` limit the capture rate.
3122
+ * The video keeps the initial drawing-buffer size and fills transparent pixels with black.
3123
+ * Temporarily starts a stopped renderer. Stop, disposal, or `options.signal` cancels the export.
3124
+ * Only one export can run at a time. Use the returned Blob's type to select a file extension.
3125
+ */
3126
+ toVideo(options: VideoExportOptions): Promise<Blob>;
2681
3127
  /** Exports visible scene meshes as OBJ text, without texture images. */
2682
3128
  toObj(): string;
2683
3129
  /** Exports visible scene meshes as PLY. Set `options.binary` for an ArrayBuffer. */
@@ -2692,7 +3138,23 @@ declare class Renderer implements Disposable {
2692
3138
  get renderer(): WebGLRenderer;
2693
3139
  get composer(): Maybe<EffectComposer>;
2694
3140
  /** Renderer-owned controls, or undefined when disabled at construction or after disposal. */
2695
- get controls(): Maybe<OrbitControls>;
3141
+ get controls(): Maybe<RendererControls>;
3142
+ /** Renderer-owned OrbitControls, or undefined in fly mode or without controls. */
3143
+ get orbitControls(): Maybe<OrbitControls>;
3144
+ /** Renderer-owned {@link FlyControls}, or undefined in orbit mode or without controls. */
3145
+ get flyControls(): Maybe<FlyControls>;
3146
+ /** The active renderer-owned controls mode, or undefined without controls. */
3147
+ get controlsMode(): Maybe<ControlsMode>;
3148
+ }
3149
+ /** Caller-owned canvas and WebGL 2 context for rendering without a browser DOM. */
3150
+ interface RendererSurface {
3151
+ canvas: Pick<HTMLCanvasElement, "width" | "height" | "addEventListener" | "removeEventListener">;
3152
+ context: WebGL2RenderingContext;
3153
+ /** Initial logical dimensions, before applying `render.pixelRatio`. */
3154
+ width: number;
3155
+ height: number;
3156
+ /** Resizes the native drawing buffer when assigning canvas dimensions is insufficient. */
3157
+ resize?: (drawingBufferWidth: number, drawingBufferHeight: number) => void;
2696
3158
  }
2697
3159
  /** Timing passed to callbacks registered with {@link Renderer.onFrame}. */
2698
3160
  interface RendererFrame {
@@ -2748,9 +3210,15 @@ interface RenderOptions {
2748
3210
  interface ComposerOptions {
2749
3211
  enabled: boolean;
2750
3212
  }
2751
- /** Set `controls: { enabled: true }` in the Renderer constructor to create owned OrbitControls. */
3213
+ /** Renderer-owned camera controls: orbiting around a target, or creative-style flight. */
3214
+ type ControlsMode = "orbit" | "fly";
3215
+ /** Controls created through `controls.enabled`; narrow with `isFlyControls` or {@link Renderer.controlsMode}. */
3216
+ type RendererControls = OrbitControls | FlyControls;
3217
+ /** Set `controls: { enabled: true }` in the Renderer constructor to create owned controls. */
2752
3218
  interface ControlsOptions {
2753
3219
  enabled: boolean;
3220
+ /** `orbit` (default) creates OrbitControls; `fly` creates {@link FlyControls}. */
3221
+ mode?: ControlsMode;
2754
3222
  }
2755
3223
  /** Scene helpers enabled through `debug` in the Renderer constructor options. */
2756
3224
  interface DebugOptions {
@@ -2862,6 +3330,14 @@ interface SceneBlockDefinition extends SceneObjectDefinitionBase {
2862
3330
  tints?: Record<number, number>;
2863
3331
  };
2864
3332
  }
3333
+ /** Supplied item state; see ItemModelContext. Item references are item IDs such as minecraft:apple. */
3334
+ interface SceneItemContext {
3335
+ displayContext?: DisplayPosition | "none";
3336
+ properties?: Record<string, boolean | string | number>;
3337
+ components?: Record<string, unknown>;
3338
+ count?: number;
3339
+ itemReferences?: Record<string, string>;
3340
+ }
2865
3341
  interface SceneModelDefinition extends SceneObjectDefinitionBase {
2866
3342
  type: "item" | "model";
2867
3343
  asset: string;
@@ -2870,6 +3346,8 @@ interface SceneModelDefinition extends SceneObjectDefinitionBase {
2870
3346
  displayPosition?: DisplayPosition;
2871
3347
  tints?: Record<number, number>;
2872
3348
  };
3349
+ /** Item state for `type: "item"` definitions only. */
3350
+ context?: SceneItemContext;
2873
3351
  }
2874
3352
  interface SceneEntityDefinition extends SceneObjectDefinitionBase {
2875
3353
  type: "entity";
@@ -2893,8 +3371,9 @@ interface SceneEntityDefinition extends SceneObjectDefinitionBase {
2893
3371
  }
2894
3372
  type SceneGuiLayer = (Omit<GuiTextureLayer, "texture"> & {
2895
3373
  texture: string;
2896
- }) | (Omit<GuiItemLayer, "item"> & {
3374
+ }) | (Omit<GuiItemLayer, "item" | "context"> & {
2897
3375
  item: string;
3376
+ context?: Omit<SceneItemContext, "displayContext">;
2898
3377
  }) | (Omit<GuiTextLayer, "font"> & {
2899
3378
  font?: string;
2900
3379
  });
@@ -2935,6 +3414,20 @@ declare class SceneDocumentLoader {
2935
3414
  private static loadValidatedObject;
2936
3415
  }
2937
3416
 
3417
+ /** Resolves Minecraft profile components to resource textures or shared, prepared player skins. */
3418
+ declare class PlayerHeadTextures {
3419
+ /** Resource textures retain their pixels; downloaded skins use the skin pipeline's legacy and opacity rules. */
3420
+ static get(value: unknown, root?: string): Promise<{
3421
+ texture: AssetKey;
3422
+ material?: MeshBasicMaterial;
3423
+ }>;
3424
+ private static resource;
3425
+ private static profile;
3426
+ private static propertyUrl;
3427
+ private static offlineUuid;
3428
+ private static uuidString;
3429
+ }
3430
+
2938
3431
  type SkinGeometries = Record<SkinPart, TripleArray>;
2939
3432
  declare const classicSkinGeometries: SkinGeometries;
2940
3433
  declare const slimSkinGeometries: SkinGeometries;
@@ -3006,6 +3499,8 @@ declare class Skins {
3006
3499
  declare class Colormaps {
3007
3500
  /** Samples the selected resource pack's grass colormap using Minecraft's climate coordinates. */
3008
3501
  static grassColor(origin?: AssetKey, temperature?: number, downfall?: number): Promise<number>;
3502
+ /** Samples a resource-pack colormap at the supplied climate coordinates. */
3503
+ static getColor(kind: "grass" | "foliage" | "dry_foliage", origin?: AssetKey, temperature?: number, downfall?: number): Promise<number>;
3009
3504
  }
3010
3505
 
3011
3506
  /** Creates sRGB textures immediately and fills their pixels after asynchronous image loading. */
@@ -3041,6 +3536,7 @@ declare function mergeVertices(geometry: BufferGeometry, tolerance?: number): Bu
3041
3536
  declare function toTrianglesDrawMode(geometry: BufferGeometry, drawMode: TrianglesDrawModes): BufferGeometry;
3042
3537
  declare function computeMorphedAttributes(object: Mesh | Line | Points): object;
3043
3538
 
3539
+ type PaletteState = Readonly<Pick<Block, "type" | "properties">>;
3044
3540
  /** Stores 4,096 block cells in a shared state palette, with separate NBT for each cell. */
3045
3541
  declare class ChunkData {
3046
3542
  private readonly indices;
@@ -3054,13 +3550,46 @@ declare class ChunkData {
3054
3550
  snapshot(index: number): Maybe<() => Block>;
3055
3551
  /** Copies block data into a cell. An omitted block or an air block clears the cell. */
3056
3552
  set(index: number, block?: Block): void;
3553
+ /** Interns a normalized block state without changing cells. Air has palette id 0. */
3554
+ intern(block: Maybe<Block>): number;
3555
+ /** Assigns an interned state to a cell and replaces its NBT. `undefined` clears the NBT. */
3556
+ assign(index: number, id: number, nbt?: unknown): void;
3557
+ /** Replaces all cells from palette indices, normalizes air to 0, and clears NBT. */
3558
+ fill(palette: readonly Maybe<Block>[], indices: Uint16Array): void;
3559
+ /** Returns a cell's palette id, or 0 for air. */
3560
+ idAt(index: number): number;
3561
+ /** Returns a frozen state, or `undefined` for air or a freed palette id. */
3562
+ stateAt(id: number): PaletteState | undefined;
3563
+ /** Replaces cells, palette entries, and NBT with independent copies of another section. */
3564
+ copyFrom(other: ChunkData): void;
3057
3565
  clear(): void;
3058
3566
  static isAir(block: Maybe<Block>): boolean;
3567
+ /** Identifies a normalized block type and its sorted properties, excluding per-cell NBT. */
3568
+ static paletteKey(block: Block): string;
3059
3569
  private static copyBlock;
3060
3570
  private static validateIndex;
3061
3571
  }
3062
3572
 
3063
3573
  type RegionInput = Uint8Array | ArrayBuffer;
3574
+ /** Reads `c.<x>.<z>.mcc` at absolute chunk coordinates, or returns `undefined` when the file is missing. */
3575
+ type AnvilExternalChunkReader = (x: number, z: number, signal?: AbortSignal) => Promise<Uint8Array | ArrayBuffer | undefined>;
3576
+ interface AnvilParseOptions {
3577
+ /** Asset root used to select numeric block mappings. Omit to use the active asset sources. */
3578
+ root?: string;
3579
+ /** Overrides numeric `id:metadata` mappings with block states such as `minecraft:oak_log[axis=x]`. */
3580
+ legacyMappings?: Readonly<Record<string, string>>;
3581
+ /** For numeric blocks, tries metadata 0 for unmapped states and skips unknown IDs. Defaults to false. */
3582
+ lenient?: boolean;
3583
+ /** Region coordinates from `r.<x>.<z>.mca`, required when reading external chunks. */
3584
+ region?: {
3585
+ x: number;
3586
+ z: number;
3587
+ };
3588
+ /** Reads external chunk payloads without their region-file header. */
3589
+ readExternalChunk?: AnvilExternalChunkReader;
3590
+ /** Cancels parsing and forwards the signal to external chunk reads. */
3591
+ signal?: AbortSignal;
3592
+ }
3064
3593
  /** Chunk columns decoded from an Anvil region file. */
3065
3594
  interface AnvilRegion {
3066
3595
  chunks: AnvilChunk[];
@@ -3070,37 +3599,104 @@ interface AnvilChunk {
3070
3599
  x: number;
3071
3600
  z: number;
3072
3601
  dataVersion?: number;
3602
+ /** DataVersion of the separate entity-region record; `dataVersion` belongs to the terrain. */
3603
+ entityDataVersion?: number;
3073
3604
  sections: {
3074
3605
  y: number;
3075
3606
  data: ChunkData;
3607
+ /** 64 saved biome IDs, indexed by x + z * 4 + y * 16 at 4-block resolution. */
3608
+ biomes?: readonly string[];
3076
3609
  }[];
3077
3610
  entities?: MultiBlockEntity[];
3078
3611
  }
3079
- /** Reads Java 1.13+ paletted `.mca` regions. Entity NBT is preserved without data-version migration. */
3612
+ /** Entities decoded from an entity region, with absolute chunk coordinates. */
3613
+ interface AnvilEntityChunk {
3614
+ x: number;
3615
+ z: number;
3616
+ dataVersion?: number;
3617
+ entities: MultiBlockEntity[];
3618
+ }
3619
+ /** Reads numeric and paletted Java terrain and entity `.mca` regions without data-version migration. */
3080
3620
  declare class AnvilParser {
3081
3621
  /** Lists occupied chunk positions within the region, using local coordinates from 0 to 31. */
3082
3622
  static getChunkList(data: RegionInput): {
3083
3623
  x: number;
3084
3624
  z: number;
3085
3625
  }[];
3086
- /** Decodes all stored chunks. Gzip, zlib, and uncompressed payloads are supported. */
3087
- static parse(data: RegionInput): Promise<AnvilRegion>;
3626
+ /** Decodes all stored chunks. Gzip, zlib, LZ4, and uncompressed payloads are supported. */
3627
+ static parse(data: RegionInput, options?: AnvilParseOptions): Promise<AnvilRegion>;
3088
3628
  /**
3089
3629
  * Decodes one chunk for {@link MineRenderWorld.placeChunk}.
3090
3630
  * @param localX - Chunk x within the region, from 0 to 31.
3091
3631
  * @param localZ - Chunk z within the region, from 0 to 31.
3092
3632
  * @returns The chunk with absolute coordinates, or `undefined` if the region has no chunk there.
3093
3633
  */
3094
- static parseChunk(data: RegionInput, localX: number, localZ: number): Promise<AnvilChunk | undefined>;
3634
+ static parseChunk(data: RegionInput, localX: number, localZ: number, options?: AnvilParseOptions): Promise<AnvilChunk | undefined>;
3635
+ /**
3636
+ * Decodes one chunk from an `entities/r.x.z.mca` file without migrating its NBT.
3637
+ * @param localX - Chunk x within the region, from 0 to 31.
3638
+ * @param localZ - Chunk z within the region, from 0 to 31.
3639
+ * @returns The entities with absolute chunk coordinates, or `undefined` if no chunk is stored there.
3640
+ */
3641
+ static parseEntityChunk(data: RegionInput, localX: number, localZ: number, options?: AnvilParseOptions): Promise<AnvilEntityChunk | undefined>;
3642
+ private static location;
3643
+ private static abortable;
3095
3644
  private static bytes;
3096
3645
  private static locations;
3646
+ private static readNBT;
3097
3647
  private static readChunk;
3648
+ private static numericSection;
3649
+ private static entities;
3650
+ private static biomes;
3098
3651
  private static compounds;
3099
3652
  private static integer;
3100
3653
  private static block;
3101
3654
  private static unpack;
3102
3655
  }
3103
3656
 
3657
+ /** Loads chunk columns at absolute integer chunk coordinates. */
3658
+ interface WorldChunkSource {
3659
+ /** Returns the requested column, or `undefined` if absent. Honor signal to cancel discarded reads. */
3660
+ getChunk(x: number, z: number, signal?: AbortSignal): Promise<AnvilChunk | undefined>;
3661
+ }
3662
+
3663
+ /**
3664
+ * Reads `r.<x>.<z>.mca` at integer region coordinates, or returns `undefined` when absent.
3665
+ * Forward `signal` to file or network I/O; it aborts when every caller waiting for the region cancels.
3666
+ */
3667
+ type AnvilRegionReader = (x: number, z: number, signal?: AbortSignal) => Promise<Uint8Array | ArrayBuffer | undefined>;
3668
+ /** Readers and cache limits passed to `new AnvilWorldSource(readRegion, options)`. */
3669
+ interface AnvilWorldSourceOptions extends Pick<AnvilParseOptions, "readExternalChunk" | "legacyMappings" | "lenient" | "root"> {
3670
+ /** Reads a dimension's separate `entities/r.<x>.<z>.mca` files. Omit to use embedded entities only. */
3671
+ readEntityRegion?: AnvilRegionReader;
3672
+ /** Maximum cached regions per kind (terrain and entities), including missing regions. Defaults to 4 each; 0 disables caching. */
3673
+ maxCachedRegions?: number;
3674
+ /** Maximum retained bytes across both region types. Defaults to 64 MiB; larger regions are read without caching. */
3675
+ maxCachedBytes?: number;
3676
+ }
3677
+ /** Reads selected Java Anvil chunk columns and caches raw regions within count and byte limits. */
3678
+ declare class AnvilWorldSource implements WorldChunkSource {
3679
+ private readonly readRegion;
3680
+ private readonly regions;
3681
+ private readonly pending;
3682
+ private readonly maxCachedRegions;
3683
+ private readonly maxCachedBytes;
3684
+ private readonly readEntityRegion?;
3685
+ private readonly parseOptions;
3686
+ private cachedBytes;
3687
+ constructor(readRegion: AnvilRegionReader, options?: AnvilWorldSourceOptions);
3688
+ /**
3689
+ * Decodes a column at absolute chunk coordinates, including entity-only columns.
3690
+ * A separate entity record replaces embedded entities, even when its list is empty.
3691
+ * Missing entity files or records leave embedded entities intact. Aborting a caller leaves other shared readers active.
3692
+ */
3693
+ getChunk(x: number, z: number, signal?: AbortSignal): Promise<AnvilChunk | undefined>;
3694
+ /** Releases cached regions. Reads already in progress finish without repopulating this cache. */
3695
+ clearCache(): void;
3696
+ private getRegion;
3697
+ private cacheRegion;
3698
+ }
3699
+
3104
3700
  /** A placed block's data snapshot and optional render object, returned by world and chunk accessors. */
3105
3701
  interface BlockInfo<SectionMeshing extends boolean = false> {
3106
3702
  /** Detached block data; use world or chunk setters to update stored blocks. */
@@ -3109,11 +3705,13 @@ interface BlockInfo<SectionMeshing extends boolean = false> {
3109
3705
  object: SectionMeshing extends false ? BlockObject : BlockObject | undefined;
3110
3706
  }
3111
3707
 
3112
- /** Shared cube geometry and atlas data prepared for section merging. */
3708
+ /** Shared quad geometry and atlas data prepared for section merging. */
3113
3709
  interface SectionMeshTemplate {
3114
3710
  geometry: BufferGeometry;
3115
3711
  atlas: TextureAtlas;
3116
- cullFaces: readonly number[];
3712
+ cullFaces: Uint8Array;
3713
+ occludes: boolean;
3714
+ layer: 0 | 1;
3117
3715
  }
3118
3716
  /** One block placement in a section, with its storage index and hidden-face mask. */
3119
3717
  interface SectionMeshEntry {
@@ -3121,24 +3719,44 @@ interface SectionMeshEntry {
3121
3719
  template: SectionMeshTemplate;
3122
3720
  cullMask: number;
3123
3721
  }
3722
+ /** Fluid cells for one section and the shared atlases of the kinds present. */
3723
+ interface SectionFluids {
3724
+ cells: Uint8Array;
3725
+ /** Linear RGB per section cell, indexed by (x + 16z + 256y) * 3. */
3726
+ waterTints?: Float32Array;
3727
+ water?: TextureAtlas;
3728
+ lava?: TextureAtlas;
3729
+ }
3124
3730
  /** Merged terrain geometry and atlas pages for one 16×16×16 section. Owns its generated render resources. */
3125
3731
  declare class SectionMesh extends Group {
3126
3732
  private readonly ownedMeshes;
3127
- /** Builds section-local meshes from visible cube faces. `maxAtlasSize` limits each atlas dimension in pixels. */
3128
- static build(entries: readonly SectionMeshEntry[], maxAtlasSize?: number): SectionMesh;
3733
+ /** Builds section-local meshes from visible quads. `maxAtlasSize` limits each atlas dimension in pixels. */
3734
+ static build(entries: readonly SectionMeshEntry[], maxAtlasSize?: number, fluids?: SectionFluids): SectionMesh;
3735
+ /** Builds section-local meshes in a browser worker when available, with synchronous fallback. */
3736
+ static buildAsync(entries: readonly SectionMeshEntry[], maxAtlasSize?: number, fluids?: SectionFluids): Promise<SectionMesh>;
3737
+ private static fromPages;
3129
3738
  dispose(): void;
3130
3739
  }
3131
3740
 
3132
- /** Prepares and caches static opaque cube geometry for merged world sections. */
3741
+ /** Prepares and caches model geometry and fluid atlases for merged world sections. */
3133
3742
  declare class SectionModels {
3134
3743
  readonly maxAtlasSize: number;
3135
3744
  private states;
3136
3745
  private models;
3137
3746
  private readonly templates;
3747
+ private readonly fluidAtlases;
3138
3748
  constructor(maxAtlasSize?: number);
3139
- /** Returns a cube template, or `undefined` when the block requires an individual render object. */
3140
- get(blockState: BlockState, properties?: BlockStateProperties): Promise<SectionMeshTemplate | undefined>;
3749
+ /** Returns templates for the matched parts, or `undefined` when the block needs an individual render object. */
3750
+ get(blockState: BlockState, properties?: BlockStateProperties, position?: Readonly<TripleArray>, biome?: string): Promise<SectionMeshTemplate[] | undefined>;
3751
+ /** Resolves section templates for one tint palette, with a synchronous weighted choice for each cell. */
3752
+ prepareState(blockState: BlockState, properties?: BlockStateProperties, biomeColor?: number | (() => Promise<number | undefined>)): Promise<{
3753
+ pick(position?: Readonly<TripleArray>): SectionMeshTemplate[];
3754
+ } | undefined>;
3755
+ private state;
3756
+ /** Returns the shared still/flow atlas used by per-block fluid objects. */
3757
+ fluidAtlas(kind: FluidKind, root?: string): Promise<TextureAtlas>;
3141
3758
  private prepare;
3759
+ private template;
3142
3760
  /** Disposes prepared geometry and clears this world's template caches. */
3143
3761
  clear(): void;
3144
3762
  }
@@ -3151,6 +3769,9 @@ declare class SectionModels {
3151
3769
  declare class Chunk<SectionMeshing extends boolean = false> {
3152
3770
  private readonly onBlocksChanged?;
3153
3771
  private readonly sectionModels?;
3772
+ private readonly neighborCell?;
3773
+ private readonly biomeAt?;
3774
+ private readonly onBiomesChanged?;
3154
3775
  readonly scene: MineRenderScene;
3155
3776
  readonly x: number;
3156
3777
  readonly y: number;
@@ -3159,12 +3780,25 @@ declare class Chunk<SectionMeshing extends boolean = false> {
3159
3780
  private readonly renderedBlocks;
3160
3781
  private readonly sectionBlocks;
3161
3782
  private readonly hiddenBlocks;
3783
+ private readonly fluidCells;
3784
+ private readonly blockPosition;
3785
+ private waterTints?;
3786
+ private biomes?;
3162
3787
  private sectionMesh?;
3163
3788
  private meshDirty;
3164
- constructor(scene: MineRenderScene, x: number, y: number, z: number, onBlocksChanged?: ((positions: Vector3[]) => Promise<void>) | undefined, sectionModels?: SectionModels | undefined);
3789
+ private meshGeneration;
3790
+ constructor(scene: MineRenderScene, x: number, y: number, z: number, onBlocksChanged?: ((positions: Vector3[]) => Promise<void>) | undefined, sectionModels?: SectionModels | undefined, neighborCell?: ((x: number, y: number, z: number) => number) | undefined, biomeAt?: ((x: number, y: number, z: number) => Maybe<string>) | undefined, onBiomesChanged?: ((biomes?: readonly string[]) => Promise<void>) | undefined);
3165
3791
  getBlockAt(x: number, y: number, z: number): Maybe<BlockInfo<SectionMeshing>>;
3166
3792
  getBlockAt(pos: Vector3): Maybe<BlockInfo<SectionMeshing>>;
3167
3793
  getBlockAt(pos: TripleArray): Maybe<BlockInfo<SectionMeshing>>;
3794
+ /** Returns the saved 4-block biome sample at integer world block coordinates, or `undefined` if absent. */
3795
+ getBiomeAt(x: number, y: number, z: number): Maybe<string>;
3796
+ getBiomeAt(pos: Vector3): Maybe<string>;
3797
+ getBiomeAt(pos: TripleArray): Maybe<string>;
3798
+ /** Copies 64 biome IDs in x + z * 4 + y * 16 order and refreshes placed blocks. Omit the array to clear biome data. */
3799
+ setBiomes(biomes?: readonly string[]): Promise<void>;
3800
+ /** Rebuilds biome-tinted blocks while preserving hidden blocks and unrelated render objects. */
3801
+ refreshBiomes(): Promise<void>;
3168
3802
  /**
3169
3803
  * Places a block at integer world block coordinates. Pass `undefined` to remove it.
3170
3804
  */
@@ -3175,14 +3809,38 @@ declare class Chunk<SectionMeshing extends boolean = false> {
3175
3809
  * Places a block at integer chunk-local coordinates from 0 to 15.
3176
3810
  */
3177
3811
  setBlockInChunkAt(pos: Vector3, block?: Block, worldPos?: Vector3, onBlocksChanged?: ((positions: Vector3[]) => Promise<void>) | undefined): Promise<Maybe<BlockInfo<SectionMeshing>>>;
3812
+ /** Places cells in input order and returns changed world positions without refreshing neighbors. */
3813
+ placeBlocks(blocks: readonly {
3814
+ index: number;
3815
+ block: Maybe<Block>;
3816
+ }[]): Promise<Vector3[]>;
3817
+ /** Replaces every cell from parsed section data. The caller refreshes neighbor culling. */
3818
+ placeSection(data: ChunkData): Promise<void>;
3819
+ private positionAt;
3820
+ private biomePosition;
3821
+ private resolveState;
3822
+ private setWaterTint;
3178
3823
  /** Changes visibility at world block coordinates while preserving the block's data. */
3179
3824
  setBlockVisibleAt(pos: Vector3, visible: boolean): Promise<void>;
3180
3825
  isBlockVisibleAt(pos: Vector3): boolean;
3826
+ /** Reports whether a cell has a visible render object or section entry. */
3827
+ isBlockVisibleIndex(index: number): boolean;
3828
+ /** Fluid kind bits and level of a cell, or 0. Hidden cells report 0. */
3829
+ fluidByteIndex(index: number): number;
3830
+ /** Whether the cell holds a fluid, merged or per-block. */
3831
+ isFluidIndex(index: number): boolean;
3181
3832
  isOccludingAt(pos: Vector3): boolean;
3833
+ /** Reports whether a visible cell hides neighboring cube faces. */
3834
+ isOccludingIndex(index: number): boolean;
3182
3835
  setCullMaskAt(pos: Vector3, mask: number): Promise<void>;
3183
- rebuildSectionMesh(): void;
3184
- /** Removes stored blocks and their render objects, then notifies the owning world of changed positions. */
3185
- clear(onBlocksChanged?: ((positions: Vector3[]) => Promise<void>) | undefined): Promise<void>;
3836
+ /** Recomputes section masks and returns changed per-block masks. Omit indices to visit every cell. */
3837
+ updateCullMasks(indices: Iterable<number> | undefined, occludes: (x: number, y: number, z: number) => boolean): [number, number][];
3838
+ /** Updates hidden faces for a cell's section entry or individual render object. */
3839
+ setCullMaskIndex(index: number, mask: number): Promise<void>;
3840
+ /** Rebuilds visible section geometry and discards results superseded by another rebuild or clear. */
3841
+ rebuildSectionMesh(): Promise<void>;
3842
+ /** Removes stored blocks and render objects. Set `notify` to false to skip the owning world's update. */
3843
+ clear(notify?: boolean): Promise<void>;
3186
3844
  dispose(): Promise<void>;
3187
3845
  static isAir(block: Maybe<Block>): boolean;
3188
3846
  /** Maps chunk-local coordinates from 0 to 15 to a storage index, with x varying fastest, then z, then y. */
@@ -3199,7 +3857,9 @@ declare class Chunk<SectionMeshing extends boolean = false> {
3199
3857
  declare class MineRenderWorld<SectionMeshing extends boolean = false> {
3200
3858
  readonly scene: MineRenderScene;
3201
3859
  private readonly _chunks;
3860
+ private readonly biomes;
3202
3861
  private readonly sectionModels?;
3862
+ private readonly entities?;
3203
3863
  private readonly pendingCulling;
3204
3864
  private culling?;
3205
3865
  constructor(scene: MineRenderScene, options?: MineRenderWorldOptions<SectionMeshing>);
@@ -3207,6 +3867,10 @@ declare class MineRenderWorld<SectionMeshing extends boolean = false> {
3207
3867
  getBlockAt(x: number, y: number, z: number): Maybe<BlockInfo<SectionMeshing>>;
3208
3868
  getBlockAt(pos: Vector3): Maybe<BlockInfo<SectionMeshing>>;
3209
3869
  getBlockAt(pos: TripleArray): Maybe<BlockInfo<SectionMeshing>>;
3870
+ /** Returns the saved 4-block biome sample at integer world block coordinates, or `undefined` if absent. */
3871
+ getBiomeAt(x: number, y: number, z: number): Maybe<string>;
3872
+ getBiomeAt(pos: Vector3): Maybe<string>;
3873
+ getBiomeAt(pos: TripleArray): Maybe<string>;
3210
3874
  /**
3211
3875
  * Places or replaces a block and refreshes neighboring faces.
3212
3876
  * Pass `undefined` or an air block to remove the block at these world block coordinates.
@@ -3224,22 +3888,24 @@ declare class MineRenderWorld<SectionMeshing extends boolean = false> {
3224
3888
  setBlockVisibleAt(pos: TripleArray, visible: boolean): Promise<void>;
3225
3889
  /**
3226
3890
  * Places a structure's blocks at their stored positions, then refreshes neighboring faces.
3227
- * Entity NBT is retained by the structure but is not rendered.
3891
+ * With `renderEntities`, also places supported saved mobs and applies supported appearance fields.
3228
3892
  *
3229
- * @param useBatches - Uses bounded batches by default. Set to `false` for sequential placement.
3893
+ * @param useBatches - Yields between chunks by default. Set to `false` for sequential placement.
3230
3894
  * @param executor - Optional queue for batched placement. The caller remains responsible for stopping it.
3231
3895
  */
3232
3896
  placeMultiBlock(multiblock: MultiBlockStructure, useBatches?: boolean, executor?: BatchedExecutor): Promise<void>;
3233
3897
  private placeBlocks;
3234
- /** Replaces one chunk column's blocks. Entity NBT remains available on the parsed chunk. */
3898
+ private placeChunkGroups;
3899
+ /** Replaces a chunk column's blocks and biome samples and, with `renderEntities`, its supported saved mobs. */
3235
3900
  placeChunk(chunk: AnvilChunk, executor?: BatchedExecutor): Promise<void>;
3236
3901
  /**
3237
- * Removes all sections at integer chunk-column coordinates, then refreshes neighboring faces and fluids.
3902
+ * Removes blocks and owned entities at chunk-column coordinates, then refreshes neighboring faces and fluids.
3238
3903
  * Coordinates match AnvilChunk.x/z, not block positions. Missing columns are ignored.
3239
3904
  */
3240
3905
  unloadChunkColumn(x: number, z: number): Promise<void>;
3241
3906
  private clearChunkColumn;
3242
- /** Removes all chunks and releases their block placements and section meshes. */
3907
+ private markSectionChanged;
3908
+ /** Removes all chunks and releases their blocks, section meshes, and owned entities. */
3243
3909
  clear(): Promise<void>;
3244
3910
  private updateCulling;
3245
3911
  private getOrCreateChunkAt;
@@ -3254,12 +3920,166 @@ declare class MineRenderWorld<SectionMeshing extends boolean = false> {
3254
3920
  }
3255
3921
  /** Settings passed as the second argument to `new MineRenderWorld(scene, options)`. */
3256
3922
  interface MineRenderWorldOptions<SectionMeshing extends boolean = boolean> {
3923
+ /** Render supported saved mobs at their position and yaw, including supported appearance fields. Defaults to false. */
3924
+ renderEntities?: boolean;
3257
3925
  /** Merge static opaque cubes into section meshes. Merged blocks have no individual object. */
3258
3926
  sectionMeshing?: SectionMeshing;
3259
3927
  /** Maximum width and height of each section atlas page, in pixels. */
3260
3928
  maxAtlasSize?: number;
3261
3929
  }
3262
3930
 
3931
+ /** Static model geometry as quads: four vertices per quad, in quad order. */
3932
+ interface SectionTemplateData {
3933
+ quads: number;
3934
+ positions: Float32Array;
3935
+ normals: Float32Array;
3936
+ uvs: Float32Array;
3937
+ uvBounds: Float32Array;
3938
+ colors: Float32Array;
3939
+ indices: Uint16Array;
3940
+ cullFaces: Uint8Array;
3941
+ atlas: number;
3942
+ layer: number;
3943
+ }
3944
+ /** The pixel dimensions and animation state of a source atlas. */
3945
+ interface SectionAtlasSize {
3946
+ width: number;
3947
+ height: number;
3948
+ animated: boolean;
3949
+ }
3950
+ /** One fluid kind's sprite rectangles in atlas pixels and its linear-light vertex tint. */
3951
+ interface SectionFluidKind {
3952
+ atlas: number;
3953
+ still: [x: number, y: number, width: number, height: number];
3954
+ flow: [x: number, y: number, width: number, height: number];
3955
+ tint: [r: number, g: number, b: number];
3956
+ }
3957
+ /** Fluid cells of the section plus a one-cell shell, 18×18×18, x fastest, then z, then y. */
3958
+ interface SectionFluidInput {
3959
+ /** Bit 128 marks a surface rendered elsewhere; the cell still supplies neighbor fluid samples. */
3960
+ cells: Uint8Array;
3961
+ /** Linear RGB per section cell, indexed by (x + 16z + 256y) * 3. Omission uses the water kind's tint. */
3962
+ waterTints?: Float32Array;
3963
+ water?: SectionFluidKind;
3964
+ lava?: SectionFluidKind;
3965
+ }
3966
+ /** Section placements and their shared templates, ready for geometry building. */
3967
+ interface SectionGeometryInput {
3968
+ count: number;
3969
+ indices: Uint16Array;
3970
+ templates: Uint16Array;
3971
+ cullMasks: Uint8Array;
3972
+ templateData: SectionTemplateData[];
3973
+ atlases: SectionAtlasSize[];
3974
+ maxAtlasSize: number;
3975
+ fluids?: SectionFluidInput;
3976
+ }
3977
+ /** Merged quads and source-atlas placements for one atlas page. */
3978
+ interface SectionGeometryPage {
3979
+ layer: number;
3980
+ width: number;
3981
+ height: number;
3982
+ placements: {
3983
+ atlas: number;
3984
+ x: number;
3985
+ y: number;
3986
+ }[];
3987
+ positions: Float32Array;
3988
+ normals: Float32Array;
3989
+ uvs: Float32Array;
3990
+ uvBounds: Float32Array;
3991
+ colors: Float32Array;
3992
+ indices: Uint32Array;
3993
+ }
3994
+ /** Builds section-local geometry from visible quads, with bounded atlas pages per layer. */
3995
+ declare function buildSectionGeometry(input: SectionGeometryInput): SectionGeometryPage[];
3996
+ /** Returns the buffers behind each page's typed arrays for transfer to another thread. */
3997
+ declare function sectionGeometryTransferables(pages: readonly SectionGeometryPage[]): ArrayBuffer[];
3998
+
3999
+ /** Runs section geometry builds in the environment's shared worker. */
4000
+ declare class SectionWorker {
4001
+ private worker;
4002
+ private static initialized;
4003
+ private static instance;
4004
+ private nextId;
4005
+ private readonly pending;
4006
+ private constructor();
4007
+ /** The shared worker, or undefined when the environment has none or a previous worker failed. */
4008
+ static shared(): SectionWorker | undefined;
4009
+ /** Builds geometry without transferring the input buffers away from the caller. */
4010
+ build(input: SectionGeometryInput): Promise<SectionGeometryPage[]>;
4011
+ /** Rejects pending builds, terminates the worker, and makes shared() return undefined. */
4012
+ terminate(): void;
4013
+ private fail;
4014
+ }
4015
+
4016
+ interface WorldStreamerOptions {
4017
+ /** Loads a square of chunk columns around the center. Integer from 0 to 32; defaults to 2. */
4018
+ loadRadius?: number;
4019
+ /** Retains loaded columns within this radius. Defaults to loadRadius + 1, capped at 32. */
4020
+ unloadRadius?: number;
4021
+ }
4022
+ /**
4023
+ * Loads nearby chunk columns in distance order and unloads distant columns.
4024
+ * Updates coalesce to the latest center and serialize world mutations. Use a dedicated world:
4025
+ * the streamer replaces columns it loads, and callers must await disposal before editing that world.
4026
+ * The source remains caller-owned. Lighting, biome tint, and LOD are not added by streaming.
4027
+ */
4028
+ declare class WorldStreamer {
4029
+ private readonly world;
4030
+ private readonly source;
4031
+ private readonly loadRadius;
4032
+ private readonly unloadRadius;
4033
+ private readonly loaded;
4034
+ private readonly owned;
4035
+ private readonly missing;
4036
+ private readonly failed;
4037
+ private desired;
4038
+ private center?;
4039
+ private loading?;
4040
+ private running?;
4041
+ private disposal?;
4042
+ private disposed;
4043
+ constructor(world: Pick<MineRenderWorld<boolean>, "placeChunk" | "unloadChunkColumn">, source: WorldChunkSource, options?: WorldStreamerOptions);
4044
+ /** Returns absolute coordinates of successfully placed columns, including retained columns. */
4045
+ get loadedChunks(): readonly {
4046
+ x: number;
4047
+ z: number;
4048
+ }[];
4049
+ /** Returns source failures retained within the unload radius. Failed columns do not block other loads. */
4050
+ get failedChunks(): readonly {
4051
+ x: number;
4052
+ z: number;
4053
+ error: unknown;
4054
+ }[];
4055
+ /** Counts desired columns still waiting for a source read or placement, including the active column. */
4056
+ get pendingChunks(): number;
4057
+ /**
4058
+ * Updates the center in absolute chunk coordinates. Repeated calls share the active drain.
4059
+ * Source failures are recorded in failedChunks; other columns continue loading. Missing and failed
4060
+ * columns are remembered within the retention radius. Call retryFailedChunks to retry source failures.
4061
+ * Placement and unload failures reject the drain; call update again to retry those operations.
4062
+ * Reads outside the latest load radius receive an abort signal; placement finishes before unloading.
4063
+ * Sources should represent an unchanged world during streaming.
4064
+ */
4065
+ update(x: number, z: number): Promise<void>;
4066
+ /** Updates from a camera or view-center position in scene units. One chunk spans 256 scene units. */
4067
+ updatePosition(position: {
4068
+ x: number;
4069
+ z: number;
4070
+ }): Promise<void>;
4071
+ /** Forgets recorded source failures and retries desired columns at the latest center. */
4072
+ retryFailedChunks(): Promise<void>;
4073
+ /** Aborts source reads, waits for active work, then unloads owned columns. The world and source remain caller-owned. */
4074
+ dispose(): Promise<void>;
4075
+ private drain;
4076
+ private needsLoad;
4077
+ private unload;
4078
+ private validateChunk;
4079
+ private within;
4080
+ private key;
4081
+ }
4082
+
3263
4083
  /**
3264
4084
  * {@link EnvProvider} backed by the DOM. Uses nothing outside of standard browser APIs and
3265
4085
  * localforage, so it stays free of Node polyfills.
@@ -3270,6 +4090,7 @@ declare class BrowserEnv implements EnvProvider {
3270
4090
  createImage(width?: number, height?: number): CompatImage;
3271
4091
  imageSize(data: Uint8Array): ImageSizeInfo;
3272
4092
  openCache(name: string, version: number): PersistentCache;
4093
+ createWorker(name: "section"): Worker | undefined;
3273
4094
  }
3274
4095
  /** Installs the browser provider. The browser package entry calls this automatically. */
3275
4096
  declare function registerBrowserEnv(): BrowserEnv;
@@ -3297,4 +4118,4 @@ declare class BrowserCache extends PersistentCache<LocalForage> {
3297
4118
  */
3298
4119
  declare function probeImageSize(data: Uint8Array): ImageSizeInfo;
3299
4120
 
3300
- export { AXES, type AnimationFrame, type AnimationMeta, type AnimatorFunction, type AnvilChunk, AnvilParser, type AnvilRegion, 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 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, BrowserCache, BrowserEnv, CUBE_FACES, CUBE_FACE_OFFSETS, type CacheKey, Caching, type CameraOptions, CanvasImage, type CapeLayout, Chunk, ChunkData, Colormaps, type CompatCanvas, type CompatImage, type ComposerOptions, type ControlsOptions, CubeFace, CubeFaceIndex, DEFAULT_ELEMENTS, DEFAULT_NAMESPACE, DEFAULT_ROOT, DEFAULT_UV, DISPLAY_POSITIONS, DYE_COLORS, type DebugOptions, 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 FluidSample, type FluidSampler, 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, type ItemModel, type ItemModelContext, type ItemModelTextures, type ItemTintColor, type ItemTintSource, ItemTints, type ListAsset, type LoadedSceneDocument, type LoadedSceneObject, MapControls, type MaterialKey, Materials, type Maybe, type MeshKey, Meshes, 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, OrbitControls, type PackFormat, PackFormats, PackMetadata, PersistentCache, type PositionedGuiGlyph, type QuadArray, type RawImageKey, type RenderOptions, Renderer, type RendererFrame, type RendererOptions, type RequestConfig, RequestError, type RequestResponse, Requests, type ResolvedBlockEntity, type ResponseParser, SKIN_PARTS, type SceneBlockDefinition, type SceneDocument, SceneDocumentLoader, type SceneEntityDefinition, SceneExporter, type SceneGLTFExportOptions, type SceneGuiDefinition, type SceneGuiLayer, SceneInspector, type SceneModelDefinition, SceneObject, type SceneObjectDefinition, type SceneObjectDefinitionBase, type SceneObjectOptions, type SceneSkinDefinition, type SceneSkinPosePart, SceneStats, SceneStatsDisplay, SchematicParser, type SchematicParserOptions, SectionMesh, type SectionMeshEntry, type SectionMeshTemplate, SectionModels, type Serializable, type SkinGeometries, SkinImage, SkinObject, type SkinObjectOptions, SkinPart, type SkinTexture, type SkinTextureCoordinates, SkinTextures, Skins, type SpecialItemPart, type SpecialItemRenderer, SpecialItems, type StructureNBT, StructureParser, type TextureAsset, TextureAtlas, type TextureKey, TextureLoader, Textures, Ticker, type TickerFunction, TintColors, type Transformable, type TripleArray, UVMapper, WrappedImage, addBox3WireframeToObject, addWireframeToMesh, addWireframeToObject, applyElementRotation, applyGenericRotation, axisToVec3, base64decode, base64encode, capeTextureSizes, captureException, changeEvent, clampRotationDegrees, classicSkinGeometries, classicSkinTextureCoordinates, computeMorphedAttributes, createCanvas, createFluidGeometry, createGuiTextGeometry, createGuiTextureGeometry, createImage, entityAnimationTime, estimateBytesUsed, getBlockFluidState, getFluidKind, interleaveAttributes, isAssetKey, isBasicAssetKey, isBlockObject, isDisposable, isDoubleArray, isEntityObject, isGuiObject, isInstanceManager, isInstanceReference, isInstanceable, isInstancedMesh, isMesh, isMineRenderScene, isModelObject, isObject3D, isOrthographicCamera, isPerspectiveCamera, isQuadArray, isSceneObject, isTransformable, isTripleArray, isVector3, layoutGuiText, md5, mergeBufferAttributes, mergeBufferGeometries, mergeVertices, parseSceneDocument, prefix, probeImageSize, registerBrowserEnv, sampleEntityAnimation, sampleEntityKeyframes, sampleFluid, serializeBoxGeometryKey, serializeImageKey, serializeMaterialKey, serializeMeshKey, serializeTextureKey, sha1, sha256, sha512, shutdown, sleep, slimSkinGeometries, slimSkinTextureCoordinates, timingEnd, timingStart, toDegrees, toRadians, toTrianglesDrawMode, trimCanvas };
4121
+ 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 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, BrowserCache, BrowserEnv, 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, 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, OrbitControls, type PackFormat, PackFormats, PackMetadata, PersistentCache, PlayerHeadTextures, type PositionedGuiGlyph, type QuadArray, type RawImageKey, type RenderOptions, Renderer, type RendererControls, type RendererFrame, type RendererOptions, type RendererSurface, type RequestConfig, RequestError, type RequestResponse, Requests, type ResolvedBlockEntity, type ResolvedMineRenderData, type ResponseParser, SKIN_PARTS, 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, 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 WorldChunkSource, WorldStreamer, type WorldStreamerOptions, WrappedImage, addBox3WireframeToObject, addWireframeToMesh, addWireframeToObject, applyElementRotation, applyGenericRotation, axisToVec3, base64decode, base64encode, buildFluidQuads, buildSectionGeometry, capeTextureSizes, captureException, changeEvent, clampRotationDegrees, classicSkinGeometries, classicSkinTextureCoordinates, computeMorphedAttributes, createCanvas, createFluidGeometry, createGuiTextGeometry, createGuiTextureGeometry, createImage, 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, md5, mergeBufferAttributes, mergeBufferGeometries, mergeVertices, parseSceneDocument, prefix, probeImageSize, registerBrowserEnv, resolveBlockFluidState, resolveLegacyBlock, resolveLegacyBlockState, sampleEntityAnimation, sampleEntityKeyframes, sampleFluid, sectionGeometryTransferables, serializeBoxGeometryKey, serializeImageKey, serializeMaterialKey, serializeMeshKey, serializeTextureKey, sha1, sha256, sha512, shutdown, sleep, slimSkinGeometries, slimSkinTextureCoordinates, timingEnd, timingStart, toDegrees, toRadians, toTrianglesDrawMode, trimCanvas, yieldToEventLoop };