add temporary test block

This commit is contained in:
MihailRis
2024-06-08 21:42:44 +03:00
parent c2aa4e3c26
commit ee47213dbb
8 changed files with 45 additions and 4 deletions
+5
View File
@@ -368,6 +368,7 @@ void PlayerController::updateInteraction(){
player->selectedVoxel = *vox;
selectedBlockId = vox->id;
selectedBlockRotation = vox->state.rotation;
player->actualSelectedBlockPosition = iend;
if (selectedState.segment) {
iend = chunks->seekOrigin(
iend, indices->getBlockDef(selectedBlockId), selectedState
@@ -410,6 +411,7 @@ void PlayerController::updateInteraction(){
}
}
if (def && rclick){
iend = player->actualSelectedBlockPosition;
if (!input.shift && target->rt.funcsset.oninteract) {
if (scripting::on_block_interact(player.get(), target, x, y, z))
return;
@@ -420,6 +422,9 @@ void PlayerController::updateInteraction(){
z = (iend.z)+(norm.z);
} else if (def->rotations.name == "pipe") {
state.rotation = BLOCK_DIR_UP;
x = iend.x;
y = iend.y;
z = iend.z;
}
vox = chunks->get(x, y, z);
blockid_t chosenBlock = def->rt.id;