mirror of
https://github.com/luanti-org/luanti.git
synced 2025-06-27 16:36:03 +00:00
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.
This commit is contained in:
parent
610ea6f216
commit
a637107a4e
10 changed files with 206 additions and 14 deletions
|
@ -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);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue