summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authormadmaxoft <github@xoft.cz>2014-06-11 14:22:27 +0200
committermadmaxoft <github@xoft.cz>2014-06-11 14:22:27 +0200
commitb3300e3854861d6957f5dac30ce0c7b027a3e2ad (patch)
treed61832447700e0db38fcc5d2818d2c95fedfbc3d /src
parentRevert "Initial Mesa Bryce implementation." (diff)
downloadcuberite-b3300e3854861d6957f5dac30ce0c7b027a3e2ad.tar
cuberite-b3300e3854861d6957f5dac30ce0c7b027a3e2ad.tar.gz
cuberite-b3300e3854861d6957f5dac30ce0c7b027a3e2ad.tar.bz2
cuberite-b3300e3854861d6957f5dac30ce0c7b027a3e2ad.tar.lz
cuberite-b3300e3854861d6957f5dac30ce0c7b027a3e2ad.tar.xz
cuberite-b3300e3854861d6957f5dac30ce0c7b027a3e2ad.tar.zst
cuberite-b3300e3854861d6957f5dac30ce0c7b027a3e2ad.zip
Diffstat (limited to 'src')
-rw-r--r--src/Bindings/ManualBindings.cpp32
1 files changed, 32 insertions, 0 deletions
diff --git a/src/Bindings/ManualBindings.cpp b/src/Bindings/ManualBindings.cpp
index 14d9d16fc..acfd6f4f8 100644
--- a/src/Bindings/ManualBindings.cpp
+++ b/src/Bindings/ManualBindings.cpp
@@ -2538,6 +2538,37 @@ static int tolua_cBlockArea_GetSize(lua_State * tolua_S)
+static int tolua_cBlockArea_GetCoordRange(lua_State * tolua_S)
+{
+ // function cBlockArea::GetCoordRange()
+ // Returns all three sizes of the area, miuns one, so that they represent the maximum coord value
+ // 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() - 1);
+ lua_pushnumber(tolua_S, self->GetSizeY() - 1);
+ lua_pushnumber(tolua_S, self->GetSizeZ() - 1);
+ return 3;
+}
+
+
+
+
+
static int tolua_cBlockArea_LoadFromSchematicFile(lua_State * tolua_S)
{
// function cBlockArea::LoadFromSchematicFile
@@ -2926,6 +2957,7 @@ void ManualBindings::Bind(lua_State * tolua_S)
tolua_beginmodule(tolua_S, "cBlockArea");
tolua_function(tolua_S, "GetBlockTypeMeta", tolua_cBlockArea_GetBlockTypeMeta);
+ tolua_function(tolua_S, "GetCoordRange", tolua_cBlockArea_GetCoordRange);
tolua_function(tolua_S, "GetOrigin", tolua_cBlockArea_GetOrigin);
tolua_function(tolua_S, "GetRelBlockTypeMeta", tolua_cBlockArea_GetRelBlockTypeMeta);
tolua_function(tolua_S, "GetSize", tolua_cBlockArea_GetSize);