From 1d3a19f352eea5fd67587e5a87d6dc571d3798fa Mon Sep 17 00:00:00 2001 From: LeMagnesium Date: Mon, 25 May 2015 14:30:12 +0200 Subject: [PATCH] Various updates - Updated homedecor (files cleaned) - Updated nether (node replacements made easier) - Updated maptools (cleaned files) - Updated ambiance (useless files cleaned) --- nether/init.lua | 34 +++++++++++++++++++++++++++++----- 1 file changed, 29 insertions(+), 5 deletions(-) diff --git a/nether/init.lua b/nether/init.lua index 6e4e752..9e2a3b0 100644 --- a/nether/init.lua +++ b/nether/init.lua @@ -239,6 +239,7 @@ HADES_THRONE_ENDPOS_ABS = {x=htx, y=hty, z=htz}]] local c local function define_contents() c = { + ignore = minetest.get_content_id("ignore"), air = minetest.get_content_id("air"), lava = minetest.get_content_id("default:lava_source"), gravel = minetest.get_content_id("default:gravel"), @@ -397,10 +398,12 @@ minetest.register_on_generated(function(minp, maxp, seed) local forest_possible = maxp.y > f_h_min and minp.y < f_h_max --local pmap_f_bottom = minetest.get_perlin_map(perlins.forest_bottom, map_lengths_xyz):get2dMap_flat({x=minp.x, y=minp.z}) - local perlin_f_bottom, pmap_f_top + local perlin_f_bottom, pmap_f_top, strassx, strassz if forest_possible then perlin_f_bottom = minetest.get_perlin(11, 3, 0.8, tmp2) pmap_f_top = minetest.get_perlin_map(perlins.forest_top, map_lengths_xyz):get2dMap_flat({x=minp.x, y=minp.z}) + strassx = get_ws_list(2, minp.x) + strassz = get_ws_list(2, minp.z) end local num2, tab2 @@ -479,8 +482,13 @@ minetest.register_on_generated(function(minp, maxp, seed) if not f_perlins[pstr] then f_perlins[pstr] = math.floor(f_h_min+(math.abs(perlin_f_bottom:get2d({x=p.x, y=p.z})+1))*f_yscale_bottom+0.5) end - f_bottom = f_perlins[pstr]+math.random(0,f_bottom_scale-1) - f_top = math.floor(f_h_max-(pmap_f_top[count]+1)*f_yscale_top+0.5) + local top_noise = pmap_f_top[count]+1 + if top_noise < 0 then + top_noise = -top_noise/10 + --nether:inform("ERROR: (perlin noise) "..pmap_f_top[count].." is not inside [-1; 1]", 1) + end + f_top = math.floor(f_h_max - top_noise*f_yscale_top + 0.5) + f_bottom = f_perlins[pstr]+pr:next(0,f_bottom_scale-1) is_forest = f_bottom < f_top f_h_dirt = f_bottom-pr:next(0,1) end @@ -540,6 +548,18 @@ minetest.register_on_generated(function(minp, maxp, seed) ) then data[p_addpos] = c.air end + elseif is_forest + and y == f_top then + local sel = math.floor(strassx[x]+strassz[z]+0.5)%10 + if sel <= 5 then + data[p_addpos] = return_nether_ore(d_p_addp, true) + elseif sel == 6 then + data[p_addpos] = c.netherrack_black + elseif sel == 7 then + data[p_addpos] = c.glowstone + else + data[p_addpos] = c.air + end elseif y <= NETHER_BOTTOM then if y <= bottom then @@ -668,6 +688,10 @@ function nether.grow_netherstructure(pos, generated) end +local function soft_node(id) + return id == c.air or id == c.ignore +end + local function update_minmax(min, max, p) min.x = math.min(min.x, p.x) max.x = math.max(max.x, p.x) @@ -840,7 +864,7 @@ function nether.grow_tree(pos, generated) for _,p in pairs(leaf_ps) do p = area:indexp(p) - if nodes[p] == c.air then + if soft_node(nodes[p]) then nodes[p] = c.nether_leaves param2s[p] = math.random(0,44) end @@ -848,7 +872,7 @@ function nether.grow_tree(pos, generated) for _,p in pairs(fruit_ps) do p = area:indexp(p) - if nodes[p] == c.air then + if soft_node(nodes[p]) then nodes[p] = c.nether_apple --param2s[p] = math.random(0,44) end