Reveal liquid help when taking/placing by bucket

This commit is contained in:
Wuzzy 2017-03-20 16:52:38 +01:00
parent 712f295edc
commit b6426df676
2 changed files with 11 additions and 0 deletions

View File

@ -1 +1,2 @@
mcl_core
doc

View File

@ -92,6 +92,9 @@ function bucket.register_liquid(source, flowing, itemname, inventory_image, name
return itemstack
end
place_liquid(pointed_thing.under, node, source, flowing, fullness)
if doc.entry_exists("nodes", source) then
doc.mark_entry_as_revealed(user:get_player_name(), "nodes", source)
end
else
-- not buildable to; place the liquid above
-- check if the node above can be replaced
@ -102,6 +105,9 @@ function bucket.register_liquid(source, flowing, itemname, inventory_image, name
return itemstack
end
place_liquid(pointed_thing.above, node, source, flowing, fullness)
if doc.entry_exists("nodes", source) then
doc.mark_entry_as_revealed(user:get_player_name(), "nodes", source)
end
else
-- do not remove the bucket with the liquid
return
@ -166,6 +172,10 @@ minetest.register_craftitem("bucket:bucket_empty", {
minetest.add_node(pointed_thing.under, {name="air"})
if doc.entry_exists("nodes", nn) then
doc.mark_entry_as_revealed(user:get_player_name(), "nodes", nn)
end
elseif nn == "mcl_cauldrons:cauldron_3" then
-- Take water out of full cauldron
minetest.set_node(pointed_thing.under, {name="mcl_cauldrons:cauldron"})