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:
@@ -1210,9 +1210,10 @@ void Server::handleCommand_Interact(NetworkPacket* pkt)
|
||||
// If can't dig, try hand
|
||||
if (!params.diggable) {
|
||||
InventoryList *hlist = playersao->getInventory()->getList("hand");
|
||||
const ItemDefinition &hand =
|
||||
hlist ? hlist->getItem(0).getDefinition(m_itemdef) : m_itemdef->get("");
|
||||
const ToolCapabilities *tp = hand.tool_capabilities;
|
||||
const ToolCapabilities *tp = hlist
|
||||
? &hlist->getItem(0).getToolCapabilities(m_itemdef)
|
||||
: m_itemdef->get("").tool_capabilities;
|
||||
|
||||
if (tp)
|
||||
params = getDigParams(m_nodedef->get(n).groups, tp);
|
||||
}
|
||||
|
Reference in New Issue
Block a user