From 571200019d7f0a948145b6cf8c2594d3e75cb375 Mon Sep 17 00:00:00 2001 From: Tycho Date: Wed, 22 Jan 2014 10:35:36 -0800 Subject: Added manual bindings for moved functions --- src/Bindings/AllToLua.pkg | 1 + src/Bindings/ManualBindings.cpp | 66 +++++++++++++++++++++++++++++++++++++++++ 2 files changed, 67 insertions(+) (limited to 'src/Bindings') diff --git a/src/Bindings/AllToLua.pkg b/src/Bindings/AllToLua.pkg index f65aed9bb..9ad45d1bd 100644 --- a/src/Bindings/AllToLua.pkg +++ b/src/Bindings/AllToLua.pkg @@ -70,6 +70,7 @@ $cfile "../Generating/ChunkDesc.h" $cfile "../CraftingRecipes.h" $cfile "../UI/Window.h" $cfile "../Mobs/Monster.h" +$cfile "../WorldStorage/SchematicFileSerilizer.h" diff --git a/src/Bindings/ManualBindings.cpp b/src/Bindings/ManualBindings.cpp index f1160f941..1b7651acd 100644 --- a/src/Bindings/ManualBindings.cpp +++ b/src/Bindings/ManualBindings.cpp @@ -13,6 +13,7 @@ #include "../Entities/Player.h" #include "../WebAdmin.h" #include "../ClientHandle.h" +#include "../BlockArea.h" #include "../BlockEntities/ChestEntity.h" #include "../BlockEntities/CommandBlockEntity.h" #include "../BlockEntities/DispenserEntity.h" @@ -22,6 +23,7 @@ #include "../BlockEntities/NoteEntity.h" #include "md5/md5.h" #include "../LineBlockTracer.h" +#include "../WorldStorage/SchematicFileSerilizer.h" @@ -2234,6 +2236,65 @@ static int tolua_cHopperEntity_GetOutputBlockPos(lua_State * tolua_S) + +static int tolua_cBlockArea_LoadFromSchematicFile(lua_State * tolua_S) +{ + // function cBlockArea::LoadFromSchematicFile + // Exported manually because function has been moved to SchematicFileSerilizer.cpp + cLuaState L(tolua_S); + if ( + !L.CheckParamUserType(1, "cBlockArea") || + !L.CheckParamString (2) || + !L.CheckParamEnd (3) + ) + { + return 0; + } + cBlockArea * self = (cBlockArea *)tolua_tousertype(tolua_S, 1, 0); + if (self == NULL) + { + tolua_error(tolua_S, "invalid 'self' in function 'cBlockArea::LoadFromSchematicFile'", NULL); + return 0; + } + + AString Filename = tolua_tostring(tolua_S, 2, 0); + LOGWARNING("cBlockArea::LoadFromSchematic file is depreciated. Please use cSchematicFileSerilizer::LoadFromSchematicFile."); + bool res = cSchematicFileSerializer::LoadFromSchematicFile(*self,Filename); + tolua_pushboolean(tolua_S, res); + return 1; +} + + + + +static int tolua_cBlockArea_SaveToSchematicFile(lua_State * tolua_S) +{ + // function cBlockArea::SaveToSchematicFile + // Exported manually because function has been moved to SchematicFileSerilizer.cpp + cLuaState L(tolua_S); + if ( + !L.CheckParamUserType(1, "cBlockArea") || + !L.CheckParamString (2) || + !L.CheckParamEnd (3) + ) + { + return 0; + } + cBlockArea * self = (cBlockArea *)tolua_tousertype(tolua_S, 1, 0); + if (self == NULL) + { + tolua_error(tolua_S, "invalid 'self' in function 'cBlockArea::SaveToSchematicFile'", NULL); + return 0; + } + AString Filename = tolua_tostring(tolua_S, 2, 0); + LOGWARNING("cBlockArea::SaveToSchematic file is depreciated. Please use cSchematicFileSerializer::SaveToSchematicFile."); + bool res = cSchematicFileSerializer::SaveToSchematicFile(*self,Filename); + tolua_pushboolean(tolua_S, res); + return 1; +} + + + void ManualBindings::Bind(lua_State * tolua_S) { tolua_beginmodule(tolua_S, NULL); @@ -2250,6 +2311,11 @@ void ManualBindings::Bind(lua_State * tolua_S) tolua_endmodule(tolua_S); tolua_beginmodule(tolua_S, "cHopperEntity"); + tolua_function(tolua_S, "LoadFromSchematicFile", tolua_cBlockArea_LoadFromSchematicFile); + tolua_function(tolua_S, "SaveToSchematicFile", tolua_cBlockArea_SaveToSchematicFile); + tolua_endmodule(tolua_S); + + tolua_beginmodule(tolua_S, "cBlockArea"); tolua_function(tolua_S, "GetOutputBlockPos", tolua_cHopperEntity_GetOutputBlockPos); tolua_endmodule(tolua_S); -- cgit v1.2.3 From 5ef0a00a6c11c183070b97d2121009de27830713 Mon Sep 17 00:00:00 2001 From: Tycho Date: Wed, 22 Jan 2014 10:39:09 -0800 Subject: Fixed spelling error --- src/Bindings/AllToLua.pkg | 2 +- src/Bindings/ManualBindings.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'src/Bindings') diff --git a/src/Bindings/AllToLua.pkg b/src/Bindings/AllToLua.pkg index 9ad45d1bd..8b2a78d05 100644 --- a/src/Bindings/AllToLua.pkg +++ b/src/Bindings/AllToLua.pkg @@ -70,7 +70,7 @@ $cfile "../Generating/ChunkDesc.h" $cfile "../CraftingRecipes.h" $cfile "../UI/Window.h" $cfile "../Mobs/Monster.h" -$cfile "../WorldStorage/SchematicFileSerilizer.h" +$cfile "../WorldStorage/SchematicFileSerializer.h" diff --git a/src/Bindings/ManualBindings.cpp b/src/Bindings/ManualBindings.cpp index 1b7651acd..299dfd9ee 100644 --- a/src/Bindings/ManualBindings.cpp +++ b/src/Bindings/ManualBindings.cpp @@ -23,7 +23,7 @@ #include "../BlockEntities/NoteEntity.h" #include "md5/md5.h" #include "../LineBlockTracer.h" -#include "../WorldStorage/SchematicFileSerilizer.h" +#include "../WorldStorage/SchematicFileSerializer.h" -- cgit v1.2.3 From 2806b48afa4e3d087c8a123d81f9eabe3ec797c5 Mon Sep 17 00:00:00 2001 From: Tycho Date: Sat, 25 Jan 2014 06:06:30 -0800 Subject: Fixed exports --- src/Bindings/AllToLua.pkg | 1 - src/Bindings/ManualBindings.cpp | 2 -- 2 files changed, 3 deletions(-) (limited to 'src/Bindings') diff --git a/src/Bindings/AllToLua.pkg b/src/Bindings/AllToLua.pkg index 8b2a78d05..f65aed9bb 100644 --- a/src/Bindings/AllToLua.pkg +++ b/src/Bindings/AllToLua.pkg @@ -70,7 +70,6 @@ $cfile "../Generating/ChunkDesc.h" $cfile "../CraftingRecipes.h" $cfile "../UI/Window.h" $cfile "../Mobs/Monster.h" -$cfile "../WorldStorage/SchematicFileSerializer.h" diff --git a/src/Bindings/ManualBindings.cpp b/src/Bindings/ManualBindings.cpp index 299dfd9ee..4e92da5ae 100644 --- a/src/Bindings/ManualBindings.cpp +++ b/src/Bindings/ManualBindings.cpp @@ -2258,7 +2258,6 @@ static int tolua_cBlockArea_LoadFromSchematicFile(lua_State * tolua_S) } AString Filename = tolua_tostring(tolua_S, 2, 0); - LOGWARNING("cBlockArea::LoadFromSchematic file is depreciated. Please use cSchematicFileSerilizer::LoadFromSchematicFile."); bool res = cSchematicFileSerializer::LoadFromSchematicFile(*self,Filename); tolua_pushboolean(tolua_S, res); return 1; @@ -2287,7 +2286,6 @@ static int tolua_cBlockArea_SaveToSchematicFile(lua_State * tolua_S) return 0; } AString Filename = tolua_tostring(tolua_S, 2, 0); - LOGWARNING("cBlockArea::SaveToSchematic file is depreciated. Please use cSchematicFileSerializer::SaveToSchematicFile."); bool res = cSchematicFileSerializer::SaveToSchematicFile(*self,Filename); tolua_pushboolean(tolua_S, res); return 1; -- cgit v1.2.3 From 2a18feb0159da6288efab79e39550b3c31bb71c1 Mon Sep 17 00:00:00 2001 From: Tycho Date: Sat, 25 Jan 2014 10:13:54 -0800 Subject: Stupid Mistake fixed --- src/Bindings/ManualBindings.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/Bindings') diff --git a/src/Bindings/ManualBindings.cpp b/src/Bindings/ManualBindings.cpp index 4e92da5ae..e7c66c6fb 100644 --- a/src/Bindings/ManualBindings.cpp +++ b/src/Bindings/ManualBindings.cpp @@ -2308,12 +2308,12 @@ void ManualBindings::Bind(lua_State * tolua_S) tolua_function(tolua_S, "GetFolderContents", tolua_cFile_GetFolderContents); tolua_endmodule(tolua_S); - tolua_beginmodule(tolua_S, "cHopperEntity"); + tolua_beginmodule(tolua_S, "cBlockArea"); tolua_function(tolua_S, "LoadFromSchematicFile", tolua_cBlockArea_LoadFromSchematicFile); tolua_function(tolua_S, "SaveToSchematicFile", tolua_cBlockArea_SaveToSchematicFile); tolua_endmodule(tolua_S); - tolua_beginmodule(tolua_S, "cBlockArea"); + tolua_beginmodule(tolua_S, "cHopperEntity"); tolua_function(tolua_S, "GetOutputBlockPos", tolua_cHopperEntity_GetOutputBlockPos); tolua_endmodule(tolua_S); -- cgit v1.2.3