implement water fog
This commit is contained in:
@@ -31,7 +31,7 @@ window.ChunkSection = class {
|
||||
}
|
||||
}
|
||||
|
||||
render(renderLayer) {
|
||||
render() {
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -68,6 +68,10 @@ window.World = class {
|
||||
return chunkSection == null ? 0 : chunkSection.getBlockAt(x & 15, y & 15, z & 15);
|
||||
}
|
||||
|
||||
getBlockAtFace(x, y, z, face) {
|
||||
return this.getBlockAt(x + face.x, y + face.y, z + face.z);
|
||||
}
|
||||
|
||||
getChunkSectionAt(chunkX, layerY, chunkZ) {
|
||||
return this.getChunkAt(chunkX, chunkZ).getSection(layerY);
|
||||
}
|
||||
|
||||
@@ -35,7 +35,7 @@ window.Block = class {
|
||||
}
|
||||
|
||||
shouldRenderFace(world, x, y, z, face) {
|
||||
let typeId = world.getBlockAt(x + face.x, y + face.y, z + face.z);
|
||||
let typeId = world.getBlockAtFace(x, y, z, face);
|
||||
return typeId === 0 || Block.getById(typeId).isTransparent();
|
||||
}
|
||||
|
||||
|
||||
@@ -4,7 +4,6 @@ window.BlockWater = class extends Block {
|
||||
super(id, textureSlotId);
|
||||
}
|
||||
|
||||
|
||||
getOpacity() {
|
||||
return 0.3;
|
||||
}
|
||||
@@ -14,7 +13,7 @@ window.BlockWater = class extends Block {
|
||||
}
|
||||
|
||||
shouldRenderFace(world, x, y, z, face) {
|
||||
let typeId = world.getBlockAt(x + face.x, y + face.y, z + face.z);
|
||||
let typeId = world.getBlockAtFace(x, y, z, face);
|
||||
return typeId === 0 || typeId !== this.id && Block.getById(typeId).isTransparent();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user