From 2350752aca9f1f9d36d39777bfcdf65dd4c52d90 Mon Sep 17 00:00:00 2001 From: Wuzzy Date: Tue, 14 Feb 2017 03:53:50 +0100 Subject: [PATCH] Add support for lava/water bucket in dispenser --- mods/redstone/mcl_dispensers/init.lua | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/mods/redstone/mcl_dispensers/init.lua b/mods/redstone/mcl_dispensers/init.lua index c91e528cfa..4f6e704495 100644 --- a/mods/redstone/mcl_dispensers/init.lua +++ b/mods/redstone/mcl_dispensers/init.lua @@ -135,6 +135,32 @@ local dispenserdef = { stack:take_item() inv:set_stack("main", stack_id, stack) end + elseif iname == "bucket:bucket_water" or iname == "bucket:bucket_lava" then + -- Place water/lava source + if dropnodedef.buildable_to then + if iname == "bucket:bucket_water" then + minetest.set_node(droppos, {name = "mcl_core:water_source"}) + elseif iname == "bucket:bucket_lava" then + minetest.set_node(droppos, {name = "mcl_core:lava_source"}) + end + + stack:take_item() + inv:set_stack("main", stack_id, stack) + + if inv:room_for_item("main", "bucket:bucket_empty") then + inv:add_item("main", "bucket:bucket_empty") + else + minetest.add_item(droppos, dropitem) + end + end + elseif iname == "bucket:bucket_water" then + -- Place water source + if dropnodedef.buildable_to then + minetest.set_node(droppos, {name = "mcl_core:water_source"}) + + inv:set_stack("main", stack_id, "bucket:bucket_empty") + end + elseif igroups.head or igroups.shulker_box or iname == "mcl_farming:pumpkin_face" then -- Place head, shulker box, or pumpkin if dropnodedef.buildable_to then