diff --git a/mods/default/crafting.lua b/mods/default/crafting.lua index c6ed14b..6538436 100644 --- a/mods/default/crafting.lua +++ b/mods/default/crafting.lua @@ -714,11 +714,45 @@ minetest.register_craftitem( end }) +minetest.register_craftitem( + "default:bucket_river_water", + { + description = "River Water Bucket", + inventory_image = "default_bucket_river_water.png", + stack_max = 1, + wield_scale = {x=1,y=1,z=2}, + liquids_pointable = true, + on_place = function(itemstack, user, pointed_thing) + if pointed_thing.type ~= "node" then return end + + itemstack:take_item() + + local inv=user:get_inventory() + + if inv:room_for_item("main", {name="default:bucket"}) then + inv:add_item("main", "default:bucket") + else + local pos = user:getpos() + pos.y = math.floor(pos.y + 0.5) + minetest.add_item(pos, "default:bucket") + end + + local pos = pointed_thing.above + if minetest.registered_nodes[minetest.get_node(pointed_thing.under).name].buildable_to then + pos=pointed_thing.under + end + minetest.add_node(pos, {name = "default:river_water_source"}) + + return itemstack + end + }) + minetest.register_craftitem( "default:bucket", { description = "Empty Bucket", inventory_image = "default_bucket.png", + stack_max = 10, wield_scale = {x=1,y=1,z=2}, liquids_pointable = true, on_use = function(itemstack, user, pointed_thing) @@ -739,6 +773,20 @@ minetest.register_craftitem( minetest.add_item(pos, "default:bucket_water") end + minetest.remove_node(pointed_thing.under) + elseif nodename == "default:river_water_source" then + itemstack:take_item() + + local inv=user:get_inventory() + + if inv:room_for_item("main", {name="default:bucket_river_water"}) then + inv:add_item("main", "default:bucket_river_water") + else + local pos = user:getpos() + pos.y = math.floor(pos.y + 0.5) + minetest.add_item(pos, "default:bucket_river_water") + end + minetest.remove_node(pointed_thing.under) end diff --git a/mods/default/nodes.lua b/mods/default/nodes.lua index e15a514..8aed921 100644 --- a/mods/default/nodes.lua +++ b/mods/default/nodes.lua @@ -692,7 +692,9 @@ minetest.register_node( liquid_alternative_flowing = "default:river_water_flowing", liquid_alternative_source = "default:river_water_source", liquid_viscosity = default.RIVER_WATER_VISC, - post_effect_color = {a=60, r=40, g=70, b=100}, + liquid_renewable = false, + liquid_range = 2, + post_effect_color = {a=40, r=40, g=70, b=100}, groups = {water=1, liquid=1}, }) @@ -720,7 +722,9 @@ minetest.register_node( liquid_alternative_flowing = "default:river_water_flowing", liquid_alternative_source = "default:river_water_source", liquid_viscosity = default.RIVER_WATER_VISC, - post_effect_color = {a=60, r=40, g=70, b=100}, + liquid_renewable = false, + liquid_range = 2, + post_effect_color = {a=40, r=40, g=70, b=100}, groups = {water=1, liquid=1}, }) diff --git a/mods/default/textures/default_bucket_river_water.png b/mods/default/textures/default_bucket_river_water.png new file mode 100644 index 0000000..f35b998 Binary files /dev/null and b/mods/default/textures/default_bucket_river_water.png differ diff --git a/mods/default/textures/default_bucket_river_water.xcf b/mods/default/textures/default_bucket_river_water.xcf new file mode 100644 index 0000000..6b37cb5 Binary files /dev/null and b/mods/default/textures/default_bucket_river_water.xcf differ