New block properties and lua functions

This commit is contained in:
MihailRis
2023-12-29 21:18:14 +03:00
parent 9e1a7213c7
commit 9ebbe1029d
7 changed files with 40 additions and 6 deletions
+7
View File
@@ -97,6 +97,13 @@ bool Chunks::isSolid(int x, int y, int z) {
return contentIds->getBlockDef(v->id)->rt.solid;
}
bool Chunks::isReplaceable(int x, int y, int z) {
voxel* v = get(x, y, z);
if (v == nullptr)
return false;
return contentIds->getBlockDef(v->id)->replaceable;
}
ubyte Chunks::getLight(int x, int y, int z, int channel){
x -= ox * CHUNK_W;
z -= oz * CHUNK_D;