From 52128ae11e8b1a7ce66a87c53f1b15f3aabe69f4 Mon Sep 17 00:00:00 2001 From: Warr1024 Date: Fri, 9 Jul 2021 09:08:40 -0400 Subject: Add API for mods to hook liquid transformation events (#11405) Add API for mods to hook liquid transformation events Without this API, there is no reliable way for mods to be notified when liquid transform modifies nodes and mods are forced to poll for changes. This allows mods to detect changes to flowing liquid nodes and liquid renewal using event-driven logic. --- src/script/cpp_api/s_env.h | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'src/script/cpp_api/s_env.h') diff --git a/src/script/cpp_api/s_env.h b/src/script/cpp_api/s_env.h index 232a08aaf..090858f17 100644 --- a/src/script/cpp_api/s_env.h +++ b/src/script/cpp_api/s_env.h @@ -21,6 +21,8 @@ with this program; if not, write to the Free Software Foundation, Inc., #include "cpp_api/s_base.h" #include "irr_v3d.h" +#include "mapnode.h" +#include class ServerEnvironment; struct ScriptCallbackState; @@ -41,5 +43,8 @@ public: void on_emerge_area_completion(v3s16 blockpos, int action, ScriptCallbackState *state); + // Called after liquid transform changes + void on_liquid_transformed(const std::vector> &list); + void initializeEnvironment(ServerEnvironment *env); }; -- cgit v1.2.3