disable light updates on chunk load
This commit is contained in:
@@ -99,6 +99,7 @@ window.Minecraft = class {
|
|||||||
if (button === 0) {
|
if (button === 0) {
|
||||||
if (hitResult != null) {
|
if (hitResult != null) {
|
||||||
this.world.setBlockAt(hitResult.x, hitResult.y, hitResult.z, 0);
|
this.world.setBlockAt(hitResult.x, hitResult.y, hitResult.z, 0);
|
||||||
|
this.world.updateBlockLightAt(hitResult.x, hitResult.y, hitResult.z);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -124,6 +125,7 @@ window.Minecraft = class {
|
|||||||
// Don't place blocks if the player is standing there
|
// Don't place blocks if the player is standing there
|
||||||
if (!placedBoundingBox.intersects(this.player.boundingBox)) {
|
if (!placedBoundingBox.intersects(this.player.boundingBox)) {
|
||||||
this.world.setBlockAt(x, y, z, this.pickedBlock);
|
this.world.setBlockAt(x, y, z, this.pickedBlock);
|
||||||
|
this.world.updateBlockLightAt(x, y, z);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -85,8 +85,6 @@ window.World = class {
|
|||||||
let chunkSection = this.getChunkAtBlock(x, y, z);
|
let chunkSection = this.getChunkAtBlock(x, y, z);
|
||||||
if (chunkSection != null) {
|
if (chunkSection != null) {
|
||||||
chunkSection.setBlockAt(x & 15, y & 15, z & 15, type);
|
chunkSection.setBlockAt(x & 15, y & 15, z & 15, type);
|
||||||
|
|
||||||
this.updateBlockLightAt(x, y, z);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
this.onBlockChanged(x, y, z);
|
this.onBlockChanged(x, y, z);
|
||||||
|
|||||||
Reference in New Issue
Block a user