Skip to content

Commit

Permalink
should fix build
Browse files Browse the repository at this point in the history
  • Loading branch information
zardoy committed Oct 6, 2023
1 parent 15c820a commit deb3255
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions prismarine-viewer/viewer/lib/worldrenderer.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ function mod (x, n) {

class WorldRenderer {
constructor (scene, numWorkers = 4) {
this.blockEntities = {}
this.sectionMeshs = {}
this.active = false
this.version = undefined
Expand All @@ -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)
Expand Down

0 comments on commit deb3255

Please sign in to comment.