scripting: on_interact (right click on block) callback

This commit is contained in:
MihailRis
2023-12-29 00:31:21 +03:00
parent 2b4e6c1a14
commit 2c75a0bee4
5 changed files with 18 additions and 0 deletions
+2
View File
@@ -6,6 +6,7 @@
#include "../../voxels/Block.h"
#include "../../voxels/Chunks.h"
#include "../../voxels/voxel.h"
#include "../../lighting/Lighting.h"
int l_block_name(lua_State* L) {
int id = lua_tointeger(L, 1);
@@ -39,6 +40,7 @@ int l_set_block(lua_State* L) {
int z = lua_tointeger(L, 3);
int id = lua_tointeger(L, 4);
scripting::level->chunks->set(x, y, z, id, 0);
scripting::level->lighting->onBlockSet(x,y,z, id);
return 0;
}