minerender 2.1.0-alpha.45 → 2.1.0-alpha.47
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 +7 -1
- package/dist/browser/index.d.ts +7 -1
- package/dist/browser/index.js +41 -5
- package/dist/browser/index.js.map +1 -1
- package/dist/browser/index.mjs +41 -5
- package/dist/browser/index.mjs.map +1 -1
- package/dist/bundle.js +41 -5
- package/dist/bundle.js.map +1 -1
- package/dist/node/index.d.mts +7 -1
- package/dist/node/index.d.ts +7 -1
- package/dist/node/index.js +42 -5
- package/dist/node/index.js.map +1 -1
- package/dist/node/index.mjs +41 -5
- package/dist/node/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/node/index.d.mts
CHANGED
|
@@ -1113,6 +1113,12 @@ declare class SceneObject extends Object3D<Object3DEventMap & {
|
|
|
1113
1113
|
declare function isSceneObject(obj: any): obj is SceneObject;
|
|
1114
1114
|
|
|
1115
1115
|
type FluidKind = "water" | "lava";
|
|
1116
|
+
interface BlockFluidState {
|
|
1117
|
+
kind: FluidKind;
|
|
1118
|
+
level: number;
|
|
1119
|
+
renderModel: boolean;
|
|
1120
|
+
}
|
|
1121
|
+
declare function getBlockFluidState(key?: AssetKey, state?: BlockStateProperties): BlockFluidState | undefined;
|
|
1116
1122
|
declare function getFluidKind(key?: AssetKey, state?: BlockStateProperties): FluidKind | undefined;
|
|
1117
1123
|
interface FluidSample {
|
|
1118
1124
|
fluid?: FluidKind;
|
|
@@ -1982,4 +1988,4 @@ declare class NodeCache extends PersistentCache<LocalStorage> {
|
|
|
1982
1988
|
forEach<T>(callback: (v: T, k: string) => void): Promise<void>;
|
|
1983
1989
|
}
|
|
1984
1990
|
|
|
1985
|
-
export { AXES, type AnimationFrame, type AnimationMeta, type AnimatorFunction, type AnvilChunk, AnvilParser, type AnvilRegion, ArchiveAssetSource, 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 Block, 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, 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, type ElementFace, type ElementRotation, Entities, type EntityLayer, type EntityModel, type EntityModelCube, type EntityModelFile, type EntityModelLayer, type EntityModelOptions, type EntityModelPart, EntityObject, type EntityObjectOptions, Env, type EnvProvider, type ExtractableImageData, type FluidKind, FluidModelObject, type FluidSample, type FluidSampler, type FromTo, Geometries, GuiLight, GuiObject, type GuiObjectOptions, HostedAssetSource, type IModelTextures, ITEM_GENERATED, type ImageInfo, ImageLoader, type ImageSizeInfo, InstanceManager, InstanceReference, type Instanceable, type ItemModel, type ItemModelTextures, type ListAsset, 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, PersistentCache, type QuadArray, type RawImageKey, type RenderOptions, Renderer, type RendererOptions, type RequestConfig, RequestError, type RequestResponse, Requests, type ResponseParser, SKIN_PARTS, SceneInspector, SceneObject, type SceneObjectOptions, SceneStats, SceneStatsDisplay, SchematicParser, SectionMesh, type SectionMeshEntry, type SectionMeshTemplate, SectionModels, type Serializable, type SkinGeometries, SkinImage, SkinObject, type SkinObjectOptions, SkinPart, type SkinTexture, type SkinTextureCoordinates, SkinTextures, Skins, 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, createImage, estimateBytesUsed, getFluidKind, interleaveAttributes, isAssetKey, isBasicAssetKey, isBlockObject, isDisposable, isDoubleArray, isEntityObject, isInstanceManager, isInstanceReference, isInstanceable, isInstancedMesh, isMesh, isMineRenderScene, isModelObject, isObject3D, isOrthographicCamera, isPerspectiveCamera, isQuadArray, isSceneObject, isTransformable, isTripleArray, isVector3, md5, mergeBufferAttributes, mergeBufferGeometries, mergeVertices, prefix, registerNodeEnv, sampleFluid, serializeBoxGeometryKey, serializeImageKey, serializeMaterialKey, serializeMeshKey, serializeTextureKey, sha1, sha256, sha512, shutdown, sleep, slimSkinGeometries, slimSkinTextureCoordinates, timingEnd, timingStart, toDegrees, toRadians, toTrianglesDrawMode };
|
|
1991
|
+
export { AXES, type AnimationFrame, type AnimationMeta, type AnimatorFunction, type AnvilChunk, AnvilParser, type AnvilRegion, ArchiveAssetSource, 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 Block, 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, 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, type ElementFace, type ElementRotation, Entities, type EntityLayer, type EntityModel, type EntityModelCube, type EntityModelFile, type EntityModelLayer, type EntityModelOptions, type EntityModelPart, EntityObject, type EntityObjectOptions, Env, type EnvProvider, type ExtractableImageData, type FluidKind, FluidModelObject, type FluidSample, type FluidSampler, type FromTo, Geometries, GuiLight, GuiObject, type GuiObjectOptions, HostedAssetSource, type IModelTextures, ITEM_GENERATED, type ImageInfo, ImageLoader, type ImageSizeInfo, InstanceManager, InstanceReference, type Instanceable, type ItemModel, type ItemModelTextures, type ListAsset, 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, PersistentCache, type QuadArray, type RawImageKey, type RenderOptions, Renderer, type RendererOptions, type RequestConfig, RequestError, type RequestResponse, Requests, type ResponseParser, SKIN_PARTS, SceneInspector, SceneObject, type SceneObjectOptions, SceneStats, SceneStatsDisplay, SchematicParser, SectionMesh, type SectionMeshEntry, type SectionMeshTemplate, SectionModels, type Serializable, type SkinGeometries, SkinImage, SkinObject, type SkinObjectOptions, SkinPart, type SkinTexture, type SkinTextureCoordinates, SkinTextures, Skins, 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, createImage, estimateBytesUsed, getBlockFluidState, getFluidKind, interleaveAttributes, isAssetKey, isBasicAssetKey, isBlockObject, isDisposable, isDoubleArray, isEntityObject, isInstanceManager, isInstanceReference, isInstanceable, isInstancedMesh, isMesh, isMineRenderScene, isModelObject, isObject3D, isOrthographicCamera, isPerspectiveCamera, isQuadArray, isSceneObject, isTransformable, isTripleArray, isVector3, md5, mergeBufferAttributes, mergeBufferGeometries, mergeVertices, prefix, registerNodeEnv, sampleFluid, serializeBoxGeometryKey, serializeImageKey, serializeMaterialKey, serializeMeshKey, serializeTextureKey, sha1, sha256, sha512, shutdown, sleep, slimSkinGeometries, slimSkinTextureCoordinates, timingEnd, timingStart, toDegrees, toRadians, toTrianglesDrawMode };
|
package/dist/node/index.d.ts
CHANGED
|
@@ -1113,6 +1113,12 @@ declare class SceneObject extends Object3D<Object3DEventMap & {
|
|
|
1113
1113
|
declare function isSceneObject(obj: any): obj is SceneObject;
|
|
1114
1114
|
|
|
1115
1115
|
type FluidKind = "water" | "lava";
|
|
1116
|
+
interface BlockFluidState {
|
|
1117
|
+
kind: FluidKind;
|
|
1118
|
+
level: number;
|
|
1119
|
+
renderModel: boolean;
|
|
1120
|
+
}
|
|
1121
|
+
declare function getBlockFluidState(key?: AssetKey, state?: BlockStateProperties): BlockFluidState | undefined;
|
|
1116
1122
|
declare function getFluidKind(key?: AssetKey, state?: BlockStateProperties): FluidKind | undefined;
|
|
1117
1123
|
interface FluidSample {
|
|
1118
1124
|
fluid?: FluidKind;
|
|
@@ -1982,4 +1988,4 @@ declare class NodeCache extends PersistentCache<LocalStorage> {
|
|
|
1982
1988
|
forEach<T>(callback: (v: T, k: string) => void): Promise<void>;
|
|
1983
1989
|
}
|
|
1984
1990
|
|
|
1985
|
-
export { AXES, type AnimationFrame, type AnimationMeta, type AnimatorFunction, type AnvilChunk, AnvilParser, type AnvilRegion, ArchiveAssetSource, 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 Block, 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, 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, type ElementFace, type ElementRotation, Entities, type EntityLayer, type EntityModel, type EntityModelCube, type EntityModelFile, type EntityModelLayer, type EntityModelOptions, type EntityModelPart, EntityObject, type EntityObjectOptions, Env, type EnvProvider, type ExtractableImageData, type FluidKind, FluidModelObject, type FluidSample, type FluidSampler, type FromTo, Geometries, GuiLight, GuiObject, type GuiObjectOptions, HostedAssetSource, type IModelTextures, ITEM_GENERATED, type ImageInfo, ImageLoader, type ImageSizeInfo, InstanceManager, InstanceReference, type Instanceable, type ItemModel, type ItemModelTextures, type ListAsset, 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, PersistentCache, type QuadArray, type RawImageKey, type RenderOptions, Renderer, type RendererOptions, type RequestConfig, RequestError, type RequestResponse, Requests, type ResponseParser, SKIN_PARTS, SceneInspector, SceneObject, type SceneObjectOptions, SceneStats, SceneStatsDisplay, SchematicParser, SectionMesh, type SectionMeshEntry, type SectionMeshTemplate, SectionModels, type Serializable, type SkinGeometries, SkinImage, SkinObject, type SkinObjectOptions, SkinPart, type SkinTexture, type SkinTextureCoordinates, SkinTextures, Skins, 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, createImage, estimateBytesUsed, getFluidKind, interleaveAttributes, isAssetKey, isBasicAssetKey, isBlockObject, isDisposable, isDoubleArray, isEntityObject, isInstanceManager, isInstanceReference, isInstanceable, isInstancedMesh, isMesh, isMineRenderScene, isModelObject, isObject3D, isOrthographicCamera, isPerspectiveCamera, isQuadArray, isSceneObject, isTransformable, isTripleArray, isVector3, md5, mergeBufferAttributes, mergeBufferGeometries, mergeVertices, prefix, registerNodeEnv, sampleFluid, serializeBoxGeometryKey, serializeImageKey, serializeMaterialKey, serializeMeshKey, serializeTextureKey, sha1, sha256, sha512, shutdown, sleep, slimSkinGeometries, slimSkinTextureCoordinates, timingEnd, timingStart, toDegrees, toRadians, toTrianglesDrawMode };
|
|
1991
|
+
export { AXES, type AnimationFrame, type AnimationMeta, type AnimatorFunction, type AnvilChunk, AnvilParser, type AnvilRegion, ArchiveAssetSource, 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 Block, 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, 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, type ElementFace, type ElementRotation, Entities, type EntityLayer, type EntityModel, type EntityModelCube, type EntityModelFile, type EntityModelLayer, type EntityModelOptions, type EntityModelPart, EntityObject, type EntityObjectOptions, Env, type EnvProvider, type ExtractableImageData, type FluidKind, FluidModelObject, type FluidSample, type FluidSampler, type FromTo, Geometries, GuiLight, GuiObject, type GuiObjectOptions, HostedAssetSource, type IModelTextures, ITEM_GENERATED, type ImageInfo, ImageLoader, type ImageSizeInfo, InstanceManager, InstanceReference, type Instanceable, type ItemModel, type ItemModelTextures, type ListAsset, 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, PersistentCache, type QuadArray, type RawImageKey, type RenderOptions, Renderer, type RendererOptions, type RequestConfig, RequestError, type RequestResponse, Requests, type ResponseParser, SKIN_PARTS, SceneInspector, SceneObject, type SceneObjectOptions, SceneStats, SceneStatsDisplay, SchematicParser, SectionMesh, type SectionMeshEntry, type SectionMeshTemplate, SectionModels, type Serializable, type SkinGeometries, SkinImage, SkinObject, type SkinObjectOptions, SkinPart, type SkinTexture, type SkinTextureCoordinates, SkinTextures, Skins, 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, createImage, estimateBytesUsed, getBlockFluidState, getFluidKind, interleaveAttributes, isAssetKey, isBasicAssetKey, isBlockObject, isDisposable, isDoubleArray, isEntityObject, isInstanceManager, isInstanceReference, isInstanceable, isInstancedMesh, isMesh, isMineRenderScene, isModelObject, isObject3D, isOrthographicCamera, isPerspectiveCamera, isQuadArray, isSceneObject, isTransformable, isTripleArray, isVector3, md5, mergeBufferAttributes, mergeBufferGeometries, mergeVertices, prefix, registerNodeEnv, sampleFluid, serializeBoxGeometryKey, serializeImageKey, serializeMaterialKey, serializeMeshKey, serializeTextureKey, sha1, sha256, sha512, shutdown, sleep, slimSkinGeometries, slimSkinTextureCoordinates, timingEnd, timingStart, toDegrees, toRadians, toTrianglesDrawMode };
|
package/dist/node/index.js
CHANGED
|
@@ -890,7 +890,12 @@ var init_Materials = __esm({
|
|
|
890
890
|
const vertShader = `
|
|
891
891
|
uniform bool SHADE;
|
|
892
892
|
|
|
893
|
+
// Keep MSAA edge pixels from sampling outside the face's atlas region.
|
|
894
|
+
#if __VERSION__ >= 300
|
|
895
|
+
centroid out vec2 vUv;
|
|
896
|
+
#else
|
|
893
897
|
varying vec2 vUv;
|
|
898
|
+
#endif
|
|
894
899
|
varying vec3 vTint;
|
|
895
900
|
varying float light;
|
|
896
901
|
varying float lift;
|
|
@@ -947,7 +952,11 @@ var init_Materials = __esm({
|
|
|
947
952
|
uniform bool EMISSIVE;
|
|
948
953
|
uniform float BRIGHTNESS;
|
|
949
954
|
|
|
955
|
+
#if __VERSION__ >= 300
|
|
956
|
+
centroid in vec2 vUv;
|
|
957
|
+
#else
|
|
950
958
|
varying vec2 vUv;
|
|
959
|
+
#endif
|
|
951
960
|
varying vec3 vTint;
|
|
952
961
|
varying float light;
|
|
953
962
|
varying float lift;
|
|
@@ -4213,10 +4222,34 @@ var init_ModelObject = __esm({
|
|
|
4213
4222
|
}
|
|
4214
4223
|
});
|
|
4215
4224
|
|
|
4225
|
+
// src/model/fluid/fluidBlocks.json
|
|
4226
|
+
var fluidBlocks_default;
|
|
4227
|
+
var init_fluidBlocks = __esm({
|
|
4228
|
+
"src/model/fluid/fluidBlocks.json"() {
|
|
4229
|
+
fluidBlocks_default = {
|
|
4230
|
+
"minecraft:water": { kind: "water", levelProperty: "level", renderModel: false },
|
|
4231
|
+
"minecraft:lava": { kind: "lava", levelProperty: "level", renderModel: false },
|
|
4232
|
+
"minecraft:kelp": { kind: "water", renderModel: true },
|
|
4233
|
+
"minecraft:kelp_plant": { kind: "water", renderModel: true },
|
|
4234
|
+
"minecraft:seagrass": { kind: "water", renderModel: true },
|
|
4235
|
+
"minecraft:tall_seagrass": { kind: "water", renderModel: true },
|
|
4236
|
+
"minecraft:bubble_column": { kind: "water", renderModel: false }
|
|
4237
|
+
};
|
|
4238
|
+
}
|
|
4239
|
+
});
|
|
4240
|
+
|
|
4216
4241
|
// src/model/fluid/FluidGeometry.ts
|
|
4242
|
+
function getBlockFluidState(key, state) {
|
|
4243
|
+
const rule = key && fluidRules[key.toNamespacedString()];
|
|
4244
|
+
if (rule) return {
|
|
4245
|
+
kind: rule.kind,
|
|
4246
|
+
level: rule.levelProperty ? Number(state?.[rule.levelProperty] ?? 0) : 0,
|
|
4247
|
+
renderModel: rule.renderModel
|
|
4248
|
+
};
|
|
4249
|
+
return state?.waterlogged === "true" ? { kind: "water", level: 0, renderModel: true } : void 0;
|
|
4250
|
+
}
|
|
4217
4251
|
function getFluidKind(key, state) {
|
|
4218
|
-
|
|
4219
|
-
return state?.waterlogged === "true" ? "water" : void 0;
|
|
4252
|
+
return getBlockFluidState(key, state)?.kind;
|
|
4220
4253
|
}
|
|
4221
4254
|
function ownHeight(sample) {
|
|
4222
4255
|
const level = sample.level ?? 0;
|
|
@@ -4328,10 +4361,12 @@ function createFluidGeometry(kind, sample) {
|
|
|
4328
4361
|
geometry.setIndex(indices);
|
|
4329
4362
|
return geometry;
|
|
4330
4363
|
}
|
|
4331
|
-
var import_three20, HORIZONTAL, EPSILON;
|
|
4364
|
+
var import_three20, fluidRules, HORIZONTAL, EPSILON;
|
|
4332
4365
|
var init_FluidGeometry = __esm({
|
|
4333
4366
|
"src/model/fluid/FluidGeometry.ts"() {
|
|
4334
4367
|
import_three20 = require("three");
|
|
4368
|
+
init_fluidBlocks();
|
|
4369
|
+
fluidRules = fluidBlocks_default;
|
|
4335
4370
|
HORIZONTAL = [[0, -1], [0, 1], [-1, 0], [1, 0]];
|
|
4336
4371
|
EPSILON = 1e-3;
|
|
4337
4372
|
}
|
|
@@ -4538,6 +4573,7 @@ __export(index_node_exports, {
|
|
|
4538
4573
|
createFluidGeometry: () => createFluidGeometry,
|
|
4539
4574
|
createImage: () => createImage,
|
|
4540
4575
|
estimateBytesUsed: () => estimateBytesUsed,
|
|
4576
|
+
getBlockFluidState: () => getBlockFluidState,
|
|
4541
4577
|
getFluidKind: () => getFluidKind,
|
|
4542
4578
|
interleaveAttributes: () => interleaveAttributes,
|
|
4543
4579
|
isAssetKey: () => isAssetKey,
|
|
@@ -5793,7 +5829,7 @@ var BlockObject = class _BlockObject extends SceneObject {
|
|
|
5793
5829
|
return getFluidKind(this.blockState.key, this.state);
|
|
5794
5830
|
}
|
|
5795
5831
|
get fluidLevel() {
|
|
5796
|
-
return
|
|
5832
|
+
return getBlockFluidState(this.blockState.key, this.state)?.level ?? 0;
|
|
5797
5833
|
}
|
|
5798
5834
|
/** Refreshes fluid surfaces from relative neighbors; standalone previews use air around the block. */
|
|
5799
5835
|
async updateFluid(sample) {
|
|
@@ -5835,7 +5871,7 @@ var BlockObject = class _BlockObject extends SceneObject {
|
|
|
5835
5871
|
}
|
|
5836
5872
|
async recreateModels() {
|
|
5837
5873
|
this.clearModels();
|
|
5838
|
-
if (
|
|
5874
|
+
if (getBlockFluidState(this.blockState.key, this.state)?.renderModel === false) {
|
|
5839
5875
|
await this.updateFluid(this._fluidSampler);
|
|
5840
5876
|
return;
|
|
5841
5877
|
}
|
|
@@ -11100,6 +11136,7 @@ var Chunk = class _Chunk {
|
|
|
11100
11136
|
createFluidGeometry,
|
|
11101
11137
|
createImage,
|
|
11102
11138
|
estimateBytesUsed,
|
|
11139
|
+
getBlockFluidState,
|
|
11103
11140
|
getFluidKind,
|
|
11104
11141
|
interleaveAttributes,
|
|
11105
11142
|
isAssetKey,
|