Added the meta data field "creator" for items created in creative mode to make it possible to verify the origin of items.

This commit is contained in:
Elias Fleckenstein 2020-05-29 11:35:00 +02:00
parent eb96c89b5d
commit 88786751fe
2 changed files with 7 additions and 1 deletions

View File

@ -152,6 +152,8 @@ minetest.register_on_player_receive_fields(function(player, formname, fields)
local inv = player:get_inventory()
local stack = ItemStack(clicked_item)
stack:set_count(stack:get_stack_max())
local meta = stack:get_meta()
meta:set_string("creator", player_name)
if inv:room_for_item("main", stack) then
inv:add_item("main", stack)
end

View File

@ -438,7 +438,11 @@ local function craftguide_giveme(player, formname, fields)
local player_inv = player:get_inventory()
player_inv:add_item("main", {name = output, count = amount})
local itemstack = ItemStack({name = output, count = amount})
local meta = itemstack:get_meta()
meta:set_string("creator", player_name)
player_inv:add_item("main", itemstack)
end
local function craftguide_craft(player, formname, fields)