summaryrefslogtreecommitdiffstats
path: root/source/ManualBindings.cpp
diff options
context:
space:
mode:
authormadmaxoft <github@xoft.cz>2013-11-22 20:11:24 +0100
committermadmaxoft <github@xoft.cz>2013-11-22 20:11:24 +0100
commit63753c5e8405837931510b8da648dc75d4970fe1 (patch)
tree58e495519d269f4e6d7aff94294101a5911465cc /source/ManualBindings.cpp
parentAPIDump: Fixed cRoot's furnace query API. (diff)
downloadcuberite-63753c5e8405837931510b8da648dc75d4970fe1.tar
cuberite-63753c5e8405837931510b8da648dc75d4970fe1.tar.gz
cuberite-63753c5e8405837931510b8da648dc75d4970fe1.tar.bz2
cuberite-63753c5e8405837931510b8da648dc75d4970fe1.tar.lz
cuberite-63753c5e8405837931510b8da648dc75d4970fe1.tar.xz
cuberite-63753c5e8405837931510b8da648dc75d4970fe1.tar.zst
cuberite-63753c5e8405837931510b8da648dc75d4970fe1.zip
Diffstat (limited to '')
-rw-r--r--source/ManualBindings.cpp27
1 files changed, 27 insertions, 0 deletions
diff --git a/source/ManualBindings.cpp b/source/ManualBindings.cpp
index f3325f25c..967b03ee7 100644
--- a/source/ManualBindings.cpp
+++ b/source/ManualBindings.cpp
@@ -171,6 +171,29 @@ cPluginLua * GetLuaPlugin(lua_State * L)
+static int tolua_cFile_GetFolderContents(lua_State * tolua_S)
+{
+ cLuaState LuaState(tolua_S);
+ if (
+ !LuaState.CheckParamUserTable(1, "cFile") ||
+ !LuaState.CheckParamString (2) ||
+ !LuaState.CheckParamEnd (3)
+ )
+ {
+ return 0;
+ }
+
+ AString Folder = (AString)tolua_tocppstring(LuaState, 1, 0);
+
+ AStringVector Contents = cFile::GetFolderContents(Folder);
+ LuaState.Push(Contents);
+ return 1;
+}
+
+
+
+
+
template<
class Ty1,
class Ty2,
@@ -2153,6 +2176,10 @@ void ManualBindings::Bind(lua_State * tolua_S)
tolua_function(tolua_S, "LOGWARNING", tolua_LOGWARN);
tolua_function(tolua_S, "LOGERROR", tolua_LOGERROR);
+ tolua_beginmodule(tolua_S, "cFile");
+ tolua_function(tolua_S, "GetFolderContents", tolua_cFile_GetFolderContents);
+ tolua_endmodule(tolua_S);
+
tolua_beginmodule(tolua_S, "cHopperEntity");
tolua_function(tolua_S, "GetOutputBlockPos", tolua_cHopperEntity_GetOutputBlockPos);
tolua_endmodule(tolua_S);