improve loading time

This commit is contained in:
LabyStudio
2022-02-04 16:31:11 +01:00
parent 04e38ff7c3
commit 317a70dfd4
2 changed files with 4 additions and 4 deletions
+1 -1
View File
@@ -4,7 +4,7 @@ window.Gui = class {
stack.save();
stack.fillStyle = color;
stack.globalAlpha = alpha;
stack.fillRect(left, top, right - left, bottom - top);
stack.fillRect(Math.floor(left), Math.floor(top), Math.floor(right - left), Math.floor(bottom - top));
stack.restore();
}
+3 -3
View File
@@ -3,7 +3,7 @@ window.World = class {
static TOTAL_HEIGHT = ChunkSection.SIZE * 8 - 1; // ChunkSection.SIZE * 16 - 1;
constructor(minecraft) {
this.minecrat = minecraft;
this.minecraft = minecraft;
this.group = new THREE.Object3D();
this.group.matrixAutoUpdate = false;
@@ -17,7 +17,7 @@ window.World = class {
// Update lights async
let scope = this;
setInterval(function () {
let i = 1000;
let i = scope.minecraft.loadingScreen === null ? 1000 : 100000;
while (scope.lightUpdateQueue.length >= 10 && i > 0) {
i--;
scope.lightUpdateQueue.shift().updateBlockLightning(scope);
@@ -26,7 +26,7 @@ window.World = class {
}
onTick() {
let player = this.minecrat.player;
let player = this.minecraft.player;
let cameraChunkX = Math.floor(player.x >> 4);
let cameraChunkZ = Math.floor(player.z >> 4);