1
0
mirror of https://github.com/luanti-org/luanti.git synced 2025-10-13 08:35:20 +02: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:
raymoo
2017-04-18 16:30:27 -07:00
committed by paramat
parent 610ea6f216
commit a637107a4e
10 changed files with 206 additions and 14 deletions

View File

@@ -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