diff options
author | kwolekr <kwolekr@minetest.net> | 2014-12-29 12:58:55 -0500 |
---|---|---|
committer | kwolekr <kwolekr@minetest.net> | 2014-12-29 12:59:59 -0500 |
commit | 5e2753c712e8f65fa50f4889fc1422393ba21413 (patch) | |
tree | 04aab9306f77497e712ad13ae3445d878280881d /src/script/cpp_api | |
parent | ff3cfb746e203ed02160de09b1912b543c5a25f0 (diff) | |
download | minetest-5e2753c712e8f65fa50f4889fc1422393ba21413.tar.gz minetest-5e2753c712e8f65fa50f4889fc1422393ba21413.tar.bz2 minetest-5e2753c712e8f65fa50f4889fc1422393ba21413.zip |
Expose mapgen parameters on scripting init
Add minetest.get_mapgen_params()
Deprecate minetest.register_on_mapgen_init()
Diffstat (limited to 'src/script/cpp_api')
-rw-r--r-- | src/script/cpp_api/s_env.cpp | 31 | ||||
-rw-r--r-- | src/script/cpp_api/s_env.h | 2 |
2 files changed, 0 insertions, 33 deletions
diff --git a/src/script/cpp_api/s_env.cpp b/src/script/cpp_api/s_env.cpp index 916c562fb..c171bbf02 100644 --- a/src/script/cpp_api/s_env.cpp +++ b/src/script/cpp_api/s_env.cpp @@ -79,37 +79,6 @@ void ScriptApiEnv::player_event(ServerActiveObject* player, std::string type) } } -void ScriptApiEnv::environment_OnMapgenInit(MapgenParams *mgparams) -{ - SCRIPTAPI_PRECHECKHEADER - - // Get core.registered_on_mapgen_inits - lua_getglobal(L, "core"); - lua_getfield(L, -1, "registered_on_mapgen_inits"); - - // Call callbacks - lua_newtable(L); - - lua_pushstring(L, mgparams->mg_name.c_str()); - lua_setfield(L, -2, "mgname"); - - lua_pushinteger(L, mgparams->seed); - lua_setfield(L, -2, "seed"); - - lua_pushinteger(L, mgparams->water_level); - lua_setfield(L, -2, "water_level"); - - lua_pushinteger(L, mgparams->chunksize); - lua_setfield(L, -2, "chunksize"); - - std::string flagstr = writeFlagString(mgparams->flags, - flagdesc_mapgen, (u32)-1); - lua_pushstring(L, flagstr.c_str()); - lua_setfield(L, -2, "flags"); - - script_run_callbacks(L, 1, RUN_CALLBACKS_MODE_FIRST); -} - void ScriptApiEnv::initializeEnvironment(ServerEnvironment *env) { SCRIPTAPI_PRECHECKHEADER diff --git a/src/script/cpp_api/s_env.h b/src/script/cpp_api/s_env.h index 33bd81ab3..180cfabd0 100644 --- a/src/script/cpp_api/s_env.h +++ b/src/script/cpp_api/s_env.h @@ -34,8 +34,6 @@ public: void environment_Step(float dtime); // After generating a piece of map void environment_OnGenerated(v3s16 minp, v3s16 maxp,u32 blockseed); - // After initializing mapgens - void environment_OnMapgenInit(MapgenParams *mgparams); //called on player event void player_event(ServerActiveObject* player, std::string type); |