summaryrefslogtreecommitdiffstats
path: root/src/Bindings/ManualBindings.cpp
diff options
context:
space:
mode:
authorMattes D <github@xoft.cz>2015-04-29 15:14:22 +0200
committerMattes D <github@xoft.cz>2015-04-29 15:14:22 +0200
commitfc95501f68b28f2fc595eb574546500c2713ef96 (patch)
tree4201e7e773b152aea800f1024bc0ea4bca28eeda /src/Bindings/ManualBindings.cpp
parentFix explosions trying to write to unread blockarea (diff)
downloadcuberite-fc95501f68b28f2fc595eb574546500c2713ef96.tar
cuberite-fc95501f68b28f2fc595eb574546500c2713ef96.tar.gz
cuberite-fc95501f68b28f2fc595eb574546500c2713ef96.tar.bz2
cuberite-fc95501f68b28f2fc595eb574546500c2713ef96.tar.lz
cuberite-fc95501f68b28f2fc595eb574546500c2713ef96.tar.xz
cuberite-fc95501f68b28f2fc595eb574546500c2713ef96.tar.zst
cuberite-fc95501f68b28f2fc595eb574546500c2713ef96.zip
Diffstat (limited to 'src/Bindings/ManualBindings.cpp')
-rw-r--r--src/Bindings/ManualBindings.cpp39
1 files changed, 39 insertions, 0 deletions
diff --git a/src/Bindings/ManualBindings.cpp b/src/Bindings/ManualBindings.cpp
index c4b12aa84..8e909827c 100644
--- a/src/Bindings/ManualBindings.cpp
+++ b/src/Bindings/ManualBindings.cpp
@@ -3187,6 +3187,44 @@ static int tolua_cBlockArea_GetOrigin(lua_State * tolua_S)
+static int tolua_cBlockArea_GetNonAirCropRelCoords(lua_State * tolua_S)
+{
+ // function cBlockArea::GetNonAirCropRelCoords()
+ // Exported manually because tolua would generate extra input params for the outputs
+
+ cLuaState L(tolua_S);
+ if (!L.CheckParamUserType(1, "cBlockArea"))
+ {
+ return 0;
+ }
+
+ cBlockArea * self = nullptr;
+ BLOCKTYPE IgnoreBlockType = E_BLOCK_AIR;
+ L.GetStackValues(1, self, IgnoreBlockType);
+ if (self == nullptr)
+ {
+ tolua_error(tolua_S, "invalid 'self' in function 'cBlockArea:GetNonAirCropRelCoords'", nullptr);
+ return 0;
+ }
+
+ // Calculate the crop coords:
+ int MinRelX, MinRelY, MinRelZ, MaxRelX, MaxRelY, MaxRelZ;
+ self->GetNonAirCropRelCoords(MinRelX, MinRelY, MinRelZ, MaxRelX, MaxRelY, MaxRelZ, IgnoreBlockType);
+
+ // Push the six crop coords:
+ L.Push(MinRelX);
+ L.Push(MinRelY);
+ L.Push(MinRelZ);
+ L.Push(MaxRelX);
+ L.Push(MaxRelY);
+ L.Push(MaxRelZ);
+ return 6;
+}
+
+
+
+
+
static int tolua_cBlockArea_GetRelBlockTypeMeta(lua_State * tolua_S)
{
// function cBlockArea::GetRelBlockTypeMeta()
@@ -3687,6 +3725,7 @@ void ManualBindings::Bind(lua_State * tolua_S)
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, "GetNonAirCropRelCoords", tolua_cBlockArea_GetNonAirCropRelCoords);
tolua_function(tolua_S, "GetRelBlockTypeMeta", tolua_cBlockArea_GetRelBlockTypeMeta);
tolua_function(tolua_S, "GetSize", tolua_cBlockArea_GetSize);
tolua_function(tolua_S, "LoadFromSchematicFile", tolua_cBlockArea_LoadFromSchematicFile);