implement mojang lightning of a1.2.6
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
window.BlockRenderer = class {
|
||||
|
||||
static CLASSIC_LIGHTNING = false;
|
||||
static CLASSIC_LIGHTNING = true;
|
||||
|
||||
constructor(worldRenderer) {
|
||||
this.worldRenderer = worldRenderer;
|
||||
@@ -125,7 +125,7 @@ window.BlockRenderer = class {
|
||||
if (typeId === 0 || Block.getById(typeId).isTransparent()) {
|
||||
|
||||
// Sum up the light levels
|
||||
totalLightLevel += world.getLightAt(x + offsetX, y + offsetY, z + offsetZ);
|
||||
totalLightLevel += world.getTotalLightAt(x + offsetX, y + offsetY, z + offsetZ);
|
||||
totalBlocks++;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -103,8 +103,7 @@ window.WorldRenderer = class {
|
||||
renderChunks(cameraChunkX, cameraChunkZ) {
|
||||
let world = this.minecraft.world;
|
||||
|
||||
for (let i in world.chunks) {
|
||||
let chunk = world.chunks[i];
|
||||
for (let [index, chunk] of world.chunks) {
|
||||
|
||||
let distanceX = Math.abs(cameraChunkX - chunk.x);
|
||||
let distanceZ = Math.abs(cameraChunkZ - chunk.z);
|
||||
|
||||
Reference in New Issue
Block a user