diff options
author | Wuzzy <almikes@aol.com> | 2016-09-01 14:53:35 +0200 |
---|---|---|
committer | Wuzzy <almikes@aol.com> | 2016-09-01 14:53:35 +0200 |
commit | 01bc7eb8bfefc931a8ad3d8bd95f603ca9707b0d (patch) | |
tree | 40876821d833b1285ee5f3616e5d23c30c3522fa | |
parent | f0dccbda5cba7290ceee0662e9cc4ccd5681fdbc (diff) |
Reveal item items and their leftovers
-rw-r--r-- | init.lua | 11 |
1 files changed, 9 insertions, 2 deletions
@@ -1007,12 +1007,19 @@ minetest.register_on_punchnode(function(pos, node, puncher, pointed_thing) reveal_item(puncher:get_player_name(), node.name) end) +minetest.register_on_placenode(function(pos, newnode, placer, oldnode, itemstack, pointed_thing) + reveal_item(placer:get_player_name(), itemstack:get_name()) +end) + minetest.register_on_craft(function(itemstack, player, old_craft_grid, craft_inv) reveal_item(player:get_player_name(), itemstack:get_name()) end) -minetest.register_on_placenode(function(pos, newnode, placer, oldnode, itemstack, pointed_thing) - reveal_item(placer:get_player_name(), itemstack:get_name()) +minetest.register_on_item_eat(function(hp_change, replace_with_item, itemstack, user, pointed_thing) + reveal_item(user:get_player_name(), itemstack:get_name()) + if replace_with_item ~= nil then + reveal_item(user:get_player_name(), replace_with_item) + end end) minetest.register_on_joinplayer(function(player) |