2011-11-29 10:44:07 -05:00
|
|
|
minetest.register_craft({
|
2011-12-03 04:41:52 -05:00
|
|
|
output = 'craft "bucket:bucket_empty" 1',
|
2011-11-29 10:44:07 -05:00
|
|
|
recipe = {
|
2011-12-02 05:12:07 -05:00
|
|
|
{'craft "steel_ingot"', '', 'craft "steel_ingot"'},
|
|
|
|
{'', 'craft "steel_ingot"', ''},
|
2011-11-29 10:44:07 -05:00
|
|
|
}
|
|
|
|
})
|
|
|
|
|
2011-12-03 04:41:52 -05:00
|
|
|
minetest.register_craftitem("bucket:bucket_empty", {
|
2011-11-29 10:44:07 -05:00
|
|
|
image = "bucket.png",
|
|
|
|
stack_max = 1,
|
|
|
|
liquids_pointable = true,
|
2011-11-30 16:52:02 -05:00
|
|
|
on_place_on_ground = minetest.craftitem_place_item,
|
2011-11-29 10:44:07 -05:00
|
|
|
on_use = function(item, player, pointed_thing)
|
|
|
|
if pointed_thing.type == "node" then
|
|
|
|
n = minetest.env:get_node(pointed_thing.under)
|
|
|
|
if n.name == "water_source" then
|
|
|
|
minetest.env:add_node(pointed_thing.under, {name="air"})
|
2011-12-03 04:41:52 -05:00
|
|
|
player:add_to_inventory_later('craft "bucket:bucket_water" 1')
|
2011-11-29 10:44:07 -05:00
|
|
|
return true
|
|
|
|
elseif n.name == "lava_source" then
|
|
|
|
minetest.env:add_node(pointed_thing.under, {name="air"})
|
2011-12-03 04:41:52 -05:00
|
|
|
player:add_to_inventory_later('craft "bucket:bucket_lava" 1')
|
2011-11-29 10:44:07 -05:00
|
|
|
return true
|
|
|
|
end
|
|
|
|
end
|
|
|
|
return false
|
|
|
|
end,
|
|
|
|
})
|
|
|
|
|
2011-12-03 04:41:52 -05:00
|
|
|
minetest.register_craftitem("bucket:bucket_water", {
|
2011-12-03 10:40:58 -05:00
|
|
|
image = "bucket_water.png",
|
2011-11-29 10:44:07 -05:00
|
|
|
stack_max = 1,
|
|
|
|
liquids_pointable = true,
|
2011-11-30 16:52:02 -05:00
|
|
|
on_place_on_ground = minetest.craftitem_place_item,
|
2011-11-29 10:44:07 -05:00
|
|
|
on_use = function(item, player, pointed_thing)
|
|
|
|
if pointed_thing.type == "node" then
|
|
|
|
n = minetest.env:get_node(pointed_thing.under)
|
|
|
|
if n.name == "water_source" then
|
|
|
|
-- unchanged
|
|
|
|
elseif n.name == "water_flowing" or n.name == "lava_source" or n.name == "lava_flowing" then
|
|
|
|
minetest.env:add_node(pointed_thing.under, {name="water_source"})
|
|
|
|
else
|
|
|
|
minetest.env:add_node(pointed_thing.above, {name="water_source"})
|
|
|
|
end
|
2011-12-03 04:41:52 -05:00
|
|
|
player:add_to_inventory_later('craft "bucket:bucket_empty" 1')
|
2011-11-29 10:44:07 -05:00
|
|
|
return true
|
|
|
|
end
|
|
|
|
return false
|
|
|
|
end,
|
|
|
|
})
|
|
|
|
|
2011-12-03 04:41:52 -05:00
|
|
|
minetest.register_craftitem("bucket:bucket_lava", {
|
2011-12-03 10:40:58 -05:00
|
|
|
image = "bucket_lava.png",
|
2011-11-29 10:44:07 -05:00
|
|
|
stack_max = 1,
|
|
|
|
liquids_pointable = true,
|
2011-11-30 16:52:02 -05:00
|
|
|
on_place_on_ground = minetest.craftitem_place_item,
|
2011-11-29 10:44:07 -05:00
|
|
|
on_use = function(item, player, pointed_thing)
|
|
|
|
if pointed_thing.type == "node" then
|
|
|
|
n = minetest.env:get_node(pointed_thing.under)
|
|
|
|
if n.name == "lava_source" then
|
|
|
|
-- unchanged
|
|
|
|
elseif n.name == "water_source" or n.name == "water_flowing" or n.name == "lava_flowing" then
|
|
|
|
minetest.env:add_node(pointed_thing.under, {name="lava_source"})
|
|
|
|
else
|
|
|
|
minetest.env:add_node(pointed_thing.above, {name="lava_source"})
|
|
|
|
end
|
2011-12-03 04:41:52 -05:00
|
|
|
player:add_to_inventory_later('craft "bucket:bucket_empty" 1')
|
2011-11-29 10:44:07 -05:00
|
|
|
return true
|
|
|
|
end
|
|
|
|
return false
|
|
|
|
end,
|
|
|
|
})
|