fixes + Block.replaceable

This commit is contained in:
MihailRis
2023-11-30 19:11:58 +03:00
parent cee0214ac5
commit dc0c497ec1
6 changed files with 46 additions and 15 deletions
+6 -3
View File
@@ -238,9 +238,12 @@ void PlayerController::updateInteraction(){
y = (int)(iend.y)+(int)(norm.y);
z = (int)(iend.z)+(int)(norm.z);
}
if (!level->physics->isBlockInside(x,y,z, player->hitbox)){
chunks->set(x, y, z, player->choosenBlock, states);
lighting->onBlockSet(x,y,z, player->choosenBlock);
vox = chunks->get(x, y, z);
if (vox && (block = contentIds->getBlockDef(vox->id))->replaceable) {
if (!level->physics->isBlockInside(x,y,z, player->hitbox)){
chunks->set(x, y, z, player->choosenBlock, states);
lighting->onBlockSet(x,y,z, player->choosenBlock);
}
}
}
if (Events::jactive(BIND_PLAYER_PICK)){