From 9e4bc49b28f18c9c271af19071d2ebf8a268a74a Mon Sep 17 00:00:00 2001 From: paramat Date: Tue, 15 Apr 2014 08:03:32 +0100 Subject: [PATCH] Acacia and pine wood. Varying sandline, dunes, dune grass. Lavacooling abm. New appletree --- README.txt | 2 +- functions.lua | 32 +++++++++++++++++++++--------- init.lua | 30 +++++++++++++++++----------- nodes.lua | 28 ++++++++++++++++++++++++++ textures/watershed_acaciawood.png | Bin 0 -> 364 bytes textures/watershed_pinewood.png | Bin 0 -> 366 bytes 6 files changed, 70 insertions(+), 22 deletions(-) create mode 100644 textures/watershed_acaciawood.png create mode 100644 textures/watershed_pinewood.png diff --git a/README.txt b/README.txt index 95e663a..d0d7572 100644 --- a/README.txt +++ b/README.txt @@ -1,4 +1,4 @@ -watershed 0.3.8 by paramat +watershed 0.3.9 by paramat For latest stable Minetest back to 0.4.8 Depends default bucket Licenses: code WTFPL, textures CC BY-SA diff --git a/functions.lua b/functions.lua index 9a0d454..3c822b8 100644 --- a/functions.lua +++ b/functions.lua @@ -3,29 +3,30 @@ function watershed_appletree(x, y, z, area, data) local c_apple = minetest.get_content_id("default:apple") local c_wsappleaf = minetest.get_content_id("watershed:appleleaf") for j = -2, 4 do - if j == 2 or j == 3 then + if j == 3 or j == 4 then for i = -2, 2 do for k = -2, 2 do - local vil = area:index(x + i, y + j + 1, z + k) - if math.random(48) == 2 then + local vil = area:index(x + i, y + j, z + k) + if math.random(64) == 2 then data[vil] = c_apple elseif math.random(5) ~= 2 then data[vil] = c_wsappleaf end end end - elseif j == 1 or j == 4 then + elseif j == 2 then for i = -1, 1 do for k = -1, 1 do - if math.random(5) ~= 2 then - local vil = area:index(x + i, y + j + 1, z + k) - data[vil] = c_wsappleaf + if math.abs(i) + math.abs(k) == 2 then + local vit = area:index(x + i, y + j, z + k) + data[vit] = c_tree end end end + else + local vit = area:index(x, y + j, z) + data[vit] = c_tree end - local vit = area:index(x, y + j, z) - data[vit] = c_tree end end @@ -345,4 +346,17 @@ minetest.register_abm({ minetest.remove_node(pos) minetest.place_node(pos, {name="watershed:luxoreon"}) end, +}) + +-- Lava water cooling + +minetest.register_abm({ + nodenames = {"group:lava"}, + neighbors = {"group:water"}, + interval = 11, + chance = 64, + action = function(pos, node, active_object_count, active_object_count_wider) + minetest.add_node(pos, {name="default:obsidian"}) + minetest.sound_play("default_cool_lava", {pos = pos, gain = 0.25}) + end, }) \ No newline at end of file diff --git a/init.lua b/init.lua index ca1e91d..cb0ee19 100644 --- a/init.lua +++ b/init.lua @@ -1,16 +1,13 @@ --- watershed 0.3.8 by paramat +-- watershed 0.3.9 by paramat -- For latest stable Minetest and back to 0.4.8 -- Depends default bucket -- License: code WTFPL, textures CC BY-SA -- Red cobble texture CC BY-SA by brunob.santos minetestbr.blogspot.com --- pine, acacia tree trunks --- bugfix spawning function --- temperature / humidity randomness for biome blend --- TODO --- pine wood --- acacia wood --- better appletree design with branches +-- acacia, pine wood +-- vary sandline, dunes with golden grass +-- lavacooling +-- new appletree design -- Parameters @@ -18,7 +15,9 @@ local YMIN = -33000 -- Approximate base of realm stone local YMAX = 33000 -- Approximate top of atmosphere / mountains / floatlands local TERCEN = -160 -- Terrain 'centre', average seabed level local YWAT = 1 -- Sea surface y -local YCLOMIN = 287 -- Minimum height of mod clouds +local YSAV = 5 -- Average sandline y, dune grasses above this +local SAMP = 3 -- Sandline amplitude +local YCLOMIN = 207 -- Minimum height of mod clouds local CLOUDS = true -- Mod clouds? local TERSCA = 512 -- Vertical terrain scale @@ -56,6 +55,7 @@ local DRYCHA = 169 -- Dry shrub local PAPCHA = 2 -- Papyrus local ACACHA = 529 -- Acacia tree local GOGCHA = 4 -- Golden grass +local DUGCHA = 4 -- Dune grass -- 3D noise for rough terrain @@ -290,6 +290,7 @@ minetest.register_on_generated(function(minp, maxp, seed) local tsand = TSAND * (1 - terblen) local tstone = TSTONE * (1 + grad * 0.5) local tlava = TLAVA * (1 - n_magma ^ 4 * terblen ^ 16 * 0.5) + local ysand = YSAV + n_fissure * SAMP + math.random() * 2 local nofis = false -- set fissure bool if math.abs(n_fissure) > math.sqrt(density) * FISEXP then @@ -410,7 +411,7 @@ minetest.register_on_generated(function(minp, maxp, seed) elseif density >= 0 and density < tstone and stable[si] >= 2 then -- fine materials if y == YWAT - 2 and math.abs(n_temp) < 0.05 then -- clay data[vi] = c_clay - elseif y <= YWAT + 1 + math.random(2) then -- seabed/beach sand not cut by fissures + elseif y <= ysand then -- seabed/beach/dune sand not cut by fissures data[vi] = c_sand under[si] = 10 -- beach/dunes elseif densitybase >= tsand + math.random() * 0.003 then -- river sand not cut by fissures @@ -465,7 +466,7 @@ minetest.register_on_generated(function(minp, maxp, seed) end stable[si] = 0 under[si] = 0 - elseif CLOUDS and y == y1 and y >= YCLOMIN then -- clouds at chunk top + elseif CLOUDS and y == y1 and y >= YCLOMIN then -- clouds local xrq = 16 * math.floor((x - x0) / 16) -- quantise to 16x16 lattice local zrq = 16 * math.floor((z - z0) / 16) local yrq = 79 @@ -477,7 +478,7 @@ minetest.register_on_generated(function(minp, maxp, seed) under[si] = 0 else -- possible above surface air node if y >= YWAT and under[si] ~= 0 then - local fnoise = nvals_fissure[nixyz] + local fnoise = n_fissure -- noise for flower colours if under[si] == 1 then if math.random(121) == 2 then data[viu] = c_snowblock @@ -552,6 +553,11 @@ minetest.register_on_generated(function(minp, maxp, seed) data[vi] = c_jungrass end end + elseif under[si] == 10 then + if math.random(DUGCHA) == 2 and y > YSAV + and biome >= 4 then + data[vi] = c_wsgoldengrass + end elseif under[si] == 11 and n_temp > HITET then if math.random(PAPCHA) == 2 then watershed_papyrus(x, y, z, area, data) diff --git a/nodes.lua b/nodes.lua index 9622509..5215ca6 100644 --- a/nodes.lua +++ b/nodes.lua @@ -216,6 +216,20 @@ minetest.register_node("watershed:light", { sounds = default.node_sound_glass_defaults(), }) +minetest.register_node("watershed:acaciawood", { + description = "WS Acacia Wood Planks", + tiles = {"watershed_acaciawood.png"}, + groups = {choppy=2,oddly_breakable_by_hand=2,flammable=3,wood=1}, + sounds = default.node_sound_wood_defaults(), +}) + +minetest.register_node("watershed:pinewood", { + description = "WS Pine Wood Planks", + tiles = {"watershed_pinewood.png"}, + groups = {choppy=2,oddly_breakable_by_hand=2,flammable=3,wood=1}, + sounds = default.node_sound_wood_defaults(), +}) + minetest.register_node("watershed:freshwater", { description = "WS Fresh Water Source", inventory_image = minetest.inventorycube("watershed_freshwater.png"), @@ -389,6 +403,20 @@ minetest.register_craft({ }, }) +minetest.register_craft({ + output = "watershed:acaciawood 4", + recipe = { + {"watershed:acaciatree"}, + } +}) + +minetest.register_craft({ + output = "watershed:pinewood 4", + recipe = { + {"watershed:pinetree"}, + } +}) + -- Buckets bucket.register_liquid( diff --git a/textures/watershed_acaciawood.png b/textures/watershed_acaciawood.png new file mode 100644 index 0000000000000000000000000000000000000000..f5e6a6869b64ee6083869093b7eca8d3f0fdf8b8 GIT binary patch literal 364 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61SBU+%rFB|jKx9jP7LeL$-D$|I14-?iy0XB z4ude`@%$AjKtc8rPhVH|dn|lH;)0EOSIdAx|2$nBLp08pPTI@GWXN+om{aRSVN(a6 z9N(dbMUR#!{E)C~Y@XczPx#32;bRa{vGi!vFvd!vV){sAK>D00(qQO+^RZ1P&4u8%ox1s{jB207*naR4C7N zQax|NKn#63S+GPj6y+8ab&nYOC;Bt`&-f>ux|OX1VsBA|bQT|pSgr#wm{`Z<`X-<4 zd-k)Pt(NcTam62i3?sD#;t|lZE%lMxTJ4|p$IIdkz}amOAlrQ{_0hE)#*F8P1psN1 z@jQ8q0p*Z|gy!J5sOl&d*13#JF=+1^(RA8A^s1u!88r6_)9TfDzKlyD%WW+x#WMs& zNnOk6QzuV}KO{rQW4SSOxO8?KtuC^X&>Y&k2ECwgqXXQzXlCbOKfmkGqWZTz