mirror of
https://github.com/MihailRis/voxelcore.git
synced 2026-10-05 02:51:49 +00:00
add 'grounded' support for 'pipe' rotation profile
This commit is contained in:
parent
359123bb36
commit
4c8ae465c7
4 changed files with 21 additions and 5 deletions
|
|
@ -84,9 +84,12 @@ void BlocksController::updateBlock(int x, int y, int z) {
|
|||
if (vox == nullptr)
|
||||
return;
|
||||
const Block* def = level->content->getIndices()->getBlockDef(vox->id);
|
||||
if (def->grounded && !chunks->isSolidBlock(x, y-1, z)) {
|
||||
breakBlock(nullptr, def, x, y, z);
|
||||
return;
|
||||
if (def->grounded) {
|
||||
const auto& vec = get_ground_direction(def, vox->state.rotation);
|
||||
if (!chunks->isSolidBlock(x+vec.x, y+vec.y, z+vec.z)) {
|
||||
breakBlock(nullptr, def, x, y, z);
|
||||
return;
|
||||
}
|
||||
}
|
||||
if (def->rt.funcsset.update) {
|
||||
scripting::update_block(def, x, y, z);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue