add 'grounded' support for 'pipe' rotation profile

This commit is contained in:
MihailRis
2024-07-10 09:14:24 +03:00
parent 359123bb36
commit 4c8ae465c7
4 changed files with 21 additions and 5 deletions
+5 -2
View File
@@ -404,8 +404,11 @@ void PlayerController::processRightClick(Block* def, Block* target) {
if (!chunks->checkReplaceability(def, state, coord)) {
return;
}
if (def->grounded && !chunks->isSolidBlock(coord.x, coord.y-1, coord.z)) {
return;
if (def->grounded) {
const auto& vec = get_ground_direction(def, state.rotation);
if (!chunks->isSolidBlock(coord.x+vec.x, coord.y+vec.y, coord.z+vec.z)) {
return;
}
}
if (chosenBlock != vox->id && chosenBlock) {
onBlockInteraction(coord, def, BlockInteraction::placing);