implement mojang lightning of a1.2.6

This commit is contained in:
LabyStudio
2022-02-01 21:08:09 +01:00
parent 76e7f9fd84
commit 14c13297fb
12 changed files with 458 additions and 158 deletions
+2 -2
View File
@@ -81,6 +81,8 @@ window.Minecraft = class {
// Render the game
this.worldRenderer.render(partialTicks);
while (this.world.updateLights()) ;
}
onTick() {
@@ -99,7 +101,6 @@ window.Minecraft = class {
if (button === 0) {
if (hitResult != null) {
this.world.setBlockAt(hitResult.x, hitResult.y, hitResult.z, 0);
this.world.updateBlockLightAt(hitResult.x, hitResult.y, hitResult.z);
}
}
@@ -125,7 +126,6 @@ window.Minecraft = class {
// Don't place blocks if the player is standing there
if (!placedBoundingBox.intersects(this.player.boundingBox)) {
this.world.setBlockAt(x, y, z, this.pickedBlock);
this.world.updateBlockLightAt(x, y, z);
}
}
}