From 77c2230cdc906bb55cbb127f42dbc0b4dc4a9b96 Mon Sep 17 00:00:00 2001 From: kaadmy Date: Sat, 26 Sep 2015 16:46:48 -0700 Subject: [PATCH] made river water flow less and added river water buckets --- mods/default/crafting.lua | 48 ++++++++++++++++++ mods/default/nodes.lua | 8 ++- .../textures/default_bucket_river_water.png | Bin 0 -> 439 bytes .../textures/default_bucket_river_water.xcf | Bin 0 -> 1510 bytes 4 files changed, 54 insertions(+), 2 deletions(-) create mode 100644 mods/default/textures/default_bucket_river_water.png create mode 100644 mods/default/textures/default_bucket_river_water.xcf 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 0000000000000000000000000000000000000000..f35b99810c18b2ae1e14b85d2a43a03bc9746672 GIT binary patch literal 439 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61|;P_|4#%`Y)RhkE)4%caKYZ?lYt_f1s;*b z3=G`DAk4@xYmNj^kiEpy*OmP~rw;e#5JPCIX^cyHLrxhxhOTUBsE2$ zJhLQ2!QIn0AiR-JoPmK+-qXb~#NzbbNgKTm2Z*%oZ)p)at!ubLL&L*GWEX3^LbG?< zE2Vu650ph~n)P<=NE5K~bPz9HVZpKMMDB~FRw*6MzH7F7F75kw+xGjN_kZl4ANn68 zz)~r|@>8k&TFK#;57{=(W!&6*+kJJ*OkeR&DxN)y@}_*5S|0M^@KfeP8w2Gf84hh^ zRC}JmE@(e#k8YrY7rWLMPUG&$s~ZEwKj!S8dwe1P-tan$AAKA6Bx2snElBB_zCe1J;<(q@K-MLTwzh2HL)H#56$Ny_#57ur?F(HyU5OE3;HAb$mr zWtiRowoiUZ5(36sKnd^>@IK>M_YUftu_wB(1VhNM4zl`km#O`X}y~&x@ z{QAwr%t2D>_1mspcSl|qHK>-Q!|~+0XKUkO&+FE94js2M>)`gD|x zC&+P@szK}N6Rmk(d!AtH)%c>_@dmDToSy~a^;2S|)h`F$MDqrnGkc8vL&q80lY4{M z{jZcN4_om$WJBhXr2Nh!So3#;Pqor*kIwA@X14(NRt&&)#Qhvkm5~j#j)WOVmZExoam8Yp@4@8!ecpJ zM=-585vo{$pv224h5}I%Yr@NXO+;C&V^SvTSSX_4o%v)MqW5r0e4h!@3>(cxquFeP zP2$7uVNeNfL!>?lrVAeO#WWx+joBguiEU!eShy&}GQ0B^{v&~-fQJbZFqy4=m{vjR zJzxr3`V0yZ??E|8y)*RA9(t!bX&LC