summaryrefslogtreecommitdiffstats
path: root/src/Bindings/ManualBindings.cpp
diff options
context:
space:
mode:
authorpeterbell10 <peterbell10@live.co.uk>2017-08-18 12:29:54 +0200
committerTiger Wang <ziwei.tiger@outlook.com>2017-08-18 12:29:54 +0200
commitb8dda388e0cf300f573d411dc670099e56c2e3c3 (patch)
tree6c3f40beb7a652f9c5afa560954e68a53db54401 /src/Bindings/ManualBindings.cpp
parentChanged type of FastRandom in monster drop calculation. (#3920) (diff)
downloadcuberite-b8dda388e0cf300f573d411dc670099e56c2e3c3.tar
cuberite-b8dda388e0cf300f573d411dc670099e56c2e3c3.tar.gz
cuberite-b8dda388e0cf300f573d411dc670099e56c2e3c3.tar.bz2
cuberite-b8dda388e0cf300f573d411dc670099e56c2e3c3.tar.lz
cuberite-b8dda388e0cf300f573d411dc670099e56c2e3c3.tar.xz
cuberite-b8dda388e0cf300f573d411dc670099e56c2e3c3.tar.zst
cuberite-b8dda388e0cf300f573d411dc670099e56c2e3c3.zip
Diffstat (limited to '')
-rw-r--r--src/Bindings/ManualBindings.cpp76
1 files changed, 66 insertions, 10 deletions
diff --git a/src/Bindings/ManualBindings.cpp b/src/Bindings/ManualBindings.cpp
index 2251c64b9..6fe133e1e 100644
--- a/src/Bindings/ManualBindings.cpp
+++ b/src/Bindings/ManualBindings.cpp
@@ -11,11 +11,6 @@
#include "PluginLua.h"
#include "PluginManager.h"
#include "LuaWindow.h"
-#include "../Root.h"
-#include "../World.h"
-#include "../Entities/Player.h"
-#include "../WebAdmin.h"
-#include "../ClientHandle.h"
#include "../BlockArea.h"
#include "../BlockEntities/BeaconEntity.h"
#include "../BlockEntities/BrewingstandEntity.h"
@@ -28,14 +23,20 @@
#include "../BlockEntities/NoteEntity.h"
#include "../BlockEntities/MobHeadEntity.h"
#include "../BlockEntities/FlowerPotEntity.h"
+#include "../BoundingBox.h"
+#include "../BuildInfo.h"
+#include "../ClientHandle.h"
+#include "../CommandOutput.h"
+#include "../CompositeChat.h"
+#include "../Entities/Player.h"
#include "../Generating/ChunkDesc.h"
+#include "../HTTP/UrlParser.h"
+#include "../Item.h"
#include "../LineBlockTracer.h"
-#include "../CompositeChat.h"
+#include "../Root.h"
#include "../StringCompression.h"
-#include "../CommandOutput.h"
-#include "../BuildInfo.h"
-#include "../HTTP/UrlParser.h"
-#include "../BoundingBox.h"
+#include "../WebAdmin.h"
+#include "../World.h"
@@ -2557,6 +2558,57 @@ static int tolua_cMojangAPI_MakeUUIDShort(lua_State * L)
+static int tolua_get_cItem_m_LoreTable(lua_State * tolua_S)
+{
+ // Check params:
+ cLuaState L(tolua_S);
+ if (!L.CheckParamSelf("const cItem"))
+ {
+ return 0;
+ }
+
+ // Get the params:
+ const cItem * Self = nullptr;
+ L.GetStackValue(1, Self);
+
+ // Push the result:
+ L.Push(Self->m_LoreTable);
+ return 1;
+}
+
+
+
+
+
+static int tolua_set_cItem_m_LoreTable(lua_State * tolua_S)
+{
+ // Check params:
+ cLuaState L(tolua_S);
+ if (
+ !L.CheckParamSelf("cItem") ||
+ !L.CheckParamTable(2)
+ )
+ {
+ return 0;
+ }
+
+ // Get the params:
+ cItem * Self = nullptr;
+ L.GetStackValue(1, Self);
+
+ // Set the value:
+ Self->m_LoreTable.clear();
+ if (!L.GetStackValue(2, Self->m_LoreTable))
+ {
+ return L.ApiParamError("cItem.m_LoreTable: Could not read value as an array of strings");
+ }
+ return 0;
+}
+
+
+
+
+
static int Lua_ItemGrid_GetSlotCoords(lua_State * L)
{
tolua_Error tolua_err;
@@ -3798,6 +3850,10 @@ void cManualBindings::Bind(lua_State * tolua_S)
tolua_function(tolua_S, "GetOutputBlockPos", tolua_cHopperEntity_GetOutputBlockPos);
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_endmodule(tolua_S);
+
tolua_beginmodule(tolua_S, "cItemGrid");
tolua_function(tolua_S, "GetSlotCoords", Lua_ItemGrid_GetSlotCoords);
tolua_endmodule(tolua_S);