minerender 2.1.0-alpha.77 → 2.1.0-alpha.78

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.
@@ -2335,8 +2335,45 @@ declare class SceneExporter {
2335
2335
  static toGLTF(root: Object3D, options?: SceneGLTFExportOptions): Promise<Record<string, any> | ArrayBuffer>;
2336
2336
  }
2337
2337
 
2338
+ /** Container coordinates in GUI pixels. Crops refer to vanilla's 256×256 sheets; {@link GuiHelper.container} scales them for resource packs. */
2339
+ declare const GUI_CONTAINER_LAYOUTS: {
2340
+ readonly generic_54: {
2341
+ readonly texture: "minecraft:gui/container/generic_54";
2342
+ readonly crop: readonly [0, 0, 176, 222];
2343
+ readonly slotOrigin: readonly [8, 18];
2344
+ readonly slotOffset: readonly [18, 18];
2345
+ readonly rowSize: 9;
2346
+ readonly slotCount: 54;
2347
+ };
2348
+ readonly crafting_table: {
2349
+ readonly texture: "minecraft:gui/container/crafting_table";
2350
+ readonly crop: readonly [0, 0, 176, 166];
2351
+ readonly slotOrigin: readonly [30, 17];
2352
+ readonly slotOffset: readonly [18, 18];
2353
+ readonly rowSize: 3;
2354
+ readonly slotCount: 9;
2355
+ readonly resultPosition: readonly [124, 35];
2356
+ };
2357
+ };
2358
+ type GuiContainerType = keyof typeof GUI_CONTAINER_LAYOUTS;
2359
+ type GuiBossBarColor = "pink" | "blue" | "red" | "green" | "yellow" | "purple" | "white";
2360
+ type GuiBookButtonState = "hidden" | "normal" | "hover";
2338
2361
  /** Creates GUI positions and layer lists for {@link MineRenderScene.addGui}. */
2339
2362
  declare class GuiHelper {
2363
+ /**
2364
+ * Creates a 182×5 boss bar using the active resource pack. Finite progress is clamped to 0–1.
2365
+ * The fill crops the source image; explicit crops do not apply `.mcmeta` sprite scaling.
2366
+ */
2367
+ static bossBar(options?: GuiBossBarOptions): Promise<GuiLayer[]>;
2368
+ /**
2369
+ * Creates a 192×192 book page with optional arrows and supplied text. Buttons are hidden by default.
2370
+ * Callers choose the page content and button states; this helper does not paginate or handle clicks.
2371
+ */
2372
+ static book(options?: GuiBookOptions): Promise<GuiLayer[]>;
2373
+ /** Creates a container background. Use {@link GUI_CONTAINER_LAYOUTS} with {@link inventorySlot} to place its items. */
2374
+ static container(type: GuiContainerType, position?: [number, number]): Promise<GuiLayer[]>;
2375
+ private static validatePosition;
2376
+ private static cropTexture;
2340
2377
  /** Sizes a tooltip around supplied text; the first entry is its title. */
2341
2378
  static tooltip(lines: readonly GuiText[], options?: GuiTooltipOptions): Promise<GuiLayer[]>;
2342
2379
  /**
@@ -2346,10 +2383,28 @@ declare class GuiHelper {
2346
2383
  * @param offset - Horizontal and vertical spacing between slot origins, in pixels.
2347
2384
  * @param rowSize - Slots per row when `slot` is an index.
2348
2385
  */
2349
- static inventorySlot(slot: number | [number, number], origin?: [number, number], offset?: [number, number], rowSize?: number): [number, number];
2386
+ static inventorySlot(slot: number | readonly [number, number], origin?: readonly [number, number], offset?: readonly [number, number], rowSize?: number): [number, number];
2350
2387
  /** Creates crafting-table layers for ingredients and the result; stack counts are not drawn. */
2351
2388
  static recipe(recipe: GuiRecipe, options?: GuiRecipeOptions): GuiLayer[];
2352
2389
  }
2390
+ /** Settings passed to {@link GuiHelper.bossBar}. */
2391
+ interface GuiBossBarOptions {
2392
+ /** Vanilla sprite color. Defaults to `pink`. */
2393
+ color?: GuiBossBarColor;
2394
+ /** Fill from 0 to 1, rounded to vanilla's discrete pixel width. Defaults to 1. */
2395
+ progress?: number;
2396
+ /** Top-left position in GUI pixels. Defaults to `[0, 0]`. */
2397
+ position?: [number, number];
2398
+ }
2399
+ /** Settings passed to {@link GuiHelper.book}. Text defaults to black, unshadowed, and wrapped at 114 pixels. */
2400
+ interface GuiBookOptions extends GuiTextOptions {
2401
+ /** Top-left position of the book background in GUI pixels. Defaults to `[0, 0]`. */
2402
+ position?: [number, number];
2403
+ previous?: GuiBookButtonState;
2404
+ next?: GuiBookButtonState;
2405
+ /** Content for one page. The caller keeps it within the 128-pixel text height. */
2406
+ text?: GuiText;
2407
+ }
2353
2408
  /** Settings passed to {@link GuiHelper.tooltip}. Its default `lineHeight` is 10 GUI pixels. */
