From 1fd9a29192cd4e6670a27425dc754ae4b7ee2277 Mon Sep 17 00:00:00 2001 From: Vitaly Turovsky Date: Sat, 3 May 2025 23:01:47 +0300 Subject: [PATCH 1/4] up mouse & chunk --- package.json | 2 +- pnpm-lock.yaml | 30 +++++++++++++++--------------- 2 files changed, 16 insertions(+), 16 deletions(-) diff --git a/package.json b/package.json index c3939647..16f009f0 100644 --- a/package.json +++ b/package.json @@ -153,7 +153,7 @@ "mc-assets": "^0.2.53", "minecraft-inventory-gui": "github:zardoy/minecraft-inventory-gui#next", "mineflayer": "github:zardoy/mineflayer#gen-the-master", - "mineflayer-mouse": "^0.1.9", + "mineflayer-mouse": "^0.1.10", "mineflayer-pathfinder": "^2.4.4", "npm-run-all": "^4.1.5", "os-browserify": "^0.3.0", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 9dbe20b2..f099a85f 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -343,8 +343,8 @@ importers: specifier: github:zardoy/mineflayer#gen-the-master version: https://codeload.github.com/zardoy/mineflayer/tar.gz/5602eca4174c0aff079e60234d7c68327eeb6fe6(encoding@0.1.13) mineflayer-mouse: - specifier: ^0.1.9 - version: 0.1.9(@types/debug@4.1.12)(@types/node@22.13.9)(jiti@2.4.2)(terser@5.39.0)(tsx@4.19.3)(yaml@2.7.0) + specifier: ^0.1.10 + version: 0.1.10(@types/debug@4.1.12)(@types/node@22.13.9)(jiti@2.4.2)(terser@5.39.0)(tsx@4.19.3)(yaml@2.7.0) mineflayer-pathfinder: specifier: ^2.4.4 version: 2.4.5 @@ -435,7 +435,7 @@ importers: version: https://codeload.github.com/zardoy/prismarine-block/tar.gz/853c559bff2b402863ee9a75b125a3ca320838f9 prismarine-chunk: specifier: github:zardoy/prismarine-chunk#master - version: https://codeload.github.com/zardoy/prismarine-chunk/tar.gz/47e0e5b7ff7759b8d222de7746f71023df7ce8e5(minecraft-data@3.83.1) + version: https://codeload.github.com/zardoy/prismarine-chunk/tar.gz/c5feac83b61d95feb4d4f22c063dacfb8c192a9f(minecraft-data@3.83.1) prismarine-schematic: specifier: ^1.2.0 version: 1.2.3 @@ -6704,8 +6704,8 @@ packages: resolution: {tarball: https://codeload.github.com/zardoy/mineflayer-item-map-downloader/tar.gz/a8d210ecdcf78dd082fa149a96e1612cc9747824} version: 1.2.0 - mineflayer-mouse@0.1.9: - resolution: {integrity: sha512-Cl+0FDUKFt8f+W6ed3XWfadWqbJkhl999XNPBkiaP0QwxAcJC7f+iAMiH1SLB+e5p50GLxANhAs6Q7t9d37kTg==} + mineflayer-mouse@0.1.10: + resolution: {integrity: sha512-bxrBzOVQX2Ok5KOiJMaoOLYaHMDecMkJpLn5oGIdyLRqiTF3WAnZc9oYQq+/f3YNA88W1vBIjai3v3vZe6wyaQ==} engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0} mineflayer-pathfinder@2.4.5: @@ -7425,8 +7425,8 @@ packages: prismarine-chat@1.11.0: resolution: {integrity: sha512-VJT/MWYB3qoiznUhrgvSQh76YFpzpCZpY85kJKxHLbd3UVoM0wsfs43Eg8dOltiZG92wc5/DTMLlT07TEeoa9w==} - prismarine-chunk@https://codeload.github.com/zardoy/prismarine-chunk/tar.gz/47e0e5b7ff7759b8d222de7746f71023df7ce8e5: - resolution: {tarball: https://codeload.github.com/zardoy/prismarine-chunk/tar.gz/47e0e5b7ff7759b8d222de7746f71023df7ce8e5} + prismarine-chunk@https://codeload.github.com/zardoy/prismarine-chunk/tar.gz/c5feac83b61d95feb4d4f22c063dacfb8c192a9f: + resolution: {tarball: https://codeload.github.com/zardoy/prismarine-chunk/tar.gz/c5feac83b61d95feb4d4f22c063dacfb8c192a9f} version: 1.38.1 engines: {node: '>=14'} @@ -13194,7 +13194,7 @@ snapshots: mkdirp: 2.1.6 node-gzip: 1.1.2 node-rsa: 1.1.1 - prismarine-chunk: https://codeload.github.com/zardoy/prismarine-chunk/tar.gz/47e0e5b7ff7759b8d222de7746f71023df7ce8e5(minecraft-data@3.83.1) + prismarine-chunk: https://codeload.github.com/zardoy/prismarine-chunk/tar.gz/c5feac83b61d95feb4d4f22c063dacfb8c192a9f(minecraft-data@3.83.1) prismarine-entity: 2.5.0 prismarine-item: 1.16.0 prismarine-nbt: 2.7.0 @@ -13230,7 +13230,7 @@ snapshots: mkdirp: 2.1.6 node-gzip: 1.1.2 node-rsa: 1.1.1 - prismarine-chunk: https://codeload.github.com/zardoy/prismarine-chunk/tar.gz/47e0e5b7ff7759b8d222de7746f71023df7ce8e5(minecraft-data@3.83.1) + prismarine-chunk: https://codeload.github.com/zardoy/prismarine-chunk/tar.gz/c5feac83b61d95feb4d4f22c063dacfb8c192a9f(minecraft-data@3.83.1) prismarine-entity: 2.5.0 prismarine-item: 1.16.0 prismarine-nbt: 2.7.0 @@ -14625,7 +14625,7 @@ snapshots: diamond-square@https://codeload.github.com/zardoy/diamond-square/tar.gz/cfaad2d1d5909fdfa63c8cc7bc05fb5e87782d71: dependencies: minecraft-data: 3.83.1 - prismarine-chunk: https://codeload.github.com/zardoy/prismarine-chunk/tar.gz/47e0e5b7ff7759b8d222de7746f71023df7ce8e5(minecraft-data@3.83.1) + prismarine-chunk: https://codeload.github.com/zardoy/prismarine-chunk/tar.gz/c5feac83b61d95feb4d4f22c063dacfb8c192a9f(minecraft-data@3.83.1) prismarine-registry: 1.11.0 random-seed: 0.3.0 vec3: 0.1.10 @@ -17400,7 +17400,7 @@ snapshots: - encoding - supports-color - mineflayer-mouse@0.1.9(@types/debug@4.1.12)(@types/node@22.13.9)(jiti@2.4.2)(terser@5.39.0)(tsx@4.19.3)(yaml@2.7.0): + mineflayer-mouse@0.1.10(@types/debug@4.1.12)(@types/node@22.13.9)(jiti@2.4.2)(terser@5.39.0)(tsx@4.19.3)(yaml@2.7.0): dependencies: change-case: 5.4.4 debug: 4.4.0(supports-color@8.1.1) @@ -17445,7 +17445,7 @@ snapshots: prismarine-biome: 1.3.0(minecraft-data@3.83.1)(prismarine-registry@1.11.0) prismarine-block: https://codeload.github.com/zardoy/prismarine-block/tar.gz/853c559bff2b402863ee9a75b125a3ca320838f9 prismarine-chat: 1.11.0 - prismarine-chunk: https://codeload.github.com/zardoy/prismarine-chunk/tar.gz/47e0e5b7ff7759b8d222de7746f71023df7ce8e5(minecraft-data@3.83.1) + prismarine-chunk: https://codeload.github.com/zardoy/prismarine-chunk/tar.gz/c5feac83b61d95feb4d4f22c063dacfb8c192a9f(minecraft-data@3.83.1) prismarine-entity: 2.5.0 prismarine-item: 1.16.0 prismarine-nbt: 2.7.0 @@ -17469,7 +17469,7 @@ snapshots: prismarine-biome: 1.3.0(minecraft-data@3.83.1)(prismarine-registry@1.11.0) prismarine-block: https://codeload.github.com/zardoy/prismarine-block/tar.gz/853c559bff2b402863ee9a75b125a3ca320838f9 prismarine-chat: 1.11.0 - prismarine-chunk: https://codeload.github.com/zardoy/prismarine-chunk/tar.gz/47e0e5b7ff7759b8d222de7746f71023df7ce8e5(minecraft-data@3.83.1) + prismarine-chunk: https://codeload.github.com/zardoy/prismarine-chunk/tar.gz/c5feac83b61d95feb4d4f22c063dacfb8c192a9f(minecraft-data@3.83.1) prismarine-entity: 2.5.0 prismarine-item: 1.16.0 prismarine-nbt: 2.7.0 @@ -18275,7 +18275,7 @@ snapshots: prismarine-nbt: 2.7.0 prismarine-registry: 1.11.0 - prismarine-chunk@https://codeload.github.com/zardoy/prismarine-chunk/tar.gz/47e0e5b7ff7759b8d222de7746f71023df7ce8e5(minecraft-data@3.83.1): + prismarine-chunk@https://codeload.github.com/zardoy/prismarine-chunk/tar.gz/c5feac83b61d95feb4d4f22c063dacfb8c192a9f(minecraft-data@3.83.1): dependencies: prismarine-biome: 1.3.0(minecraft-data@3.83.1)(prismarine-registry@1.11.0) prismarine-block: https://codeload.github.com/zardoy/prismarine-block/tar.gz/853c559bff2b402863ee9a75b125a3ca320838f9 @@ -18313,7 +18313,7 @@ snapshots: prismarine-provider-anvil@https://codeload.github.com/zardoy/prismarine-provider-anvil/tar.gz/1d548fac63fe977c8281f0a9a522b37e4d92d0b7(minecraft-data@3.83.1): dependencies: prismarine-block: https://codeload.github.com/zardoy/prismarine-block/tar.gz/853c559bff2b402863ee9a75b125a3ca320838f9 - prismarine-chunk: https://codeload.github.com/zardoy/prismarine-chunk/tar.gz/47e0e5b7ff7759b8d222de7746f71023df7ce8e5(minecraft-data@3.83.1) + prismarine-chunk: https://codeload.github.com/zardoy/prismarine-chunk/tar.gz/c5feac83b61d95feb4d4f22c063dacfb8c192a9f(minecraft-data@3.83.1) prismarine-nbt: 2.7.0 prismarine-world: https://codeload.github.com/zardoy/prismarine-world/tar.gz/ab2146c9933eef3247c3f64446de4ccc2c484c7c uint4: 0.1.2 From e250061757b20251103bab5221b60b4a10a2903e Mon Sep 17 00:00:00 2001 From: Vitaly Turovsky Date: Sat, 3 May 2025 23:11:15 +0300 Subject: [PATCH 2/4] smooth appear panorama on load textures --- renderer/viewer/three/panorama.ts | 30 ++++++++++++++++++++++++------ 1 file changed, 24 insertions(+), 6 deletions(-) diff --git a/renderer/viewer/three/panorama.ts b/renderer/viewer/three/panorama.ts index 682d25d2..30310957 100644 --- a/renderer/viewer/three/panorama.ts +++ b/renderer/viewer/three/panorama.ts @@ -34,7 +34,8 @@ export class PanoramaRenderer { constructor (private readonly documentRenderer: DocumentRenderer, private readonly options: GraphicsInitOptions, private readonly doWorldBlocksPanorama = false) { this.scene = new THREE.Scene() - this.scene.background = new THREE.Color(this.options.config.sceneBackground) + // dark blue background + this.scene.background = new THREE.Color(0x00_22_11) // Add ambient light this.ambientLight = new THREE.AmbientLight(0xcc_cc_cc) @@ -72,9 +73,14 @@ export class PanoramaRenderer { const panorGeo = new THREE.BoxGeometry(1000, 1000, 1000) const loader = new THREE.TextureLoader() const panorMaterials = [] as THREE.MeshBasicMaterial[] + const startTimes = new Map() + const fadeInDuration = 200 for (const file of panoramaFiles) { - const texture = loader.load(join('background', file)) + const texture = loader.load(join('background', file), () => { + // Start fade-in when texture is loaded + startTimes.set(material, Date.now()) + }) // Instead of using repeat/offset to flip, we'll use the texture matrix texture.matrixAutoUpdate = false @@ -82,17 +88,19 @@ export class PanoramaRenderer { -1, 0, 1, 0, 1, 0, 0, 0, 1 ) - texture.wrapS = THREE.ClampToEdgeWrapping // Changed from RepeatWrapping - texture.wrapT = THREE.ClampToEdgeWrapping // Changed from RepeatWrapping + texture.wrapS = THREE.ClampToEdgeWrapping + texture.wrapT = THREE.ClampToEdgeWrapping texture.minFilter = THREE.LinearFilter texture.magFilter = THREE.LinearFilter - panorMaterials.push(new THREE.MeshBasicMaterial({ + const material = new THREE.MeshBasicMaterial({ map: texture, transparent: true, side: THREE.DoubleSide, depthWrite: false, - })) + opacity: 0 // Start with 0 opacity + }) + panorMaterials.push(material) } const panoramaBox = new THREE.Mesh(panorGeo, panorMaterials) @@ -100,6 +108,16 @@ export class PanoramaRenderer { this.time += 0.01 panoramaBox.rotation.y = Math.PI + this.time * 0.01 panoramaBox.rotation.z = Math.sin(-this.time * 0.001) * 0.001 + + // Time-based fade in animation for each material + for (const material of panorMaterials) { + const startTime = startTimes.get(material) + if (startTime) { + const elapsed = Date.now() - startTime + const progress = Math.min(1, elapsed / fadeInDuration) + material.opacity = progress + } + } } const group = new THREE.Object3D() From 22483d7a76e2891292366810034292198d2d20a4 Mon Sep 17 00:00:00 2001 From: Vitaly Turovsky Date: Sun, 4 May 2025 11:24:15 +0300 Subject: [PATCH 3/4] regression: some UIs like settings became not scrollable --- src/screens.css | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/screens.css b/src/screens.css index 8ba37aff..f0040e2d 100644 --- a/src/screens.css +++ b/src/screens.css @@ -33,8 +33,7 @@ flex-direction: column; margin-top: 35px; /* todo remove it but without it in chrome android the screen is not scrollable */ - /*! upd: changed from "overflow: auto" to "overflow: hidden" to fix main component scroll - delete this comment after testing */ - overflow: hidden; + overflow: auto; /* height: fit-content; */ /*! delete this line after testing previous line */ /* todo I'm not sure about it */ /* margin-top: calc(100% / 6 - 16px); */ From b01cfe475de6e8b927493a6ec2a68d73bdd66b55 Mon Sep 17 00:00:00 2001 From: Vitaly Turovsky Date: Sun, 4 May 2025 11:35:43 +0300 Subject: [PATCH 4/4] change color and fix rsbuild hoisting var bug --- renderer/viewer/three/panorama.ts | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/renderer/viewer/three/panorama.ts b/renderer/viewer/three/panorama.ts index 30310957..ba1c4ac2 100644 --- a/renderer/viewer/three/panorama.ts +++ b/renderer/viewer/three/panorama.ts @@ -31,11 +31,12 @@ export class PanoramaRenderer { private readonly abortController = new AbortController() private worldRenderer: WorldRendererCommon | WorldRendererThree | undefined public WorldRendererClass = WorldRendererThree + public startTimes = new Map() constructor (private readonly documentRenderer: DocumentRenderer, private readonly options: GraphicsInitOptions, private readonly doWorldBlocksPanorama = false) { this.scene = new THREE.Scene() - // dark blue background - this.scene.background = new THREE.Color(0x00_22_11) + // #324568 + this.scene.background = new THREE.Color(0x32_45_68) // Add ambient light this.ambientLight = new THREE.AmbientLight(0xcc_cc_cc) @@ -73,13 +74,15 @@ export class PanoramaRenderer { const panorGeo = new THREE.BoxGeometry(1000, 1000, 1000) const loader = new THREE.TextureLoader() const panorMaterials = [] as THREE.MeshBasicMaterial[] - const startTimes = new Map() const fadeInDuration = 200 for (const file of panoramaFiles) { + // eslint-disable-next-line prefer-const + let material: THREE.MeshBasicMaterial + const texture = loader.load(join('background', file), () => { // Start fade-in when texture is loaded - startTimes.set(material, Date.now()) + this.startTimes.set(material, Date.now()) }) // Instead of using repeat/offset to flip, we'll use the texture matrix @@ -93,7 +96,7 @@ export class PanoramaRenderer { texture.minFilter = THREE.LinearFilter texture.magFilter = THREE.LinearFilter - const material = new THREE.MeshBasicMaterial({ + material = new THREE.MeshBasicMaterial({ map: texture, transparent: true, side: THREE.DoubleSide, @@ -111,7 +114,7 @@ export class PanoramaRenderer { // Time-based fade in animation for each material for (const material of panorMaterials) { - const startTime = startTimes.get(material) + const startTime = this.startTimes.get(material) if (startTime) { const elapsed = Date.now() - startTime const progress = Math.min(1, elapsed / fadeInDuration)