forked from VoxeLibre/VoxeLibre
Merge pull request 'Fix Cauldrons' (#4615) from fix-cauldrons into master
Reviewed-on: VoxeLibre/VoxeLibre#4615 Reviewed-by: Mikita Wiśniewski <rudzik8@protonmail.com>
This commit is contained in:
commit
a3cc105fa1
|
@ -209,7 +209,7 @@ local function on_place_bucket_empty(itemstack, user, pointed_thing)
|
||||||
|
|
||||||
-- Call on_rightclick if the pointed node defines it
|
-- Call on_rightclick if the pointed node defines it
|
||||||
local new_stack = mcl_util.call_on_rightclick(itemstack, user, pointed_thing)
|
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
|
return new_stack
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
@ -61,10 +61,9 @@ minetest.register_craftitem("mcl_potions:glass_bottle", {
|
||||||
local def = minetest.registered_nodes[node.name]
|
local def = minetest.registered_nodes[node.name]
|
||||||
|
|
||||||
-- Call on_rightclick if the pointed node defines it
|
-- Call on_rightclick if the pointed node defines it
|
||||||
if placer and not placer:get_player_control().sneak then
|
local new_stack = mcl_util.call_on_rightclick(itemstack, placer, pointed_thing)
|
||||||
if def and def.on_rightclick then
|
if new_stack and new_stack ~= itemstack then
|
||||||
return def.on_rightclick(pointed_thing.under, node, placer, itemstack) or itemstack
|
return new_stack
|
||||||
end
|
|
||||||
end
|
end
|
||||||
|
|
||||||
-- Try to fill glass bottle with water
|
-- Try to fill glass bottle with water
|
||||||
|
@ -226,10 +225,9 @@ local function water_bottle_on_place(itemstack, placer, pointed_thing)
|
||||||
local def = minetest.registered_nodes[node.name]
|
local def = minetest.registered_nodes[node.name]
|
||||||
|
|
||||||
-- Call on_rightclick if the pointed node defines it
|
-- Call on_rightclick if the pointed node defines it
|
||||||
if placer and not placer:get_player_control().sneak then
|
local new_stack = mcl_util.call_on_rightclick(itemstack, placer, pointed_thing)
|
||||||
if def and def.on_rightclick then
|
if new_stack and new_stack ~= itemstack then
|
||||||
return def.on_rightclick(pointed_thing.under, node, placer, itemstack) or itemstack
|
return new_stack
|
||||||
end
|
|
||||||
end
|
end
|
||||||
|
|
||||||
local cauldron = nil
|
local cauldron = nil
|
||||||
|
@ -239,11 +237,10 @@ local function water_bottle_on_place(itemstack, placer, pointed_thing)
|
||||||
cauldron = fill_cauldron(node.name, "mclx_core:river_water_source")
|
cauldron = fill_cauldron(node.name, "mclx_core:river_water_source")
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
if cauldron then
|
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
|
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
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue