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
|
@ -23,6 +23,7 @@ with this program; if not, write to the Free Software Foundation, Inc.,
|
|||
#include <string>
|
||||
#include <iostream>
|
||||
#include "itemgroup.h"
|
||||
#include <json/json.h>
|
||||
|
||||
struct ToolGroupCap
|
||||
{
|
||||
|
@ -42,6 +43,9 @@ struct ToolGroupCap
|
|||
*time = i->second;
|
||||
return true;
|
||||
}
|
||||
|
||||
void toJson(Json::Value &object) const;
|
||||
void fromJson(const Json::Value &json);
|
||||
};
|
||||
|
||||
|
||||
|
@ -69,6 +73,8 @@ struct ToolCapabilities
|
|||
|
||||
void serialize(std::ostream &os, u16 version) const;
|
||||
void deSerialize(std::istream &is);
|
||||
void serializeJson(std::ostream &os) const;
|
||||
void deserializeJson(std::istream &is);
|
||||
};
|
||||
|
||||
struct DigParams
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue