mirror of
https://git.minetest.land/VoxeLibre/VoxeLibre.git
synced 2024-11-22 02:21:06 +01:00
Fix adding water bottles and emptying full cauldrons
This commit is contained in:
parent
91cecca135
commit
7e832dc641
2 changed files with 6 additions and 8 deletions
|
@ -209,7 +209,7 @@ local function on_place_bucket_empty(itemstack, user, pointed_thing)
|
|||
|
||||
-- Call on_rightclick if the pointed node defines it
|
||||
local new_stack = mcl_util.call_on_rightclick(itemstack, user, pointed_thing)
|
||||
if new_stack then
|
||||
if new_stack and new_stack ~= itemstack then
|
||||
return new_stack
|
||||
end
|
||||
|
||||
|
|
|
@ -226,10 +226,9 @@ local function water_bottle_on_place(itemstack, placer, pointed_thing)
|
|||
local def = minetest.registered_nodes[node.name]
|
||||
|
||||
-- Call on_rightclick if the pointed node defines it
|
||||
if placer and not placer:get_player_control().sneak then
|
||||
if def and def.on_rightclick then
|
||||
return def.on_rightclick(pointed_thing.under, node, placer, itemstack) or itemstack
|
||||
end
|
||||
local new_stack = mcl_util.call_on_rightclick(itemstack, placer, pointed_thing)
|
||||
if new_stack and new_stack ~= itemstack then
|
||||
return new_stack
|
||||
end
|
||||
|
||||
local cauldron = nil
|
||||
|
@ -239,11 +238,10 @@ local function water_bottle_on_place(itemstack, placer, pointed_thing)
|
|||
cauldron = fill_cauldron(node.name, "mclx_core:river_water_source")
|
||||
end
|
||||
|
||||
|
||||
if cauldron then
|
||||
set_node_empty_bottle(itemstack, placer, pointed_thing, cauldron)
|
||||
return set_node_empty_bottle(itemstack, placer, pointed_thing, cauldron)
|
||||
elseif node.name == "mcl_core:dirt" or node.name == "mcl_core:coarse_dirt" then
|
||||
set_node_empty_bottle(itemstack, placer, pointed_thing, "mcl_mud:mud")
|
||||
return set_node_empty_bottle(itemstack, placer, pointed_thing, "mcl_mud:mud")
|
||||
end
|
||||
end
|
||||
|
||||
|
|
Loading…
Reference in a new issue