summaryrefslogtreecommitdiffstats
path: root/source/cPlugin_NewLua.cpp
diff options
context:
space:
mode:
authormadmaxoft@gmail.com <madmaxoft@gmail.com@0a769ca7-a7f5-676a-18bf-c427514a06d6>2012-06-14 21:20:31 +0200
committermadmaxoft@gmail.com <madmaxoft@gmail.com@0a769ca7-a7f5-676a-18bf-c427514a06d6>2012-06-14 21:20:31 +0200
commite1b5f0af046f2c4c05789adf33eef5404adba2c3 (patch)
tree6738e8d63067ef348113e0ae50433722ec952c38 /source/cPlugin_NewLua.cpp
parentAdded a world parameter to HOOK_CHUNK_GENERATING. (diff)
downloadcuberite-e1b5f0af046f2c4c05789adf33eef5404adba2c3.tar
cuberite-e1b5f0af046f2c4c05789adf33eef5404adba2c3.tar.gz
cuberite-e1b5f0af046f2c4c05789adf33eef5404adba2c3.tar.bz2
cuberite-e1b5f0af046f2c4c05789adf33eef5404adba2c3.tar.lz
cuberite-e1b5f0af046f2c4c05789adf33eef5404adba2c3.tar.xz
cuberite-e1b5f0af046f2c4c05789adf33eef5404adba2c3.tar.zst
cuberite-e1b5f0af046f2c4c05789adf33eef5404adba2c3.zip
Diffstat (limited to 'source/cPlugin_NewLua.cpp')
-rw-r--r--source/cPlugin_NewLua.cpp23
1 files changed, 23 insertions, 0 deletions
diff --git a/source/cPlugin_NewLua.cpp b/source/cPlugin_NewLua.cpp
index dd6b61b9b..7254bef01 100644
--- a/source/cPlugin_NewLua.cpp
+++ b/source/cPlugin_NewLua.cpp
@@ -508,6 +508,29 @@ bool cPlugin_NewLua::OnBlockToPickup(
+bool cPlugin_NewLua::OnWeatherChanged(cWorld * a_World)
+{
+ cCSLock Lock(m_CriticalSection);
+ if (!PushFunction("OnWeatherChanged"))
+ {
+ return false;
+ }
+
+ tolua_pushusertype(m_LuaState, (void *)a_World, "cWorld");
+
+ if (!CallFunction(1, 1, "OnWeatherChanged"))
+ {
+ return false;
+ }
+
+ bool bRetVal = (tolua_toboolean( m_LuaState, -1, 0) > 0);
+ return bRetVal;
+}
+
+
+
+
+
cWebPlugin_Lua* cPlugin_NewLua::CreateWebPlugin(lua_State* a_LuaState)
{
cCSLock Lock( m_CriticalSection );