diff options
author | KingCol13 <48412633+KingCol13@users.noreply.github.com> | 2020-10-01 23:33:32 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-10-01 23:33:32 +0200 |
commit | 8947147c25e2640519897bfdc8807e97ee291d70 (patch) | |
tree | 63eca1e5bd8ad29ac9beba5a780d466c9bb13849 /src/Bindings | |
parent | Add SetBlockMeta warning in documentation (#4943) (diff) | |
download | cuberite-8947147c25e2640519897bfdc8807e97ee291d70.tar cuberite-8947147c25e2640519897bfdc8807e97ee291d70.tar.gz cuberite-8947147c25e2640519897bfdc8807e97ee291d70.tar.bz2 cuberite-8947147c25e2640519897bfdc8807e97ee291d70.tar.lz cuberite-8947147c25e2640519897bfdc8807e97ee291d70.tar.xz cuberite-8947147c25e2640519897bfdc8807e97ee291d70.tar.zst cuberite-8947147c25e2640519897bfdc8807e97ee291d70.zip |
Diffstat (limited to 'src/Bindings')
-rw-r--r-- | src/Bindings/ManualBindings.cpp | 30 |
1 files changed, 29 insertions, 1 deletions
diff --git a/src/Bindings/ManualBindings.cpp b/src/Bindings/ManualBindings.cpp index 7f7cb8ea9..e62dab289 100644 --- a/src/Bindings/ManualBindings.cpp +++ b/src/Bindings/ManualBindings.cpp @@ -2746,6 +2746,33 @@ static int tolua_get_cItem_m_LoreTable(lua_State * tolua_S) +static int tolua_cItem_EnchantByXPLevels(lua_State * tolua_S) +{ + // Check params: + cLuaState L(tolua_S); + if ( + !L.CheckParamSelf("cItem") || + !L.CheckParamNumber(2) + ) + { + return 0; + } + + // Get the params: + cItem * Self; + int NumXPLevels; + L.GetStackValue(1, Self); + L.GetStackValue(2, NumXPLevels); + + // Call: + L.Push(Self->EnchantByXPLevels(NumXPLevels, GetRandomProvider())); + return 1; +} + + + + + static int tolua_set_cItem_m_LoreTable(lua_State * tolua_S) { // Check params: @@ -4420,7 +4447,8 @@ void cManualBindings::Bind(lua_State * tolua_S) tolua_endmodule(tolua_S); tolua_beginmodule(tolua_S, "cItem"); - tolua_variable(tolua_S, "m_LoreTable", tolua_get_cItem_m_LoreTable, tolua_set_cItem_m_LoreTable); + tolua_function(tolua_S, "EnchantByXPLevels", tolua_cItem_EnchantByXPLevels); + tolua_variable(tolua_S, "m_LoreTable", tolua_get_cItem_m_LoreTable, tolua_set_cItem_m_LoreTable); tolua_endmodule(tolua_S); tolua_beginmodule(tolua_S, "cItemGrid"); |