minecraft-renderer 0.1.34 → 0.1.35

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "minecraft-renderer",
3
- "version": "0.1.34",
3
+ "version": "0.1.35",
4
4
  "description": "The most Modular Minecraft world renderer with Three.js WebGL backend",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -19,7 +19,7 @@ export const defaultWorldRendererConfig = {
19
19
 
20
20
  // Debug settings
21
21
  showChunkBorders: false,
22
- enableDebugOverlay: false,
22
+ enableDebugOverlay: true,
23
23
  debugModelVariant: undefined as undefined | number[],
24
24
  futuristicReveal: false,
25
25
 
@@ -29,6 +29,7 @@ export const defaultWorldRendererConfig = {
29
29
  addChunksBatchWaitTime: 200,
30
30
  _experimentalSmoothChunkLoading: true,
31
31
  _renderByChunks: false,
32
+ autoLowerRenderDistance: false,
32
33
 
33
34
  // Rendering engine settings
34
35
  dayCycle: true,
@@ -77,6 +77,7 @@ export abstract class WorldRendererCommon<WorkerSend = any, WorkerReceive = any>
77
77
  enableChunksLoadDelay = false
78
78
  texturesVersion?: string
79
79
  viewDistance = -1
80
+ onRenderDistanceChanged?: (viewDistance: number) => void
80
81
  chunksLength = 0
81
82
  allChunksFinished = false
82
83
  messageQueue: any[] = []
@@ -813,6 +814,7 @@ export abstract class WorldRendererCommon<WorkerSend = any, WorkerReceive = any>
813
814
  this.viewDistance = d
814
815
  this.chunksLength = d === 0 ? 1 : generateSpiralMatrix(d).length
815
816
  this.allChunksFinished = Object.keys(this.finishedChunks).length === this.chunksLength
817
+ this.onRenderDistanceChanged?.(d)
816
818
  })
817
819
 
818
820
  worldEmitter.on('markAsLoaded', ({ x, z }) => {
@@ -219,7 +219,7 @@ class MainScene extends BasePlaygroundScene {
219
219
 
220
220
  // Temporarily replace PerspectiveCamera with OrthographicCamera for block rendering
221
221
  this.worldRenderer.camera = new THREE.OrthographicCamera(-1, 1, 1, -1, 0, 10) as any
222
- this.worldRenderer.scene.background = null
222
+ this.worldRenderer.realScene.background = null
223
223
 
224
224
  const rad = THREE.MathUtils.degToRad(-120)
225
225
  this.worldRenderer.directionalLight.position.set(