From deb32553af666b05dc8ffe93965c968c50acb5d0 Mon Sep 17 00:00:00 2001 From: Vitaly Date: Fri, 6 Oct 2023 10:33:30 +0300 Subject: [PATCH] should fix build --- prismarine-viewer/viewer/lib/worldrenderer.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/prismarine-viewer/viewer/lib/worldrenderer.js b/prismarine-viewer/viewer/lib/worldrenderer.js index 2b3fd80ae..59110f3b0 100644 --- a/prismarine-viewer/viewer/lib/worldrenderer.js +++ b/prismarine-viewer/viewer/lib/worldrenderer.js @@ -14,6 +14,7 @@ function mod (x, n) { class WorldRenderer { constructor (scene, numWorkers = 4) { + this.blockEntities = {} this.sectionMeshs = {} this.active = false this.version = undefined @@ -29,10 +30,10 @@ class WorldRenderer { this.workers = [] for (let i = 0; i < numWorkers; i++) { - // Node environement needs an absolute path, but browser needs the url of the file + // Node environment needs an absolute path, but browser needs the url of the file let src = __dirname - if (typeof window !== 'undefined') src = 'worker.js' - else src += '/worker.js' + if (typeof window === 'undefined') src += '/worker.js' + else src = 'worker.js' /** @type {any} */ const worker = new Worker(src)