From be5152345947011b07a963e33ced9a1e2c591715 Mon Sep 17 00:00:00 2001 From: Wuzzy Date: Thu, 30 Nov 2017 14:57:40 +0100 Subject: [PATCH] Add water_bucket group --- GROUPS.md | 1 + mods/ITEMS/mcl_buckets/init.lua | 10 +++++++--- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/GROUPS.md b/GROUPS.md index 94ef54b396..0b73a870d9 100644 --- a/GROUPS.md +++ b/GROUPS.md @@ -73,6 +73,7 @@ Please read to learn how digging times * `wool=1`: Wool (only full blocks) * `carpet=1:` (Wool) carpet * `stick=1`: Stick +* `water_bucket=1`: Bucket containing a liquid of group “water” ### Material groups diff --git a/mods/ITEMS/mcl_buckets/init.lua b/mods/ITEMS/mcl_buckets/init.lua index c8a1445409..d67cf07ba4 100644 --- a/mods/ITEMS/mcl_buckets/init.lua +++ b/mods/ITEMS/mcl_buckets/init.lua @@ -48,9 +48,10 @@ end -- longdesc = long explanatory description (for help) -- usagehelp = short usage explanation (for help) -- extra_check = optional function(pos) which can returns false to avoid placing the liquid +-- groups = optional list of item groups -- -- This function can be called from any mod (which depends on this one) -function mcl_buckets.register_liquid(source_place, source_take, itemname, inventory_image, name, longdesc, usagehelp, extra_check) +function mcl_buckets.register_liquid(source_place, source_take, itemname, inventory_image, name, longdesc, usagehelp, extra_check, groups) for i=1, #source_take do mcl_buckets.liquids[source_take[i]] = { source_place = source_place, @@ -70,6 +71,7 @@ function mcl_buckets.register_liquid(source_place, source_take, itemname, invent inventory_image = inventory_image, stack_max = 16, liquids_pointable = true, + groups = groups, on_place = function(itemstack, user, pointed_thing) -- Must be pointing to node if pointed_thing.type ~= "node" then @@ -276,7 +278,8 @@ if mod_mcl_core then return false end end - end + end, + { water_bucket = 1 } ) end @@ -306,7 +309,8 @@ if mod_mclx_core then minetest.sound_play("fire_extinguish_flame", {pos = pos, gain = 0.25, max_hear_distance = 16}) return false end - end + end, + { water_bucket = 1 } ) end