Bucket can replace only nodes which are buildable_to
This commit is contained in:
parent
80faa966cf
commit
c134ddc953
@ -23,18 +23,16 @@ function buckets.register_liquid(name, source, flowing, itemname, inventory_imag
|
|||||||
if pointed_thing.type ~= "node" then
|
if pointed_thing.type ~= "node" then
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
-- Check if pointing to a liquid
|
|
||||||
n = minetest.env:get_node(pointed_thing.under)
|
n = minetest.env:get_node(pointed_thing.under)
|
||||||
if buckets.liquids[n.name] == nil then
|
if minetest.registered_nodes[n.name].buildable_to then
|
||||||
-- Not a liquid
|
minetest.env:add_node(pointed_thing.under, {name=source})
|
||||||
if minetest.env:get_node(pointed_thing.above).name == "air" then
|
else
|
||||||
|
n = minetest.env:get_node(pointed_thing.above)
|
||||||
|
if minetest.registered_nodes[n.name].buildable_to then
|
||||||
minetest.env:add_node(pointed_thing.above, {name=source})
|
minetest.env:add_node(pointed_thing.above, {name=source})
|
||||||
else
|
else
|
||||||
return itemstack
|
return
|
||||||
end
|
end
|
||||||
elseif n.name ~= source then
|
|
||||||
-- It's a liquid
|
|
||||||
minetest.env:add_node(pointed_thing.under, {name=source})
|
|
||||||
end
|
end
|
||||||
return {name="instruments:bucket_empty_"..metals.list[i]}
|
return {name="instruments:bucket_empty_"..metals.list[i]}
|
||||||
end
|
end
|
||||||
|
Loading…
x
Reference in New Issue
Block a user