diff --git a/builtin/client/register.lua b/builtin/client/register.lua index d97ea69f8..5e5196f78 100644 --- a/builtin/client/register.lua +++ b/builtin/client/register.lua @@ -95,4 +95,4 @@ core.registered_on_modchannel_message, core.register_on_modchannel_message = mak core.registered_on_modchannel_signal, core.register_on_modchannel_signal = make_registration() core.registered_on_inventory_open, core.register_on_inventory_open = make_registration() core.registered_on_receiving_inventory_form, core.register_on_receiving_inventory_form = make_registration() -core.registered_on_open_nodemeta_form, core.register_on_open_nodemeta_form = make_registration() +core.registered_on_nodemeta_form_open, core.register_on_nodemeta_form_open = make_registration() diff --git a/src/client/game.cpp b/src/client/game.cpp index 47b5cfec4..8b73761ef 100644 --- a/src/client/game.cpp +++ b/src/client/game.cpp @@ -2625,6 +2625,7 @@ bool Game::nodePlacement(const ItemDefinition &selected_def, client->interact(INTERACT_PLACE, pointed); std::string formspec_str = meta->getString("formspec"); + if (!client->getScript()->on_nodemeta_form_open(nodepos, "", formspec_str)) { infostream << "Launching custom inventory view" << std::endl; diff --git a/src/script/cpp_api/s_client.cpp b/src/script/cpp_api/s_client.cpp index 8cf6ee587..5f1eb8421 100644 --- a/src/script/cpp_api/s_client.cpp +++ b/src/script/cpp_api/s_client.cpp @@ -273,7 +273,7 @@ bool ScriptApiClient::on_nodemeta_form_open(v3s16 position, std::string formname lua_pushstring(L, formname.c_str()); lua_pushstring(L, formspec.c_str()); - runCallbacks(2, RUN_CALLBACKS_MODE_OR); + runCallbacks(3, RUN_CALLBACKS_MODE_OR); return readParam(L, -1); }