2354
2409
  interface GuiTooltipOptions extends GuiTextOptions {
2355
2410
  /** Top-left text position, inside the tooltip's padding. */
@@ -3158,4 +3213,4 @@ declare class NodeCache extends PersistentCache<LocalStorage> {
3158
3213
  forEach<T>(callback: (v: T, k: string) => void): Promise<void>;
3159
3214
  }
3160
3215
 
3161
- 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, 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, 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, type DebugOptions, type DeepPartial, DefaultBlockStates, DisplayPosition, DisplayTransforms, type Disposable, type DoubleArray, 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, Geometries, 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 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, NodeCache, NodeEnv, 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, registerNodeEnv, sampleEntityAnimation, sampleEntityKeyframes, sampleFluid, serializeBoxGeometryKey, serializeImageKey, serializeMaterialKey, serializeMeshKey, serializeTextureKey, sha1, sha256, sha512, shutdown, sleep, slimSkinGeometries, slimSkinTextureCoordinates, timingEnd, timingStart, toDegrees, toRadians, toTrianglesDrawMode, trimCanvas };
3216
+ 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, 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, 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, type DebugOptions, type DeepPartial, DefaultBlockStates, DisplayPosition, DisplayTransforms, type Disposable, type DoubleArray, 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 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, NodeCache, NodeEnv, 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, registerNodeEnv, sampleEntityAnimation, sampleEntityKeyframes, sampleFluid, serializeBoxGeometryKey, serializeImageKey, serializeMaterialKey, serializeMeshKey, serializeTextureKey, sha1, sha256, sha512, shutdown, sleep, slimSkinGeometries, slimSkinTextureCoordinates, timingEnd, timingStart, toDegrees, toRadians, toTrianglesDrawMode, trimCanvas };
@@ -2335,8 +2335,45 @@ declare class SceneExporter {
2335
2335
  static toGLTF(root: Object3D, options?: SceneGLTFExportOptions): Promise<Record<string, any> | ArrayBuffer>;
2336
2336
  }
2337
2337
 
2338
+ /** Container coordinates in GUI pixels. Crops refer to vanilla's 256×256 sheets; {@link GuiHelper.container} scales them for resource packs. */
2339
+ declare const GUI_CONTAINER_LAYOUTS: {
2340
+ readonly generic_54: {
2341
+ readonly texture: "minecraft:gui/container/generic_54";
2342
+ readonly crop: readonly [0, 0, 176, 222];
2343
+ readonly slotOrigin: readonly [8, 18];
2344
+ readonly slotOffset: readonly [18, 18];
2345
+ readonly rowSize: 9;
2346
+ readonly slotCount: 54;
2347
+ };
2348
+ readonly crafting_table: {
2349
+ readonly texture: "minecraft:gui/container/crafting_table";
2350
+ readonly crop: readonly [0, 0, 176, 166];
2351
+ readonly slotOrigin: readonly [30, 17];
2352
+ readonly slotOffset: readonly [18, 18];
2353
+ readonly rowSize: 3;
2354
+ readonly slotCount: 9;
2355
+ readonly resultPosition: readonly [124, 35];
2356
+ };
2357
+ };
2358
+ type GuiContainerType = keyof typeof GUI_CONTAINER_LAYOUTS;
2359
+ type GuiBossBarColor = "pink" | "blue" | "red" | "green" | "yellow" | "purple" | "white";
2360
+ type GuiBookButtonState = "hidden" | "normal" | "hover";
2338
2361
  /** Creates GUI positions and layer lists for {@link MineRenderScene.addGui}. */
