fix lightning bug

This commit is contained in:
LabyStudio
2022-02-12 21:56:07 +01:00
parent cdd934954e
commit d77a7dae0c
3 changed files with 8 additions and 6 deletions
+1 -2
View File
@@ -231,7 +231,6 @@ window.Minecraft = class {
}
isPaused() {
return false;
//return !this.hasInGameFocus() && this.loadingScreen === null;
return !this.hasInGameFocus() && this.loadingScreen === null;
}
}
+3 -3
View File
@@ -311,9 +311,9 @@ window.Player = class {
let sneaking = false;
if (this.minecraft.hasInGameFocus()) {
/*if (Keyboard.isKeyDown("KeyR")) { // R
this.respawn();
}*/
if (Keyboard.isKeyDown("KeyR")) { // R
// this.respawn();
}
if (Keyboard.isKeyDown("KeyW")) { // W
moveForward++;
}
+4 -1
View File
@@ -235,6 +235,9 @@ window.World = class {
let section = this.getChunkSectionAt(x >> 4, y >> 4, z >> 4)
section.setLightAt(sourceType, x & 15, y & 15, z & 15, lightLevel);
// Rebuild chunk
this.onBlockChanged(x, y, z);
}
isSolidBlockAt(x, y, z) {
@@ -288,7 +291,7 @@ window.World = class {
for (let x = minX; x <= maxX; x++) {
for (let y = minY; y <= maxY; y++) {
for (let z = minZ; z <= maxZ; z++) {
if (this.chunkExists(x >> 4, z >> 4)) {
if (this.chunkExists(x, z)) {
this.getChunkSectionAt(x, y, z).isModified = true;
}
}