Skip to content

Commit 68626d8

Browse files
committed
fix custom dimension background color
1 parent fecf536 commit 68626d8

File tree

1 file changed

+10
-3
lines changed

1 file changed

+10
-3
lines changed

src/client/scripts/index.js

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,14 @@ var Game = class Game {
106106
console.log(`Player dimension has been changed: ${dim}`);
107107
_this.world.resetWorld();
108108
var bg = _this.dimBg[dim];
109-
_this.scene.background = new THREE.Color(...bg);
109+
if (bg === undefined) {
110+
_this.scene.background = new THREE.Color(
111+
..._this.dimBg["minecraft:overworld"]
112+
);
113+
} else {
114+
_this.scene.background = new THREE.Color(...bg);
115+
}
116+
110117
_this.distanceBasedFog.color.x = bg[0];
111118
_this.distanceBasedFog.color.y = bg[1];
112119
_this.distanceBasedFog.color.z = bg[2];
@@ -175,7 +182,7 @@ var Game = class Game {
175182
console.log(val);
176183
});
177184
this.mouse = false;
178-
$(document).on("mousedown",function (e) {
185+
$(document).on("mousedown", function (e) {
179186
if (e.which === 1) {
180187
_this.mouse = true;
181188
if (_this.FPC.gameState === "gameLock") {
@@ -185,7 +192,7 @@ var Game = class Game {
185192
_this.bp.placeBlock();
186193
}
187194
});
188-
$(document).on("mouseup",function (e) {
195+
$(document).on("mouseup", function (e) {
189196
if (e.which === 1) {
190197
_this.mouse = false;
191198
return _this.bb.stopDigging();

0 commit comments

Comments
 (0)