add new world events: on_block_broken, on_block_placed

This commit is contained in:
MihailRis
2024-07-14 01:37:11 +03:00
parent 4952de4716
commit ea765ffc0c
6 changed files with 49 additions and 10 deletions
+1 -3
View File
@@ -73,9 +73,7 @@ void BlocksController::updateSides(int x, int y, int z) {
void BlocksController::breakBlock(Player* player, const Block* def, int x, int y, int z) {
chunks->set(x,y,z, 0, {});
lighting->onBlockSet(x,y,z, 0);
if (def->rt.funcsset.onbroken) {
scripting::on_block_broken(player, def, x, y, z);
}
scripting::on_block_broken(player, def, x, y, z);
updateSides(x, y, z);
}