forked from Mirrorlandia_minetest/minetest
Fix wrong checked node names in bucket
This commit is contained in:
parent
5c24450e54
commit
2b8b2a4f30
@ -21,11 +21,11 @@ minetest.register_craftitem("bucket:bucket_empty", {
|
|||||||
on_use = function(item, player, pointed_thing)
|
on_use = function(item, player, pointed_thing)
|
||||||
if pointed_thing.type == "node" then
|
if pointed_thing.type == "node" then
|
||||||
n = minetest.env:get_node(pointed_thing.under)
|
n = minetest.env:get_node(pointed_thing.under)
|
||||||
if n.name == "water_source" then
|
if n.name == "default:water_source" then
|
||||||
minetest.env:add_node(pointed_thing.under, {name="air"})
|
minetest.env:add_node(pointed_thing.under, {name="air"})
|
||||||
player:add_to_inventory_later('craft "bucket:bucket_water" 1')
|
player:add_to_inventory_later('craft "bucket:bucket_water" 1')
|
||||||
return true
|
return true
|
||||||
elseif n.name == "lava_source" then
|
elseif n.name == "default:lava_source" then
|
||||||
minetest.env:add_node(pointed_thing.under, {name="air"})
|
minetest.env:add_node(pointed_thing.under, {name="air"})
|
||||||
player:add_to_inventory_later('craft "bucket:bucket_lava" 1')
|
player:add_to_inventory_later('craft "bucket:bucket_lava" 1')
|
||||||
return true
|
return true
|
||||||
@ -43,12 +43,12 @@ minetest.register_craftitem("bucket:bucket_water", {
|
|||||||
on_use = function(item, player, pointed_thing)
|
on_use = function(item, player, pointed_thing)
|
||||||
if pointed_thing.type == "node" then
|
if pointed_thing.type == "node" then
|
||||||
n = minetest.env:get_node(pointed_thing.under)
|
n = minetest.env:get_node(pointed_thing.under)
|
||||||
if n.name == "water_source" then
|
if n.name == "default:water_source" then
|
||||||
-- unchanged
|
-- unchanged
|
||||||
elseif n.name == "water_flowing" or n.name == "lava_source" or n.name == "lava_flowing" then
|
elseif n.name == "default:water_flowing" or n.name == "default:lava_source" or n.name == "default:lava_flowing" then
|
||||||
minetest.env:add_node(pointed_thing.under, {name="water_source"})
|
minetest.env:add_node(pointed_thing.under, {name="default:water_source"})
|
||||||
else
|
else
|
||||||
minetest.env:add_node(pointed_thing.above, {name="water_source"})
|
minetest.env:add_node(pointed_thing.above, {name="default:water_source"})
|
||||||
end
|
end
|
||||||
player:add_to_inventory_later('craft "bucket:bucket_empty" 1')
|
player:add_to_inventory_later('craft "bucket:bucket_empty" 1')
|
||||||
return true
|
return true
|
||||||
@ -65,12 +65,12 @@ minetest.register_craftitem("bucket:bucket_lava", {
|
|||||||
on_use = function(item, player, pointed_thing)
|
on_use = function(item, player, pointed_thing)
|
||||||
if pointed_thing.type == "node" then
|
if pointed_thing.type == "node" then
|
||||||
n = minetest.env:get_node(pointed_thing.under)
|
n = minetest.env:get_node(pointed_thing.under)
|
||||||
if n.name == "lava_source" then
|
if n.name == "default:lava_source" then
|
||||||
-- unchanged
|
-- unchanged
|
||||||
elseif n.name == "water_source" or n.name == "water_flowing" or n.name == "lava_flowing" then
|
elseif n.name == "default:water_source" or n.name == "default:water_flowing" or n.name == "default:lava_flowing" then
|
||||||
minetest.env:add_node(pointed_thing.under, {name="lava_source"})
|
minetest.env:add_node(pointed_thing.under, {name="default:lava_source"})
|
||||||
else
|
else
|
||||||
minetest.env:add_node(pointed_thing.above, {name="lava_source"})
|
minetest.env:add_node(pointed_thing.above, {name="default:lava_source"})
|
||||||
end
|
end
|
||||||
player:add_to_inventory_later('craft "bucket:bucket_empty" 1')
|
player:add_to_inventory_later('craft "bucket:bucket_empty" 1')
|
||||||
return true
|
return true
|
||||||
|
Loading…
Reference in New Issue
Block a user