summaryrefslogtreecommitdiffstats
path: root/src/Bindings/ManualBindings.cpp
diff options
context:
space:
mode:
authorHowaner <franzi.moos@googlemail.com>2014-06-17 19:03:56 +0200
committerHowaner <franzi.moos@googlemail.com>2014-06-17 19:03:56 +0200
commitc60ba8a52d6f84316eae041a24e395a4c37ae181 (patch)
treeedb983f4b20312115bc1033a2bd5a89c615ed30e /src/Bindings/ManualBindings.cpp
parentCheck block type from cBlockEntity (diff)
parentMerge pull request #1099 from Howaner/Blocks (diff)
downloadcuberite-c60ba8a52d6f84316eae041a24e395a4c37ae181.tar
cuberite-c60ba8a52d6f84316eae041a24e395a4c37ae181.tar.gz
cuberite-c60ba8a52d6f84316eae041a24e395a4c37ae181.tar.bz2
cuberite-c60ba8a52d6f84316eae041a24e395a4c37ae181.tar.lz
cuberite-c60ba8a52d6f84316eae041a24e395a4c37ae181.tar.xz
cuberite-c60ba8a52d6f84316eae041a24e395a4c37ae181.tar.zst
cuberite-c60ba8a52d6f84316eae041a24e395a4c37ae181.zip
Diffstat (limited to 'src/Bindings/ManualBindings.cpp')
-rw-r--r--src/Bindings/ManualBindings.cpp36
1 files changed, 34 insertions, 2 deletions
diff --git a/src/Bindings/ManualBindings.cpp b/src/Bindings/ManualBindings.cpp
index 10e560ac0..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
@@ -2864,8 +2895,8 @@ static int tolua_cCompositeChat_SetMessageType(lua_State * tolua_S)
}
// Set the type:
- int MessageType;
- L.GetStackValue(1, MessageType);
+ int MessageType = mtCustom;
+ L.GetStackValue(2, MessageType);
self->SetMessageType((eMessageType)MessageType);
// Cut away everything from the stack except for the cCompositeChat instance; return that:
@@ -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);