summaryrefslogtreecommitdiff
path: root/src/script/lua_api/l_env.h
diff options
context:
space:
mode:
authorest31 <MTest31@outlook.com>2016-02-09 07:08:31 +0100
committerest31 <MTest31@outlook.com>2016-03-07 19:54:26 +0100
commitd494733839e9cf6cb557462326ed21e7a58816c7 (patch)
tree07ead00672b0096aa2a60938b769bf030bba2951 /src/script/lua_api/l_env.h
parent88fbe7ca1e5451851ee0c7ab5524c39a7bb703c2 (diff)
downloadminetest-d494733839e9cf6cb557462326ed21e7a58816c7.tar.gz
minetest-d494733839e9cf6cb557462326ed21e7a58816c7.tar.bz2
minetest-d494733839e9cf6cb557462326ed21e7a58816c7.zip
Add minetest.register_lbm() to run code on block load only
Diffstat (limited to 'src/script/lua_api/l_env.h')
-rw-r--r--src/script/lua_api/l_env.h18
1 files changed, 18 insertions, 0 deletions
diff --git a/src/script/lua_api/l_env.h b/src/script/lua_api/l_env.h
index 4f8dfcd3c..0e385ffef 100644
--- a/src/script/lua_api/l_env.h
+++ b/src/script/lua_api/l_env.h
@@ -220,6 +220,24 @@ public:
u32 active_object_count, u32 active_object_count_wider);
};
+class LuaLBM : public LoadingBlockModifierDef
+{
+private:
+ int m_id;
+public:
+ LuaLBM(lua_State *L, int id,
+ const std::set<std::string> &trigger_contents,
+ const std::string &name,
+ bool run_at_every_load):
+ m_id(id)
+ {
+ this->run_at_every_load = run_at_every_load;
+ this->trigger_contents = trigger_contents;
+ this->name = name;
+ }
+ virtual void trigger(ServerEnvironment *env, v3s16 p, MapNode n);
+};
+
struct ScriptCallbackState {
GameScripting *script;
int callback_ref;