2339
2362
  declare class GuiHelper {
2363
+ /**
2364
+ * Creates a 182×5 boss bar using the active resource pack. Finite progress is clamped to 0–1.
2365
+ * The fill crops the source image; explicit crops do not apply `.mcmeta` sprite scaling.
2366
+ */
2367
+ static bossBar(options?: GuiBossBarOptions): Promise<GuiLayer[]>;
2368
+ /**
2369
+ * Creates a 192×192 book page with optional arrows and supplied text. Buttons are hidden by default.
2370
+ * Callers choose the page content and button states; this helper does not paginate or handle clicks.
2371
+ */
2372
+ static book(options?: GuiBookOptions): Promise<GuiLayer[]>;
2373
+ /** Creates a container background. Use {@link GUI_CONTAINER_LAYOUTS} with {@link inventorySlot} to place its items. */
2374
+ static container(type: GuiContainerType, position?: [number, number]): Promise<GuiLayer[]>;
2375
+ private static validatePosition;
2376
+ private static cropTexture;
2340
2377
  /** Sizes a tooltip around supplied text; the first entry is its title. */
2341
2378
  static tooltip(lines: readonly GuiText[], options?: GuiTooltipOptions): Promise<GuiLayer[]>;
2342
2379
  /**
@@ -2346,10 +2383,28 @@ declare class GuiHelper {
2346
2383
  * @param offset - Horizontal and vertical spacing between slot origins, in pixels.
2347
2384
  * @param rowSize - Slots per row when `slot` is an index.
2348
2385
  */
2349
- static inventorySlot(slot: number | [number, number], origin?: [number, number], offset?: [number, number], rowSize?: number): [number, number];
2386
+ static inventorySlot(slot: number | readonly [number, number], origin?: readonly [number, number], offset?: readonly [number, number], rowSize?: number): [number, number];
2350
2387
  /** Creates crafting-table layers for ingredients and the result; stack counts are not drawn. */
2351
2388
  static recipe(recipe: GuiRecipe, options?: GuiRecipeOptions): GuiLayer[];
2352
2389
  }
2390
+ /** Settings passed to {@link GuiHelper.bossBar}. */
2391
+ interface GuiBossBarOptions {
2392
+ /** Vanilla sprite color. Defaults to `pink`. */
2393
+ color?: GuiBossBarColor;
2394
+ /** Fill from 0 to 1, rounded to vanilla's discrete pixel width. Defaults to 1. */
2395
+ progress?: number;
2396
+ /** Top-left position in GUI pixels. Defaults to `[0, 0]`. */
2397
+ position?: [number, number];
2398
+ }
2399
+ /** Settings passed to {@link GuiHelper.book}. Text defaults to black, unshadowed, and wrapped at 114 pixels. */
2400
+ interface GuiBookOptions extends GuiTextOptions {
2401
+ /** Top-left position of the book background in GUI pixels. Defaults to `[0, 0]`. */
2402
+ position?: [number, number];
2403
+ previous?: GuiBookButtonState;
2404
+ next?: GuiBookButtonState;
2405
+ /** Content for one page. The caller keeps it within the 128-pixel text height. */
2406
+ text?: GuiText;
2407
+ }
2353
2408
  /** Settings passed to {@link GuiHelper.tooltip}. Its default `lineHeight` is 10 GUI pixels. */
