Acacia and pine wood. Varying sandline, dunes, dune grass. Lavacooling abm. New appletree

This commit is contained in:
paramat 2014-04-15 08:03:32 +01:00
parent 903acd2ae0
commit 9e4bc49b28
6 changed files with 70 additions and 22 deletions

View File

@ -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

View File

@ -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
@ -346,3 +347,16 @@ minetest.register_abm({
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,
})

View File

@ -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)

View File

@ -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(

Binary file not shown.

After

Width:  |  Height:  |  Size: 364 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 366 B