implement torch on wall

This commit is contained in:
LabyStudio
2022-02-13 04:17:03 +01:00
parent 9078d34ab0
commit bcdbe4240b
9 changed files with 215 additions and 40 deletions
@@ -278,11 +278,20 @@ window.World = class {
this.onBlockChanged(x, y, z);
}
setBlockDataAt(x, y, z, data) {
this.getChunkAt(x >> 4, z >> 4).setBlockDataAt(x & 15, y, z & 15, data);
}
getBlockAt(x, y, z) {
let chunkSection = this.getChunkAtBlock(x, y, z);
return chunkSection == null ? 0 : chunkSection.getBlockAt(x & 15, y & 15, z & 15);
}
getBlockDataAt(x, y, z) {
let chunkSection = this.getChunkAtBlock(x, y, z);
return chunkSection == null ? 0 : chunkSection.getBlockDataAt(x & 15, y & 15, z & 15);
}
getBlockAtFace(x, y, z, face) {
return this.getBlockAt(x + face.x, y + face.y, z + face.z);
}