mirror of
https://git.minetest.land/Mineclonia/Mineclonia.git
synced 2024-11-28 07:32:59 +00:00
Add support for lava/water bucket in dispenser
This commit is contained in:
parent
35353c1d08
commit
2350752aca
1 changed files with 26 additions and 0 deletions
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue