mirror of
https://github.com/minetest/minetest_game.git
synced 2025-06-30 05:40:24 +02:00
Keys: Show owner in description
Utilizes several new features allowing the description of an item to be changed using the `description` meta key. This also moves keys from using the old single-value itemstack metadata system to the new node-like metadata system.
This commit is contained in:
@ -410,9 +410,10 @@ minetest.register_tool("default:skeleton_key", {
|
||||
-- finish and return the new key
|
||||
itemstack:take_item()
|
||||
itemstack:add_item("default:key")
|
||||
itemstack:set_metadata(minetest.write_json({
|
||||
secret = secret
|
||||
}))
|
||||
local meta = itemstack:get_meta()
|
||||
meta:set_string("secret", secret)
|
||||
meta:set_string("description", "Key to "..placer:get_player_name().."'s "
|
||||
..minetest.registered_nodes[node.name].description)
|
||||
return itemstack
|
||||
end
|
||||
end
|
||||
|
Reference in New Issue
Block a user