add 'on_breaking', 'on_block_breaking' events

This commit is contained in:
MihailRis
2024-12-21 14:09:17 +03:00
parent c3f22c6854
commit 4363883728
5 changed files with 60 additions and 82 deletions
+1
View File
@@ -544,6 +544,7 @@ void PlayerController::updateInteraction(float delta) {
}
auto& target = indices->blocks.require(vox->id);
if (lclick) {
scripting::on_block_breaking(&player, target, iend);
if (player.isInstantDestruction() && target.breakable) {
blocksController.breakBlock(
&player, target, iend.x, iend.y, iend.z