Fix filling cauldrons with water.

When using a bucket of water on a cauldron, this would not fill the
cauldron as expected, but deposit a water source block on top of the
cauldron instead.

Applied patch from mineclone5 #38 (commit #
698c29733f06a7fcb7e755bf26ee46b33b00699b) from mineclone5 that fixes
this problem.
This commit is contained in:
kabou 2022-02-20 17:36:23 +01:00
parent c392fd0269
commit 584a75df76

@ -162,8 +162,11 @@ local function on_place_bucket(itemstack, user, pointed_thing, def)
local undernode = get_node(pointed_thing.under) local undernode = get_node(pointed_thing.under)
local abovenode = get_node(pointed_thing.above) local abovenode = get_node(pointed_thing.above)
local buildable1 = minetest.registered_nodes[undernode.name] and minetest.registered_nodes[undernode.name].buildable_to local name1, name2 = undernode.name, abovenode.name
local buildable2 = minetest.registered_nodes[abovenode.name] and minetest.registered_nodes[abovenode.name].buildable_to local regnode1, regnode2 = minetest.registered_nodes[name1], minetest.registered_nodes[name2]
local buildable1 = regnode1 and (regnode1.buildable_to or regnode1.groups.cauldron == 1)
local buildable2 = regnode2 and (regnode2.buildable_to or regnode2.groups.cauldron == 1)
if not buildable1 and not buildable2 then return itemstack end --if both nodes aren't buildable_to, skip if not buildable1 and not buildable2 then return itemstack end --if both nodes aren't buildable_to, skip
if buildable1 then if buildable1 then