diff options
author | Mattes D <github@xoft.cz> | 2016-07-19 10:15:49 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2016-07-19 10:15:49 +0200 |
commit | c54691a3e578c0c33f0e196959a4c224883b1c93 (patch) | |
tree | bb258a4eb246e062e3ad9b3cfa2119411bb1d4ac /src/Bindings/ManualBindings.cpp | |
parent | Fixes for boat entities (#3265) (diff) | |
parent | CMake: Silenced CMP0054 policy warning. (diff) | |
download | cuberite-c54691a3e578c0c33f0e196959a4c224883b1c93.tar cuberite-c54691a3e578c0c33f0e196959a4c224883b1c93.tar.gz cuberite-c54691a3e578c0c33f0e196959a4c224883b1c93.tar.bz2 cuberite-c54691a3e578c0c33f0e196959a4c224883b1c93.tar.lz cuberite-c54691a3e578c0c33f0e196959a4c224883b1c93.tar.xz cuberite-c54691a3e578c0c33f0e196959a4c224883b1c93.tar.zst cuberite-c54691a3e578c0c33f0e196959a4c224883b1c93.zip |
Diffstat (limited to '')
-rw-r--r-- | src/Bindings/ManualBindings.cpp | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/src/Bindings/ManualBindings.cpp b/src/Bindings/ManualBindings.cpp index 1d735ac83..8bcd5a4e6 100644 --- a/src/Bindings/ManualBindings.cpp +++ b/src/Bindings/ManualBindings.cpp @@ -30,6 +30,7 @@ #include "../BlockEntities/NoteEntity.h" #include "../BlockEntities/MobHeadEntity.h" #include "../BlockEntities/FlowerPotEntity.h" +#include "../Generating/ChunkDesc.h" #include "../LineBlockTracer.h" #include "../WorldStorage/SchematicFileSerializer.h" #include "../CompositeChat.h" @@ -3443,6 +3444,33 @@ static int tolua_cBoundingBox_Intersect(lua_State * a_LuaState) +static int tolua_cChunkDesc_GetBlockTypeMeta(lua_State * a_LuaState) +{ + /* Function signature: + ChunkDesc:GetBlockTypeMeta(RelX, RelY, RelZ) -> BlockType, BlockMeta + */ + + cLuaState L(a_LuaState); + const cChunkDesc * self; + int relX, relY, relZ; + if (!L.GetStackValues(1, self, relX, relY, relZ)) + { + L.LogStackValues(); + tolua_error(a_LuaState, "Invalid function params. Expected chunkDesc:GetBlockTypeMeta(relX, relY, relZ)", nullptr); + return 0; + } + BLOCKTYPE blockType; + NIBBLETYPE blockMeta; + self->GetBlockTypeMeta(relX, relY, relZ, blockType, blockMeta); + L.Push(blockType); + L.Push(blockMeta); + return 2; +} + + + + + static int tolua_cCompositeChat_AddRunCommandPart(lua_State * tolua_S) { // function cCompositeChat:AddRunCommandPart(Message, Command, [Style]) @@ -3736,6 +3764,10 @@ void cManualBindings::Bind(lua_State * tolua_S) tolua_function(tolua_S, "Intersect", tolua_cBoundingBox_Intersect); tolua_endmodule(tolua_S); + tolua_beginmodule(tolua_S, "cChunkDesc"); + tolua_function(tolua_S, "GetBlockTypeMeta", tolua_cChunkDesc_GetBlockTypeMeta); + tolua_endmodule(tolua_S); + tolua_beginmodule(tolua_S, "cClientHandle"); tolua_constant(tolua_S, "MAX_VIEW_DISTANCE", cClientHandle::MAX_VIEW_DISTANCE); tolua_constant(tolua_S, "MIN_VIEW_DISTANCE", cClientHandle::MIN_VIEW_DISTANCE); |