summaryrefslogtreecommitdiffstats
path: root/src/Bindings/DeprecatedBindings.cpp
diff options
context:
space:
mode:
authorMattes D <github@xoft.cz>2020-04-17 11:36:37 +0200
committerGitHub <noreply@github.com>2020-04-17 11:36:37 +0200
commit26ac146f41091dc070d8075f5fc9de25b5a22578 (patch)
tree5be089162a23ad2f2822be7b5d5d7cebbb958406 /src/Bindings/DeprecatedBindings.cpp
parentImplement glowing redstone ore (diff)
downloadcuberite-26ac146f41091dc070d8075f5fc9de25b5a22578.tar
cuberite-26ac146f41091dc070d8075f5fc9de25b5a22578.tar.gz
cuberite-26ac146f41091dc070d8075f5fc9de25b5a22578.tar.bz2
cuberite-26ac146f41091dc070d8075f5fc9de25b5a22578.tar.lz
cuberite-26ac146f41091dc070d8075f5fc9de25b5a22578.tar.xz
cuberite-26ac146f41091dc070d8075f5fc9de25b5a22578.tar.zst
cuberite-26ac146f41091dc070d8075f5fc9de25b5a22578.zip
Diffstat (limited to 'src/Bindings/DeprecatedBindings.cpp')
-rw-r--r--src/Bindings/DeprecatedBindings.cpp38
1 files changed, 38 insertions, 0 deletions
diff --git a/src/Bindings/DeprecatedBindings.cpp b/src/Bindings/DeprecatedBindings.cpp
index 63b5919ac..11b15a8c8 100644
--- a/src/Bindings/DeprecatedBindings.cpp
+++ b/src/Bindings/DeprecatedBindings.cpp
@@ -518,6 +518,43 @@ static int tolua_cWorld_SetSignLines(lua_State * tolua_S)
+/** function: cWorld:SetNextBlockTick */
+static int tolua_cWorld_SetNextBlockTick(lua_State * tolua_S)
+{
+ cLuaState LuaState(tolua_S);
+
+ if (
+ !LuaState.CheckParamUserType(1, "cWorld") ||
+ !LuaState.CheckParamNumber(2, 4) ||
+ !LuaState.CheckParamEnd(5)
+ )
+ {
+ return 0;
+ }
+
+ cWorld * Self = nullptr;
+ int BlockX = 0;
+ int BlockY = 0;
+ int BlockZ = 0;
+
+ if (!LuaState.GetStackValues(1, Self, BlockX, BlockY, BlockZ))
+ {
+ tolua_error(LuaState, "Failed to read parameters", nullptr);
+ }
+ if (Self == nullptr)
+ {
+ tolua_error(LuaState, "invalid 'self' in function 'SetNextBlockTick'", nullptr);
+ }
+ Self->SetNextBlockToTick({BlockX, BlockY, BlockZ});
+ LOGWARNING("Warning: 'cWorld:SetNextBlockTick' function is deprecated. Please use 'cWorld:SetNextBlockToTick' instead.");
+ LuaState.LogStackTrace(0);
+ return 1;
+}
+
+
+
+
+
void DeprecatedBindings::Bind(lua_State * tolua_S)
{
tolua_beginmodule(tolua_S, nullptr);
@@ -558,6 +595,7 @@ void DeprecatedBindings::Bind(lua_State * tolua_S)
tolua_endmodule(tolua_S);
tolua_beginmodule(tolua_S, "cWorld");
+ tolua_function(tolua_S, "SetNextBlockTick", tolua_cWorld_SetNextBlockTick);
tolua_function(tolua_S, "UpdateSign", tolua_cWorld_SetSignLines);
tolua_endmodule(tolua_S);