From b6426df676c80e582b752201bbd35318a83d5c82 Mon Sep 17 00:00:00 2001 From: Wuzzy Date: Mon, 20 Mar 2017 16:52:38 +0100 Subject: [PATCH] Reveal liquid help when taking/placing by bucket --- mods/ITEMS/bucket/depends.txt | 1 + mods/ITEMS/bucket/init.lua | 10 ++++++++++ 2 files changed, 11 insertions(+) diff --git a/mods/ITEMS/bucket/depends.txt b/mods/ITEMS/bucket/depends.txt index 315237e0..a8c3aec1 100644 --- a/mods/ITEMS/bucket/depends.txt +++ b/mods/ITEMS/bucket/depends.txt @@ -1 +1,2 @@ mcl_core +doc diff --git a/mods/ITEMS/bucket/init.lua b/mods/ITEMS/bucket/init.lua index 572e2258..8d9d97f0 100644 --- a/mods/ITEMS/bucket/init.lua +++ b/mods/ITEMS/bucket/init.lua @@ -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"})