mirror of
https://github.com/MihailRis/voxelcore.git
synced 2026-10-07 03:51:50 +00:00
New block properties and lua functions
This commit is contained in:
parent
9e1a7213c7
commit
9ebbe1029d
7 changed files with 40 additions and 6 deletions
|
|
@ -80,6 +80,7 @@ public:
|
|||
bool breakable = true;
|
||||
bool rotatable = false;
|
||||
bool grounded = false;
|
||||
bool hidden = false;
|
||||
AABB hitbox;
|
||||
BlockRotProfile rotations;
|
||||
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -55,6 +55,7 @@ public:
|
|||
|
||||
const AABB* isObstacle(float x, float y, float z);
|
||||
bool isSolid(int x, int y, int z);
|
||||
bool isReplaceable(int x, int y, int z);
|
||||
|
||||
// does not move chunks inside
|
||||
void _setOffset(int x, int z);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue