diff options
Diffstat (limited to 'src/Bindings')
-rw-r--r-- | src/Bindings/AllToLua.pkg | 3 | ||||
-rw-r--r-- | src/Bindings/ManualBindings.cpp | 68 |
2 files changed, 71 insertions, 0 deletions
diff --git a/src/Bindings/AllToLua.pkg b/src/Bindings/AllToLua.pkg index 1f08c66dc..4fd5a68b8 100644 --- a/src/Bindings/AllToLua.pkg +++ b/src/Bindings/AllToLua.pkg @@ -48,6 +48,7 @@ $cfile "../ItemGrid.h" $cfile "../BlockEntities/BlockEntity.h" $cfile "../BlockEntities/BlockEntityWithItems.h" $cfile "../BlockEntities/ChestEntity.h" +$cfile "../BlockEntities/CommandBlockEntity.h" $cfile "../BlockEntities/DropSpenserEntity.h" $cfile "../BlockEntities/DispenserEntity.h" $cfile "../BlockEntities/DropperEntity.h" @@ -72,6 +73,8 @@ $cfile "../CraftingRecipes.h" $cfile "../UI/Window.h" $cfile "../Mobs/Monster.h" $cfile "../CompositeChat.h" +$cfile "../Map.h" +$cfile "../MapManager.h" diff --git a/src/Bindings/ManualBindings.cpp b/src/Bindings/ManualBindings.cpp index c220e5e0a..2f3f3ee91 100644 --- a/src/Bindings/ManualBindings.cpp +++ b/src/Bindings/ManualBindings.cpp @@ -2350,6 +2350,37 @@ static int tolua_cBlockArea_GetBlockTypeMeta(lua_State * tolua_S) +static int tolua_cBlockArea_GetOrigin(lua_State * tolua_S) +{ + // function cBlockArea::GetOrigin() + // Returns all three coords of the origin point + // Exported manually because there's no direct C++ equivalent, + // plus tolua would generate extra input params for the outputs + + cLuaState L(tolua_S); + if (!L.CheckParamUserType(1, "cBlockArea")) + { + return 0; + } + + cBlockArea * self = (cBlockArea *)tolua_tousertype(tolua_S, 1, NULL); + if (self == NULL) + { + tolua_error(tolua_S, "invalid 'self' in function 'cBlockArea:GetOrigin'", NULL); + return 0; + } + + // Push the three origin coords: + lua_pushnumber(tolua_S, self->GetOriginX()); + lua_pushnumber(tolua_S, self->GetOriginY()); + lua_pushnumber(tolua_S, self->GetOriginZ()); + return 3; +} + + + + + static int tolua_cBlockArea_GetRelBlockTypeMeta(lua_State * tolua_S) { // function cBlockArea::GetRelBlockTypeMeta() @@ -2385,6 +2416,37 @@ static int tolua_cBlockArea_GetRelBlockTypeMeta(lua_State * tolua_S) +static int tolua_cBlockArea_GetSize(lua_State * tolua_S) +{ + // function cBlockArea::GetSize() + // Returns all three sizes of the area + // Exported manually because there's no direct C++ equivalent, + // plus tolua would generate extra input params for the outputs + + cLuaState L(tolua_S); + if (!L.CheckParamUserType(1, "cBlockArea")) + { + return 0; + } + + cBlockArea * self = (cBlockArea *)tolua_tousertype(tolua_S, 1, NULL); + if (self == NULL) + { + tolua_error(tolua_S, "invalid 'self' in function 'cBlockArea:GetSize'", NULL); + return 0; + } + + // Push the three origin coords: + lua_pushnumber(tolua_S, self->GetSizeX()); + lua_pushnumber(tolua_S, self->GetSizeY()); + lua_pushnumber(tolua_S, self->GetSizeZ()); + return 3; +} + + + + + static int tolua_cBlockArea_LoadFromSchematicFile(lua_State * tolua_S) { // function cBlockArea::LoadFromSchematicFile @@ -2461,7 +2523,9 @@ void ManualBindings::Bind(lua_State * tolua_S) tolua_beginmodule(tolua_S, "cBlockArea"); tolua_function(tolua_S, "GetBlockTypeMeta", tolua_cBlockArea_GetBlockTypeMeta); + tolua_function(tolua_S, "GetOrigin", tolua_cBlockArea_GetOrigin); tolua_function(tolua_S, "GetRelBlockTypeMeta", tolua_cBlockArea_GetRelBlockTypeMeta); + tolua_function(tolua_S, "GetSize", tolua_cBlockArea_GetSize); tolua_function(tolua_S, "LoadFromSchematicFile", tolua_cBlockArea_LoadFromSchematicFile); tolua_function(tolua_S, "SaveToSchematicFile", tolua_cBlockArea_SaveToSchematicFile); tolua_endmodule(tolua_S); @@ -2511,6 +2575,10 @@ void ManualBindings::Bind(lua_State * tolua_S) tolua_function(tolua_S, "UpdateSign", tolua_cWorld_SetSignLines); tolua_endmodule(tolua_S); + tolua_beginmodule(tolua_S, "cMapManager"); + tolua_function(tolua_S, "DoWithMap", tolua_DoWithID<cMapManager, cMap, &cMapManager::DoWithMap>); + tolua_endmodule(tolua_S); + tolua_beginmodule(tolua_S, "cPlugin"); tolua_function(tolua_S, "Call", tolua_cPlugin_Call); tolua_endmodule(tolua_S); |