diff --git a/index.js b/index.js index 918756e..1437cc5 100644 --- a/index.js +++ b/index.js @@ -86,13 +86,15 @@ function Game(opts) { this.chunksNeedsUpdate = {} // contains new chunks yet to be generated. Handled by game.loadPendingChunks this.pendingChunks = [] - - this.materials = texture({ - game: this, - texturePath: opts.texturePath || './textures/', - materialType: opts.materialType || THREE.MeshLambertMaterial, - materialParams: opts.materialParams || {} - }) + + if (process.browser) { + this.materials = texture({ + game: this, + texturePath: opts.texturePath || './textures/', + materialType: opts.materialType || THREE.MeshLambertMaterial, + materialParams: opts.materialParams || {} + }) + } this.materialNames = opts.materials || [['grass', 'dirt', 'grass_dirt'], 'brick', 'dirt'] diff --git a/package.json b/package.json index 7473b3d..0ba2e77 100644 --- a/package.json +++ b/package.json @@ -9,7 +9,7 @@ "dependencies": { "voxel": "0.3.1", "voxel-mesh": "0.2.1", - "voxel-view": "0.0.6", + "voxel-view": "git://github.com/snagy/voxel-view.git", "voxel-chunks": "0.0.2", "voxel-raycast": "0.2.1", "voxel-control": "0.0.7", @@ -17,7 +17,7 @@ "voxel-physical": "0.0.8", "voxel-region-change": "0.1.0", "raf": "0.0.1", - "three": "0.56.0", + "three": "0.58.9", "pin-it": "0.0.1", "aabb-3d": "0.0.0", "inherits": "1.0.0",