minerender 2.1.0-alpha.95 → 2.1.0-alpha.96
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/browser/index.d.mts +14 -1
- package/dist/browser/index.d.ts +14 -1
- package/dist/browser/index.js +105 -13
- package/dist/browser/index.js.map +1 -1
- package/dist/browser/index.mjs +105 -13
- package/dist/browser/index.mjs.map +1 -1
- package/dist/bundle.js +108 -13
- package/dist/bundle.js.map +1 -1
- package/dist/node/index.d.mts +14 -1
- package/dist/node/index.d.ts +14 -1
- package/dist/node/index.js +107 -13
- package/dist/node/index.js.map +1 -1
- package/dist/node/index.mjs +105 -13
- package/dist/node/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/browser/index.d.mts
CHANGED
|
@@ -222,6 +222,7 @@ declare class AssetKey extends BasicAssetKey {
|
|
|
222
222
|
/** Returns a cache identifier that includes the explicit root or {@link AssetLoader.ROOT}. */
|
|
223
223
|
serialize(): string;
|
|
224
224
|
}
|
|
225
|
+
declare function isResourceLocation(value: unknown): value is string;
|
|
225
226
|
declare function isBasicAssetKey(obj: any): obj is BasicAssetKey;
|
|
226
227
|
declare function isAssetKey(obj: any): obj is AssetKey;
|
|
227
228
|
|
|
@@ -598,6 +599,8 @@ type SpecialItemRenderer = {
|
|
|
598
599
|
color: DyeColor;
|
|
599
600
|
} | {
|
|
600
601
|
type: "shield" | "minecraft:shield";
|
|
602
|
+
} | {
|
|
603
|
+
type: "decorated_pot" | "minecraft:decorated_pot";
|
|
601
604
|
} | {
|
|
602
605
|
type: "trident" | "minecraft:trident" | "conduit" | "minecraft:conduit";
|
|
603
606
|
} | {
|
|
@@ -1139,6 +1142,13 @@ declare class DefaultBlockStates implements MinecraftAsset {
|
|
|
1139
1142
|
[k: string]: BlockStatePropertyDefaults;
|
|
1140
1143
|
}
|
|
1141
1144
|
|
|
1145
|
+
type DecoratedPotSide = "back" | "left" | "right" | "front";
|
|
1146
|
+
/** Resolves Minecraft 1.21.11 pot decorations to the four side textures. */
|
|
1147
|
+
declare class DecoratedPots {
|
|
1148
|
+
/** Reads up to four item IDs in back, left, right, front order; missing and unmapped items use plain sides. */
|
|
1149
|
+
static getSideTextures(value: unknown, root?: string): Record<DecoratedPotSide, AssetKey>;
|
|
1150
|
+
}
|
|
1151
|
+
|
|
1142
1152
|
/** `entity-models/animations/<namespace>/<model id>.json`: native and sampled vanilla animation clips. */
|
|
1143
1153
|
interface EntityAnimationFile extends MinecraftAsset {
|
|
1144
1154
|
id: string;
|
|
@@ -1349,6 +1359,7 @@ interface SpecialItemPart {
|
|
|
1349
1359
|
positions?: Record<string, TripleArray>;
|
|
1350
1360
|
/** Colors for the entity model's named texture passes. */
|
|
1351
1361
|
tints?: Record<string, number>;
|
|
1362
|
+
faces?: Record<string, CubeFace[]>;
|
|
1352
1363
|
}
|
|
1353
1364
|
/** Loads entity geometry and texture passes for supported special item previews. */
|
|
1354
1365
|
declare class SpecialItems {
|
|
@@ -1663,6 +1674,8 @@ interface EntityObjectOptions extends SceneObjectOptions {
|
|
|
1663
1674
|
flip?: boolean;
|
|
1664
1675
|
/** Colours for the dataset's tint labels, e.g. `{ wool_color: 0xf9801d }`; a pass whose label is absent stays untinted. */
|
|
1665
1676
|
tints?: Record<string, ColorRepresentation>;
|
|
1677
|
+
/** Cube faces by layer key; omitted layers draw all six faces. */
|
|
1678
|
+
faces?: Record<string, CubeFace[]>;
|
|
1666
1679
|
}
|
|
1667
1680
|
declare function isEntityObject(obj: any): obj is EntityObject;
|
|
1668
1681
|
|
|
@@ -3612,4 +3625,4 @@ declare class BrowserCache extends PersistentCache<LocalForage> {
|
|
|
3612
3625
|
*/
|
|
3613
3626
|
declare function probeImageSize(data: Uint8Array): ImageSizeInfo;
|
|
3614
3627
|
|
|
3615
|
-
export { AXES, type AnimationFrame, type AnimationMeta, type AnimatorFunction, type AnvilChunk, 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 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, LitematicaParser, type LitematicaRegion, type LitematicaStructure, 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, type SectionAtlasSize, 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, buildSectionGeometry, 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, resolveLegacyBlock, sampleEntityAnimation, sampleEntityKeyframes, sampleFluid, sectionGeometryTransferables, serializeBoxGeometryKey, serializeImageKey, serializeMaterialKey, serializeMeshKey, serializeTextureKey, sha1, sha256, sha512, shutdown, sleep, slimSkinGeometries, slimSkinTextureCoordinates, timingEnd, timingStart, toDegrees, toRadians, toTrianglesDrawMode, trimCanvas, yieldToEventLoop };
|
|
3628
|
+
export { AXES, type AnimationFrame, type AnimationMeta, type AnimatorFunction, type AnvilChunk, 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 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 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 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, LitematicaParser, type LitematicaRegion, type LitematicaStructure, 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, type SectionAtlasSize, 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, buildSectionGeometry, 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, isResourceLocation, isSceneObject, isTransformable, isTripleArray, isVector3, layoutGuiText, md5, mergeBufferAttributes, mergeBufferGeometries, mergeVertices, parseSceneDocument, prefix, probeImageSize, registerBrowserEnv, resolveLegacyBlock, sampleEntityAnimation, sampleEntityKeyframes, sampleFluid, sectionGeometryTransferables, serializeBoxGeometryKey, serializeImageKey, serializeMaterialKey, serializeMeshKey, serializeTextureKey, sha1, sha256, sha512, shutdown, sleep, slimSkinGeometries, slimSkinTextureCoordinates, timingEnd, timingStart, toDegrees, toRadians, toTrianglesDrawMode, trimCanvas, yieldToEventLoop };
|
package/dist/browser/index.d.ts
CHANGED
|
@@ -222,6 +222,7 @@ declare class AssetKey extends BasicAssetKey {
|
|
|
222
222
|
/** Returns a cache identifier that includes the explicit root or {@link AssetLoader.ROOT}. */
|
|
223
223
|
serialize(): string;
|
|
224
224
|
}
|
|
225
|
+
declare function isResourceLocation(value: unknown): value is string;
|
|
225
226
|
declare function isBasicAssetKey(obj: any): obj is BasicAssetKey;
|
|
226
227
|
declare function isAssetKey(obj: any): obj is AssetKey;
|
|
227
228
|
|
|
@@ -598,6 +599,8 @@ type SpecialItemRenderer = {
|
|
|
598
599
|
color: DyeColor;
|
|
599
600
|
} | {
|
|
600
601
|
type: "shield" | "minecraft:shield";
|
|
602
|
+
} | {
|
|
603
|
+
type: "decorated_pot" | "minecraft:decorated_pot";
|
|
601
604
|
} | {
|
|
602
605
|
type: "trident" | "minecraft:trident" | "conduit" | "minecraft:conduit";
|
|
603
606
|
} | {
|
|
@@ -1139,6 +1142,13 @@ declare class DefaultBlockStates implements MinecraftAsset {
|
|
|
1139
1142
|
[k: string]: BlockStatePropertyDefaults;
|
|
1140
1143
|
}
|
|
1141
1144
|
|
|
1145
|
+
type DecoratedPotSide = "back" | "left" | "right" | "front";
|
|
1146
|
+
/** Resolves Minecraft 1.21.11 pot decorations to the four side textures. */
|
|
1147
|
+
declare class DecoratedPots {
|
|
1148
|
+
/** Reads up to four item IDs in back, left, right, front order; missing and unmapped items use plain sides. */
|
|
1149
|
+
static getSideTextures(value: unknown, root?: string): Record<DecoratedPotSide, AssetKey>;
|
|
1150
|
+
}
|
|
1151
|
+
|
|
1142
1152
|
/** `entity-models/animations/<namespace>/<model id>.json`: native and sampled vanilla animation clips. */
|
|
1143
1153
|
interface EntityAnimationFile extends MinecraftAsset {
|
|
1144
1154
|
id: string;
|
|
@@ -1349,6 +1359,7 @@ interface SpecialItemPart {
|
|
|
1349
1359
|
positions?: Record<string, TripleArray>;
|
|
1350
1360
|
/** Colors for the entity model's named texture passes. */
|
|
1351
1361
|
tints?: Record<string, number>;
|
|
1362
|
+
faces?: Record<string, CubeFace[]>;
|
|
1352
1363
|
}
|
|
1353
1364
|
/** Loads entity geometry and texture passes for supported special item previews. */
|
|
1354
1365
|
declare class SpecialItems {
|
|
@@ -1663,6 +1674,8 @@ interface EntityObjectOptions extends SceneObjectOptions {
|
|
|
1663
1674
|
flip?: boolean;
|
|
1664
1675
|
/** Colours for the dataset's tint labels, e.g. `{ wool_color: 0xf9801d }`; a pass whose label is absent stays untinted. */
|
|
1665
1676
|
tints?: Record<string, ColorRepresentation>;
|
|
1677
|
+
/** Cube faces by layer key; omitted layers draw all six faces. */
|
|
1678
|
+
faces?: Record<string, CubeFace[]>;
|
|
1666
1679
|
}
|
|
1667
1680
|
declare function isEntityObject(obj: any): obj is EntityObject;
|
|
1668
1681
|
|
|
@@ -3612,4 +3625,4 @@ declare class BrowserCache extends PersistentCache<LocalForage> {
|
|
|
3612
3625
|
*/
|
|
3613
3626
|
declare function probeImageSize(data: Uint8Array): ImageSizeInfo;
|
|
3614
3627
|
|
|
3615
|
-
export { AXES, type AnimationFrame, type AnimationMeta, type AnimatorFunction, type AnvilChunk, 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 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, LitematicaParser, type LitematicaRegion, type LitematicaStructure, 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, type SectionAtlasSize, 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, buildSectionGeometry, 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, resolveLegacyBlock, sampleEntityAnimation, sampleEntityKeyframes, sampleFluid, sectionGeometryTransferables, serializeBoxGeometryKey, serializeImageKey, serializeMaterialKey, serializeMeshKey, serializeTextureKey, sha1, sha256, sha512, shutdown, sleep, slimSkinGeometries, slimSkinTextureCoordinates, timingEnd, timingStart, toDegrees, toRadians, toTrianglesDrawMode, trimCanvas, yieldToEventLoop };
|
|
3628
|
+
export { AXES, type AnimationFrame, type AnimationMeta, type AnimatorFunction, type AnvilChunk, 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 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 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 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, LitematicaParser, type LitematicaRegion, type LitematicaStructure, 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, type SectionAtlasSize, 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, buildSectionGeometry, 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, isResourceLocation, isSceneObject, isTransformable, isTripleArray, isVector3, layoutGuiText, md5, mergeBufferAttributes, mergeBufferGeometries, mergeVertices, parseSceneDocument, prefix, probeImageSize, registerBrowserEnv, resolveLegacyBlock, sampleEntityAnimation, sampleEntityKeyframes, sampleFluid, sectionGeometryTransferables, serializeBoxGeometryKey, serializeImageKey, serializeMaterialKey, serializeMeshKey, serializeTextureKey, sha1, sha256, sha512, shutdown, sleep, slimSkinGeometries, slimSkinTextureCoordinates, timingEnd, timingStart, toDegrees, toRadians, toTrianglesDrawMode, trimCanvas, yieldToEventLoop };
|
package/dist/browser/index.js
CHANGED
|
@@ -116,14 +116,14 @@ var init_Axis = __esm({
|
|
|
116
116
|
var CubeFace, CubeFaceIndex, CUBE_FACES, CUBE_FACE_OFFSETS;
|
|
117
117
|
var init_CubeFace = __esm({
|
|
118
118
|
"src/CubeFace.ts"() {
|
|
119
|
-
CubeFace = /* @__PURE__ */ ((
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
return
|
|
119
|
+
CubeFace = /* @__PURE__ */ ((CubeFace3) => {
|
|
120
|
+
CubeFace3["EAST"] = "east";
|
|
121
|
+
CubeFace3["WEST"] = "west";
|
|
122
|
+
CubeFace3["UP"] = "up";
|
|
123
|
+
CubeFace3["DOWN"] = "down";
|
|
124
|
+
CubeFace3["SOUTH"] = "south";
|
|
125
|
+
CubeFace3["NORTH"] = "north";
|
|
126
|
+
return CubeFace3;
|
|
127
127
|
})(CubeFace || {});
|
|
128
128
|
CubeFaceIndex = /* @__PURE__ */ ((CubeFaceIndex2) => {
|
|
129
129
|
CubeFaceIndex2[CubeFaceIndex2["EAST"] = 0] = "EAST";
|
|
@@ -1316,6 +1316,9 @@ var require_dist = __commonJS({
|
|
|
1316
1316
|
});
|
|
1317
1317
|
|
|
1318
1318
|
// src/assets/AssetKey.ts
|
|
1319
|
+
function isResourceLocation(value) {
|
|
1320
|
+
return typeof value === "string" && /^(?:[a-z0-9_.-]+:)?[a-z0-9_./-]+$/.test(value);
|
|
1321
|
+
}
|
|
1319
1322
|
function isBasicAssetKey(obj) {
|
|
1320
1323
|
return obj !== null && typeof obj === "object" && typeof obj.namespace === "string" && typeof obj.path === "string";
|
|
1321
1324
|
}
|
|
@@ -1702,7 +1705,7 @@ var init_Models = __esm({
|
|
|
1702
1705
|
return model ? restore(model) : void 0;
|
|
1703
1706
|
}
|
|
1704
1707
|
static contextIdentifier(id) {
|
|
1705
|
-
if (
|
|
1708
|
+
if (!isResourceLocation(id)) {
|
|
1706
1709
|
throw new Error(`Invalid item-preview identifier: ${id}`);
|
|
1707
1710
|
}
|
|
1708
1711
|
return id.includes(":") ? id : `minecraft:${id}`;
|
|
@@ -1847,6 +1850,8 @@ var init_Models = __esm({
|
|
|
1847
1850
|
case "minecraft:trident":
|
|
1848
1851
|
case "conduit":
|
|
1849
1852
|
case "minecraft:conduit":
|
|
1853
|
+
case "decorated_pot":
|
|
1854
|
+
case "minecraft:decorated_pot":
|
|
1850
1855
|
return { model: node.base, special };
|
|
1851
1856
|
case "shulker_box":
|
|
1852
1857
|
case "minecraft:shulker_box":
|
|
@@ -16201,6 +16206,55 @@ var init_MinecraftCubeTexture = __esm({
|
|
|
16201
16206
|
}
|
|
16202
16207
|
});
|
|
16203
16208
|
|
|
16209
|
+
// src/assets/DecoratedPots.ts
|
|
16210
|
+
var POTTERY_SHERDS, DecoratedPots;
|
|
16211
|
+
var init_DecoratedPots = __esm({
|
|
16212
|
+
"src/assets/DecoratedPots.ts"() {
|
|
16213
|
+
init_AssetKey();
|
|
16214
|
+
POTTERY_SHERDS = Object.freeze([
|
|
16215
|
+
"angler",
|
|
16216
|
+
"archer",
|
|
16217
|
+
"arms_up",
|
|
16218
|
+
"blade",
|
|
16219
|
+
"brewer",
|
|
16220
|
+
"burn",
|
|
16221
|
+
"danger",
|
|
16222
|
+
"explorer",
|
|
16223
|
+
"flow",
|
|
16224
|
+
"friend",
|
|
16225
|
+
"guster",
|
|
16226
|
+
"heart",
|
|
16227
|
+
"heartbreak",
|
|
16228
|
+
"howl",
|
|
16229
|
+
"miner",
|
|
16230
|
+
"mourner",
|
|
16231
|
+
"plenty",
|
|
16232
|
+
"prize",
|
|
16233
|
+
"scrape",
|
|
16234
|
+
"sheaf",
|
|
16235
|
+
"shelter",
|
|
16236
|
+
"skull",
|
|
16237
|
+
"snort"
|
|
16238
|
+
].map((pattern2) => `minecraft:${pattern2}_pottery_sherd`));
|
|
16239
|
+
DecoratedPots = class {
|
|
16240
|
+
/** Reads up to four item IDs in back, left, right, front order; missing and unmapped items use plain sides. */
|
|
16241
|
+
static getSideTextures(value, root) {
|
|
16242
|
+
const items = value === void 0 ? [] : value;
|
|
16243
|
+
if (!Array.isArray(items) || items.length > 4) throw new Error("pot_decorations must be an array of at most four item IDs");
|
|
16244
|
+
const textures = items.map((item) => {
|
|
16245
|
+
if (!isResourceLocation(item)) throw new Error("Pot decorations must be item identifiers");
|
|
16246
|
+
const id = item.includes(":") ? item : `minecraft:${item}`;
|
|
16247
|
+
return POTTERY_SHERDS.includes(id) ? id.slice("minecraft:".length).replace(/_sherd$/, "_pattern") : "decorated_pot_side";
|
|
16248
|
+
});
|
|
16249
|
+
return Object.fromEntries(["back", "left", "right", "front"].map((side, index) => [
|
|
16250
|
+
side,
|
|
16251
|
+
new AssetKey("minecraft", `decorated_pot/${textures[index] ?? "decorated_pot_side"}`, "textures", "entity", "assets", ".png", root)
|
|
16252
|
+
]));
|
|
16253
|
+
}
|
|
16254
|
+
};
|
|
16255
|
+
}
|
|
16256
|
+
});
|
|
16257
|
+
|
|
16204
16258
|
// src/error/MineRenderError.ts
|
|
16205
16259
|
var MineRenderError;
|
|
16206
16260
|
var init_MineRenderError = __esm({
|
|
@@ -17057,6 +17111,7 @@ var init_EntityObject = __esm({
|
|
|
17057
17111
|
init_AssetKey();
|
|
17058
17112
|
init_Materials();
|
|
17059
17113
|
init_MinecraftCubeTexture();
|
|
17114
|
+
init_CubeFace();
|
|
17060
17115
|
init_three();
|
|
17061
17116
|
init_EntityAnimationPlayer();
|
|
17062
17117
|
_EntityObject = class _EntityObject extends SceneObject {
|
|
@@ -17231,11 +17286,11 @@ var init_EntityObject = __esm({
|
|
|
17231
17286
|
const group = this.createGroup(`layer:${name}`);
|
|
17232
17287
|
modelRoot.add(group);
|
|
17233
17288
|
const inward = !Materials.entityModeCulls(layer.render ?? layer.layer.render);
|
|
17234
|
-
this.createPart("root", layer.layer.root, group, layer.layer.texture, Materials.MISSING_TEXTURE, index, inward);
|
|
17289
|
+
this.createPart("root", layer.layer.root, group, layer.layer.texture, Materials.MISSING_TEXTURE, index, inward, this.options.faces?.[name]);
|
|
17235
17290
|
});
|
|
17236
17291
|
this.meshesCreated = true;
|
|
17237
17292
|
}
|
|
17238
|
-
createPart(name, part, parent, textureSize, material, renderOrder, inward = true) {
|
|
17293
|
+
createPart(name, part, parent, textureSize, material, renderOrder, inward = true, faces) {
|
|
17239
17294
|
const anchor = this.createGroup(name);
|
|
17240
17295
|
anchor.position.fromArray(part.pose.offset);
|
|
17241
17296
|
anchor.rotation.set(...part.pose.rotation, "ZYX");
|
|
@@ -17256,6 +17311,10 @@ var init_EntityObject = __esm({
|
|
|
17256
17311
|
).clone();
|
|
17257
17312
|
this.geometries.add(geometry);
|
|
17258
17313
|
geometry.translate(cube.origin[0] + width / 2, cube.origin[1] + height / 2, cube.origin[2] + depth / 2);
|
|
17314
|
+
if (faces) {
|
|
17315
|
+
geometry.setIndex(Array.from(geometry.getIndex().array).filter((_, index) => faces.includes(CUBE_FACES[Math.floor(index / 6)])));
|
|
17316
|
+
geometry.clearGroups();
|
|
17317
|
+
}
|
|
17259
17318
|
if (inward && Math.min(width + growX * 2, height + growY * 2, depth + growZ * 2) > 0) {
|
|
17260
17319
|
const index = Array.from(geometry.getIndex().array);
|
|
17261
17320
|
geometry.setIndex(index.concat(index.slice().reverse()));
|
|
@@ -17266,7 +17325,7 @@ var init_EntityObject = __esm({
|
|
|
17266
17325
|
if (this.options.wireframe) this.disposeWireframes.push(addWireframeToMesh(geometry, mesh));
|
|
17267
17326
|
}
|
|
17268
17327
|
for (const [childName, child] of Object.entries(part.children)) {
|
|
17269
|
-
this.createPart(childName, child, anchor, size, material, renderOrder, inward);
|
|
17328
|
+
this.createPart(childName, child, anchor, size, material, renderOrder, inward, faces);
|
|
17270
17329
|
}
|
|
17271
17330
|
}
|
|
17272
17331
|
async applyTextures() {
|
|
@@ -17896,7 +17955,9 @@ var init_SpecialItems = __esm({
|
|
|
17896
17955
|
init_AssetKey();
|
|
17897
17956
|
init_Entities();
|
|
17898
17957
|
init_BannerPatterns();
|
|
17958
|
+
init_DecoratedPots();
|
|
17899
17959
|
init_ModelTextures();
|
|
17960
|
+
init_CubeFace();
|
|
17900
17961
|
SpecialItems = class {
|
|
17901
17962
|
/** Resolves the static entity parts drawn by a special item renderer, in model units. */
|
|
17902
17963
|
static async getParts(special, root, components = {}) {
|
|
@@ -17922,6 +17983,34 @@ var init_SpecialItems = __esm({
|
|
|
17922
17983
|
return { model, transform, rotations };
|
|
17923
17984
|
};
|
|
17924
17985
|
switch (special.type) {
|
|
17986
|
+
case "minecraft:decorated_pot":
|
|
17987
|
+
case "decorated_pot": {
|
|
17988
|
+
const sideTextures = DecoratedPots.getSideTextures(components["minecraft:pot_decorations"], root);
|
|
17989
|
+
const baseTexture = texture("decorated_pot_base", "decorated_pot");
|
|
17990
|
+
const [base, sides] = await Promise.all([
|
|
17991
|
+
load("decorated_pot_base", baseTexture, new import_three24.Matrix4()),
|
|
17992
|
+
load("decorated_pot_sides", texture("decorated_pot_side", "decorated_pot"), new import_three24.Matrix4())
|
|
17993
|
+
]);
|
|
17994
|
+
const layers = {
|
|
17995
|
+
base: { key: base.model.key, texture: baseTexture, layer: base.model.layer, render: "solid" }
|
|
17996
|
+
};
|
|
17997
|
+
for (const side of ["front", "back", "left", "right"]) {
|
|
17998
|
+
const part = sides.model.layer.root.children[side];
|
|
17999
|
+
if (!part) throw new Error(`Decorated-pot entity model is missing its ${side} side`);
|
|
18000
|
+
layers[side] = { key: sides.model.key, texture: sideTextures[side], render: "solid", layer: {
|
|
18001
|
+
...sides.model.layer,
|
|
18002
|
+
root: { ...sides.model.layer.root, cubes: [], children: {
|
|
18003
|
+
[side]: part
|
|
18004
|
+
} }
|
|
18005
|
+
} };
|
|
18006
|
+
}
|
|
18007
|
+
await Promise.all([...new Map(Object.values(layers).map((layer) => [layer.texture.serialize(), layer.texture])).values()].map(async (key) => {
|
|
18008
|
+
if (!await ModelTextures.preload(key)) throw new Error(`Missing special item texture ${key.toNamespacedString()}`);
|
|
18009
|
+
}));
|
|
18010
|
+
base.model = { ...base.model, ...layers.base, layers };
|
|
18011
|
+
base.faces = { front: ["north" /* NORTH */], back: ["north" /* NORTH */], left: ["north" /* NORTH */], right: ["north" /* NORTH */] };
|
|
18012
|
+
return [base];
|
|
18013
|
+
}
|
|
17925
18014
|
case "minecraft:trident":
|
|
17926
18015
|
case "trident":
|
|
17927
18016
|
case "minecraft:conduit":
|
|
@@ -18282,7 +18371,7 @@ var init_ModelObject = __esm({
|
|
|
18282
18371
|
transform.multiply(new import_three25.Matrix4().makeTranslation(-8, -8, -8));
|
|
18283
18372
|
try {
|
|
18284
18373
|
for (const part of parts2) {
|
|
18285
|
-
const object3 = new EntityObject(part.model, { flip: false, wireframe: this.options.wireframe, tints: part.tints });
|
|
18374
|
+
const object3 = new EntityObject(part.model, { flip: false, wireframe: this.options.wireframe, tints: part.tints, faces: part.faces });
|
|
18286
18375
|
object3.matrix.copy(transform).multiply(part.transform);
|
|
18287
18376
|
object3.matrixWorldNeedsUpdate = true;
|
|
18288
18377
|
object3.matrixAutoUpdate = false;
|
|
@@ -18763,6 +18852,7 @@ __export(index_browser_exports, {
|
|
|
18763
18852
|
DEFAULT_UV: () => DEFAULT_UV,
|
|
18764
18853
|
DISPLAY_POSITIONS: () => DISPLAY_POSITIONS,
|
|
18765
18854
|
DYE_COLORS: () => DYE_COLORS,
|
|
18855
|
+
DecoratedPots: () => DecoratedPots,
|
|
18766
18856
|
DefaultBlockStates: () => DefaultBlockStates,
|
|
18767
18857
|
DisplayPosition: () => DisplayPosition,
|
|
18768
18858
|
DisplayTransforms: () => DisplayTransforms,
|
|
@@ -18880,6 +18970,7 @@ __export(index_browser_exports, {
|
|
|
18880
18970
|
isOrthographicCamera: () => isOrthographicCamera,
|
|
18881
18971
|
isPerspectiveCamera: () => isPerspectiveCamera,
|
|
18882
18972
|
isQuadArray: () => isQuadArray,
|
|
18973
|
+
isResourceLocation: () => isResourceLocation,
|
|
18883
18974
|
isSceneObject: () => isSceneObject,
|
|
18884
18975
|
isTransformable: () => isTransformable,
|
|
18885
18976
|
isTripleArray: () => isTripleArray,
|
|
@@ -19170,6 +19261,7 @@ var BlockEntities = class {
|
|
|
19170
19261
|
|
|
19171
19262
|
// src/assets/index.ts
|
|
19172
19263
|
init_BlockStates();
|
|
19264
|
+
init_DecoratedPots();
|
|
19173
19265
|
init_Entities();
|
|
19174
19266
|
|
|
19175
19267
|
// src/assets/Fonts.ts
|