From a637107a4e81be88938d68df4deae50e68cf2cd8 Mon Sep 17 00:00:00 2001 From: raymoo Date: Tue, 18 Apr 2017 16:30:27 -0700 Subject: Allow overriding tool capabilities through itemstack metadata This makes it possible to modify the tool capabilities of individual itemstacks by calling a method on itemstack metadata references. --- src/script/lua_api/l_itemstackmeta.h | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'src/script/lua_api/l_itemstackmeta.h') diff --git a/src/script/lua_api/l_itemstackmeta.h b/src/script/lua_api/l_itemstackmeta.h index 241f04c4c..46c40ab30 100644 --- a/src/script/lua_api/l_itemstackmeta.h +++ b/src/script/lua_api/l_itemstackmeta.h @@ -40,7 +40,18 @@ private: virtual void reportMetadataChange(); + void setToolCapabilities(const ToolCapabilities &caps) + { + istack->metadata.setToolCapabilities(caps); + } + + void clearToolCapabilities() + { + istack->metadata.clearToolCapabilities(); + } + // Exported functions + static int l_set_tool_capabilities(lua_State *L); // garbage collector static int gc_object(lua_State *L); -- cgit v1.2.3