2354
2409
  interface GuiTooltipOptions extends GuiTextOptions {
2355
2410
  /** Top-left text position, inside the tooltip's padding. */
@@ -3158,4 +3213,4 @@ declare class NodeCache extends PersistentCache<LocalStorage> {
3158
3213
  forEach<T>(callback: (v: T, k: string) => void): Promise<void>;
3159
3214
  }
3160
3215
 
3161
- 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, 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, 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, type DebugOptions, type DeepPartial, DefaultBlockStates, DisplayPosition, DisplayTransforms, type Disposable, type DoubleArray, 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, Geometries, 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 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, NodeCache, NodeEnv, 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, registerNodeEnv, sampleEntityAnimation, sampleEntityKeyframes, sampleFluid, serializeBoxGeometryKey, serializeImageKey, serializeMaterialKey, serializeMeshKey, serializeTextureKey, sha1, sha256, sha512, shutdown, sleep, slimSkinGeometries, slimSkinTextureCoordinates, timingEnd, timingStart, toDegrees, toRadians, toTrianglesDrawMode, trimCanvas };
3216
+ 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, 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, 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, type DebugOptions, type DeepPartial, DefaultBlockStates, DisplayPosition, DisplayTransforms, type Disposable, type DoubleArray, 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 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, NodeCache, NodeEnv, 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, registerNodeEnv, sampleEntityAnimation, sampleEntityKeyframes, sampleFluid, serializeBoxGeometryKey, serializeImageKey, serializeMaterialKey, serializeMeshKey, serializeTextureKey, sha1, sha256, sha512, shutdown, sleep, slimSkinGeometries, slimSkinTextureCoordinates, timingEnd, timingStart, toDegrees, toRadians, toTrianglesDrawMode, trimCanvas };
@@ -6060,6 +6060,7 @@ __export(index_node_exports, {
6060
6060
  Env: () => Env,
6061
6061
  FluidModelObject: () => FluidModelObject,
6062
6062
  Fonts: () => Fonts,
6063
+ GUI_CONTAINER_LAYOUTS: () => GUI_CONTAINER_LAYOUTS,
6063
6064
  Geometries: () => Geometries,
6064
6065
  GuiHelper: () => GuiHelper,
6065
6066
  GuiLight: () => GuiLight,
@@ -9454,6 +9455,7 @@ function copyDataTexture(source) {
9454
9455
 
9455
9456
  // src/gui/GuiHelper.ts
9456
9457
  init_AssetKey();
9458
+ init_ModelTextures();
9457
9459
 
9458
9460
  // src/gui/GuiText.ts
9459
9461
  var import_three20 = require("three");
@@ -9563,7 +9565,128 @@ function createGuiTextGeometry(layout, shadow = true) {
9563
9565
  }
9564
9566
 
9565
9567
  // src/gui/GuiHelper.ts
9568
+ var GUI_CONTAINER_LAYOUTS = {
9569
+ generic_54: {
9570
+ texture: "minecraft:gui/container/generic_54",
9571
+ crop: [0, 0, 176, 222],
9572
+ slotOrigin: [8, 18],
9573
+ slotOffset: [18, 18],
9574
+ rowSize: 9,
9575
+ slotCount: 54
9576
+ },
9577
+ crafting_table: {
9578
+ texture: "minecraft:gui/container/crafting_table",
9579
+ crop: [0, 0, 176, 166],
9580
+ slotOrigin: [30, 17],
9581
+ slotOffset: [18, 18],
9582
+ rowSize: 3,
9583
+ slotCount: 9,
9584
+ resultPosition: [124, 35]
9585
+ }
9586
+ };
9566
9587
  var GuiHelper = class {
9588
+ /**
9589
+ * Creates a 182×5 boss bar using the active resource pack. Finite progress is clamped to 0–1.
9590
+ * The fill crops the source image; explicit crops do not apply `.mcmeta` sprite scaling.
9591
+ */
9592
+ static async bossBar(options = {}) {
9593
+ const { color: color2 = "pink", progress = 1, position = [0, 0] } = options;
9594
+ this.validatePosition(position);
9595
+ if (!["pink", "blue", "red", "green", "yellow", "purple", "white"].includes(color2)) {
9596
+ throw new Error(`Unsupported boss bar color: ${color2}`);
9597
+ }
9598
+ if (!Number.isFinite(progress)) throw new Error("Boss bar progress must be finite");
9599
+ const value = Math.max(0, Math.min(1, progress));
9600
+ const width = value > 0 ? Math.floor(value * 181) + 1 : 0;
9601
+ const texture = `minecraft:gui/sprites/boss_bar/${color2}`;
9602
+ const layers = [{
9603
+ name: "boss-bar-background",
9604
+ texture: `${texture}_background`,
9605
+ position: [...position],
9606
+ size: [182, 5]
9607
+ }];
9608
+ if (width > 0) {
9609
+ layers.push({
9610
+ ...await this.cropTexture(`${texture}_progress`, [0, 0, width, 5], [182, 5], position),
9611
+ name: "boss-bar-progress"
9612
+ });
9613
+ }
9614
+ return layers;
9615
+ }
9616
+ /**
9617
+ * Creates a 192×192 book page with optional arrows and supplied text. Buttons are hidden by default.
9618
+ * Callers choose the page content and button states; this helper does not paginate or handle clicks.
9619
+ */
9620
+ static async book(options = {}) {
9621
+ const {
9622
+ position = [0, 0],
9623
+ previous = "hidden",
9624
+ next = "hidden",
9625
+ text: text2,
9626
+ color: color2 = 0,
9627
+ shadow = false,
9628
+ maxWidth = 114,
9629
+ lineHeight = 9,
9630
+ ...style
9631
+ } = options;
9632
+ this.validatePosition(position);
9633
+ for (const state of [previous, next]) {
9634
+ if (!["hidden", "normal", "hover"].includes(state)) throw new Error(`Unsupported book button state: ${state}`);
9635
+ }
9636
+ const layers = [{
9637
+ ...await this.cropTexture("minecraft:gui/book", [0, 0, 192, 192], [256, 256], position),
9638
+ name: "book-background"
9639
+ }];
9640
+ for (const [name, direction, state, x] of [
9641
+ ["previous", "backward", previous, 43],
9642
+ ["next", "forward", next, 116]
9643
+ ]) {
9644
+ if (state === "hidden") continue;
9645
+ layers.push({
9646
+ name: `book-${name}`,
9647
+ texture: `minecraft:gui/sprites/widget/page_${direction}${state === "hover" ? "_highlighted" : ""}`,
9648
+ position: [position[0] + x, position[1] + 157],
9649
+ size: [23, 13]
9650
+ });
9651
+ }
9652
+ if (text2 !== void 0) {
9653
+ layers.push({
9654
+ name: "book-text",
9655
+ text: text2,
9656
+ position: [position[0] + 36, position[1] + 30],
9657
+ color: color2,
9658
+ shadow,
9659
+ maxWidth,
9660
+ lineHeight,
9661
+ ...style
9662
+ });
9663
+ }
9664
+ return layers;
9665
+ }
9666
+ /** Creates a container background. Use {@link GUI_CONTAINER_LAYOUTS} with {@link inventorySlot} to place its items. */
9667
+ static async container(type, position = [0, 0]) {
9668
+ this.validatePosition(position);
9669
+ if (type !== "generic_54" && type !== "crafting_table") throw new Error(`Unsupported GUI container: ${type}`);
9670
+ const layout = GUI_CONTAINER_LAYOUTS[type];
9671
+ return [{ ...await this.cropTexture(layout.texture, layout.crop, [256, 256], position), name: "background" }];
9672
+ }
9673
+ static validatePosition(position) {
9674
+ if (!Array.isArray(position) || position.length !== 2 || !position.every(Number.isFinite)) {
9675
+ throw new Error("GUI position must contain two finite coordinates");
9676
+ }
9677
+ }
9678
+ static async cropTexture(texture, crop, referenceSize, position) {
9679
+ const image = await ModelTextures.preload(AssetKey.parse("textures", texture));
9680
+ if (!image) throw new Error(`Could not load GUI texture ${texture}`);
9681
+ const [x, y, width, height] = crop;
9682
+ const scaleX = image.width / referenceSize[0], scaleY = image.height / referenceSize[1];
9683
+ return {
9684
+ texture,
9685
+ crop: [x * scaleX, y * scaleY, width * scaleX, height * scaleY],
9686
+ position: [...position],
9687
+ size: [width, height]
9688
+ };
9689
+ }
9567
9690
  /** Sizes a tooltip around supplied text; the first entry is its title. */
9568
9691
  static async tooltip(lines, options = {}) {
9569
9692
  if (!lines.length) return [];
@@ -9598,8 +9721,9 @@ var GuiHelper = class {
9598
9721
  }
9599
9722
  /** Creates crafting-table layers for ingredients and the result; stack counts are not drawn. */
9600
9723
  static recipe(recipe, options = {}) {
9724
+ const layout = GUI_CONTAINER_LAYOUTS.crafting_table;
9601
9725
  const layers = [
9602
- { name: "background", texture: "minecraft:gui/container/crafting_table", crop: [0, 0, 176, 166] }
9726
+ { name: "background", texture: layout.texture, crop: [...layout.crop] }
9603
9727
  ];
9604
9728
  const itemKey = (ingredient) => {
9605
9729
  const item = typeof ingredient === "string" && !ingredient.startsWith("#") ? ingredient : typeof ingredient === "object" && "item" in ingredient ? ingredient.item : options.resolveIngredient?.(ingredient);
@@ -9614,7 +9738,7 @@ var GuiHelper = class {
9614
9738
  layers.push({
9615
9739
  name: `ingredient-${slot}`,
9616
9740
  item: itemKey(ingredient),
9617
- position: this.inventorySlot(slot, [30, 17], [18, 18], 3)
9741
+ position: this.inventorySlot(slot, layout.slotOrigin, layout.slotOffset, layout.rowSize)
9618
9742
  });
9619
9743
  };
9620
9744
  switch (recipe.type) {
@@ -9649,7 +9773,7 @@ var GuiHelper = class {
9649
9773
  layers.push({
9650
9774
  name: "result",
9651
9775
  item: itemKey("id" in recipe.result ? recipe.result.id : recipe.result.item),
9652
- position: [124, 35]
9776
+ position: [...layout.resultPosition]
9653
9777
  });
9654
9778
  return layers;
9655
9779
  }
@@ -16621,6 +16745,7 @@ var Chunk = class _Chunk {
16621
16745
  Env,
16622
16746
  FluidModelObject,
16623
16747
  Fonts,
16748
+ GUI_CONTAINER_LAYOUTS,
16624
16749
  Geometries,
16625
16750
  GuiHelper,
16626
16751
  GuiLight,