mirror of
https://git.minetest.land/MineClone2/MineClone2.git
synced 2024-12-25 19:02:26 +01:00
Item frames no longer have an owner
This commit is contained in:
parent
a79c2ade05
commit
c4dbbc9147
@ -109,15 +109,9 @@ minetest.register_node("itemframes:frame",{
|
||||
sunlight_propagates = true,
|
||||
groups = { dig_immediate=3,deco_block=1,dig_by_piston=1},
|
||||
sounds = mcl_sounds.node_sound_defaults(),
|
||||
after_place_node = function(pos, placer, itemstack)
|
||||
local meta = minetest.get_meta(pos)
|
||||
meta:set_string("owner",placer:get_player_name())
|
||||
meta:set_string("infotext","Item frame (owned by "..placer:get_player_name()..")")
|
||||
end,
|
||||
on_rightclick = function(pos, node, clicker, itemstack)
|
||||
if not itemstack then return end
|
||||
local meta = minetest.get_meta(pos)
|
||||
if clicker:get_player_name() == meta:get_string("owner") then
|
||||
drop_item(pos, node, meta)
|
||||
-- item holds the itemstring
|
||||
meta:set_string("item", itemstack:get_name())
|
||||
@ -130,7 +124,6 @@ minetest.register_node("itemframes:frame",{
|
||||
if not minetest.settings:get_bool("creative_mode") then
|
||||
itemstack:take_item()
|
||||
end
|
||||
end
|
||||
return itemstack
|
||||
end,
|
||||
on_destruct = function(pos)
|
||||
@ -138,11 +131,6 @@ minetest.register_node("itemframes:frame",{
|
||||
local node = minetest.get_node(pos)
|
||||
drop_item(pos, node, meta)
|
||||
end,
|
||||
can_dig = function(pos,player)
|
||||
|
||||
local meta = minetest.get_meta(pos)
|
||||
return player:get_player_name() == meta:get_string("owner")
|
||||
end,
|
||||
on_rotate = on_rotate,
|
||||
})
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user