diff options
author | faketruth <faketruth@0a769ca7-a7f5-676a-18bf-c427514a06d6> | 2012-06-11 21:25:55 +0200 |
---|---|---|
committer | faketruth <faketruth@0a769ca7-a7f5-676a-18bf-c427514a06d6> | 2012-06-11 21:25:55 +0200 |
commit | 373dac3204519b964710fdc693dd16c400881e1a (patch) | |
tree | 3faecd747d1da82cffff2ca45890968354dfeb43 /source/cPlugin_NewLua.cpp | |
parent | Fixed a bug in crafting recipes - would consume multiple items of asterisked ingredients (FS #205) (diff) | |
download | cuberite-373dac3204519b964710fdc693dd16c400881e1a.tar cuberite-373dac3204519b964710fdc693dd16c400881e1a.tar.gz cuberite-373dac3204519b964710fdc693dd16c400881e1a.tar.bz2 cuberite-373dac3204519b964710fdc693dd16c400881e1a.tar.lz cuberite-373dac3204519b964710fdc693dd16c400881e1a.tar.xz cuberite-373dac3204519b964710fdc693dd16c400881e1a.tar.zst cuberite-373dac3204519b964710fdc693dd16c400881e1a.zip |
Diffstat (limited to '')
-rw-r--r-- | source/cPlugin_NewLua.cpp | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/source/cPlugin_NewLua.cpp b/source/cPlugin_NewLua.cpp index 1b617f1ef..fc07b266e 100644 --- a/source/cPlugin_NewLua.cpp +++ b/source/cPlugin_NewLua.cpp @@ -363,6 +363,27 @@ void cPlugin_NewLua::OnChunkGenerated(cWorld * a_World, int a_ChunkX, int a_Chun +bool cPlugin_NewLua::OnChunkGenerating( int a_ChunkX, int a_ChunkZ, cLuaChunk * a_pLuaChunk )
+{
+ cCSLock Lock(m_CriticalSection);
+ if (!PushFunction("OnChunkGenerating"))
+ return false;
+
+ tolua_pushnumber (m_LuaState, a_ChunkX);
+ tolua_pushnumber (m_LuaState, a_ChunkZ);
+ tolua_pushusertype(m_LuaState, a_pLuaChunk, "cLuaChunk");
+
+ if( !CallFunction(3, 1, "OnChunkGenerating") )
+ 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 );
|