From f1885aa687224c4e7a6d7b45bbc3403bbb8402ac Mon Sep 17 00:00:00 2001 From: srifqi Date: Sun, 21 Sep 2014 11:15:35 +0700 Subject: [PATCH] Big update (1) Update README. Add 'Swampland' biome. More common cave. 'Cutted tree' bugfix. Add 'amgmt_regenerate' to regenerate map chunk. Add 'amgmt_fixlight' to fix lighting. Add Savanna and Pine sapling, tree, leaves, and wood. Experimenting with minetest.register_ore. --- README.md | 13 +- biome.lua | 63 +++-- init.lua | 213 +++++++++++------ nodes.lua | 95 +++++++- oremgr.lua | 28 +++ textures/amgmt_pine_leaves.png | Bin 0 -> 3681 bytes textures/amgmt_pine_sapling.png | Bin 0 -> 3029 bytes textures/amgmt_pine_wood.png | Bin 0 -> 3719 bytes textures/amgmt_savanna_leaves.png | Bin 0 -> 3681 bytes textures/amgmt_savanna_sapling.png | Bin 0 -> 3063 bytes textures/amgmt_savanna_wood.png | Bin 0 -> 3719 bytes textures/jpg.jpg | Bin 0 -> 14336 bytes trees.lua | 354 ++++++++++++++++------------- 13 files changed, 521 insertions(+), 245 deletions(-) create mode 100644 textures/amgmt_pine_leaves.png create mode 100644 textures/amgmt_pine_sapling.png create mode 100644 textures/amgmt_pine_wood.png create mode 100644 textures/amgmt_savanna_leaves.png create mode 100644 textures/amgmt_savanna_sapling.png create mode 100644 textures/amgmt_savanna_wood.png create mode 100644 textures/jpg.jpg diff --git a/README.md b/README.md index bf92d95..d9c4e90 100644 --- a/README.md +++ b/README.md @@ -13,11 +13,19 @@ CC0 1.0 Universal - flowers ##Feature -- 15 biome +- 16 biome - Biomes, Trees, Nodes, Ores, etc. are modifyable - Experimental water lakes! +- 'Moreores' mod support - New caving system! (May intersect with fissure) -- Using 9 2D perlin noise and 1 3D perlin noise +- Using 25 2D perlin noise and 1 3D perlin noise + +##Noise usage +- 2 noise for height +- 2 noise for temperature and humidity +- 1 noise for experimental water lake +- 10 noise for caves +- 10 noise for cave deepness ##List of Biomes - Frozen River @@ -31,6 +39,7 @@ CC0 1.0 Universal - Plains - Flower Plains - River +- Swampland - Forest - Jungle - Savanna diff --git a/biome.lua b/biome.lua index f0a6289..6fc3e2a 100644 --- a/biome.lua +++ b/biome.lua @@ -34,7 +34,7 @@ badd({ return c_ice elseif y < base - 2 then return c_stone - elseif y < base and y > base - 3 then + elseif y < base and y >= base - 3 then return c_sandstone else return c_sand @@ -55,7 +55,7 @@ badd({ return c_water elseif y < base - 2 then return c_stone - elseif y < base and y > base - 3 then + elseif y < base and y >= base - 3 then return c_sandstone else return c_sand @@ -85,7 +85,7 @@ badd({ end elseif y < base - 2 then return c_stone - elseif y < base and y > base - 3 then + elseif y < base and y >= base - 3 then return c_dirt else if y < wl then @@ -116,7 +116,7 @@ badd({ end elseif y < base - 2 then return c_stone - elseif y < base and y > base - 3 then + elseif y < base and y >= base - 3 then return c_dirt else if y < wl then @@ -145,7 +145,7 @@ badd({ end elseif y < base - 2 then return c_stone - elseif y < base and y > base - 3 then + elseif y < base and y >= base - 3 then return c_dirt else if y < wl then @@ -224,7 +224,7 @@ badd({ end elseif y < base - 2 then return c_stone - elseif y < base and y > base - 3 then + elseif y < base and y >= base - 3 then return c_dirt else if y < wl then @@ -253,7 +253,7 @@ badd({ end elseif y < base - 2 then return c_stone - elseif y < base and y > base - 3 then + elseif y < base and y >= base - 3 then return c_dirt else if y < wl then @@ -283,7 +283,7 @@ badd({ end elseif y < base - 2 then return c_stone - elseif y < base and y > base - 3 then + elseif y < base and y >= base - 3 then return c_dirt else if y < wl then @@ -316,7 +316,7 @@ badd({ end elseif y < base - 2 then return c_stone - elseif y < base and y > base - 3 then + elseif y < base and y >= base - 3 then return c_dirt else if y < wl then @@ -327,13 +327,48 @@ badd({ end end }) +badd({ + name = "Swampland", + mint = 1.25, + maxt = 1.5, + minh = 45, + maxh = 55, + trees = {{"normal",27},{"grass14",16}}, + get_block = function(temp, humi, base_, wl, y) + local base = base_ + if base_ < 5 and base_ > -1 then base = base % 2 - 1 end + if y > base and y > wl then + return c_air + elseif y > base and y <= wl then + if base < wl then + return c_water + elseif base >= wl then + return c_air + end + elseif y < base - 2 then + return c_stone + elseif y < base and y >= base - 3 then + return c_dirt + else + if y < wl then + return c_dirt + else + if temp > 1.6 and base == wl then + return c_sand + else + return c_dirt_grass + end + end + end + end +}) badd({ name = "Forest", mint = 1.25, maxt = 1.5, minh = 0, maxh = 95, - trees = {{"normal",15},{"grass14",60},{"grass35",5},{"papyrus",15},{"flowers",15}}, + trees = {{"normal",19},{"grass14",60},{"grass35",5},{"papyrus",16},{"flowers",18}}, get_block = function(temp, humi, base, wl, y) if y > base and y > wl then return c_air @@ -345,7 +380,7 @@ badd({ end elseif y < base - 2 then return c_stone - elseif y < base and y > base - 3 then + elseif y < base and y >= base - 3 then return c_dirt else if y < wl then @@ -374,7 +409,7 @@ badd({ end elseif y < base - 2 then return c_stone - elseif y < base and y > base - 3 then + elseif y < base and y >= base - 3 then return c_dirt else if y < wl then @@ -402,7 +437,7 @@ badd({ end elseif y < base - 2 then return c_stone - elseif y < base and y > base - 3 then + elseif y < base and y >= base - 3 then return c_dirt else if y < wl then @@ -434,7 +469,7 @@ badd({ end elseif y < base - 2 then return c_sandstone - elseif y < base and y > base - 3 then + elseif y < base and y >= base - 3 then return c_sand else return c_sand diff --git a/init.lua b/init.lua index 461397f..0790120 100644 --- a/init.lua +++ b/init.lua @@ -1,22 +1,16 @@ --- Another Map Generator for Minetest [amgmt] --- Made by srifqi +-- Another Map Generator for Minetest [amgmt] by srifqi -- License: CC0 1.0 Universal -- Dependencies: default, flowers amgmt = {} print("[amgmt] (Another Map Generator for Minetest)") -minetest.register_on_mapgen_init(function(mgparams) - minetest.set_mapgen_params({mgname="singlenode"}) -end) - --param? DEBUG = true -- turn this off if your debug.txt is too full -wl = 0 +wl = 0 -- water level HMAX = 500 HMIN = -30000 -BEDROCK = -4999 -BEDROCK2 = -29999 +BEDROCK = -29999 -- bedrock level function amgmt.debug(text) if DEBUG == true then print("[amgmt]:"..(text or "")) end @@ -29,6 +23,11 @@ dofile(minetest.get_modpath(minetest.get_current_modname()).."/trees.lua") dofile(minetest.get_modpath(minetest.get_current_modname()).."/biomemgr.lua") dofile(minetest.get_modpath(minetest.get_current_modname()).."/oremgr.lua") +minetest.register_on_mapgen_init(function(mgparams) + amgmt.seed = mgparams.seed + minetest.set_mapgen_params({mgname="singlenode", flags="nolight"}) +end) + local function get_perlin_map(np, minp, maxp) local sidelen = maxp.x - minp.x +1 local pm = minetest.get_perlin_map( @@ -45,11 +44,9 @@ amgmt.np = { m = {s = 4321, o = 6, p = 0.5, c = 256}, t = {s = 5678, o = 7, p = 0.5, c = 512}, h = {s = 8765, o = 7, p = 0.5, c = 512}, - c1 = {s = 1111, o = 7, p = 0.5, c = 512}, - d1 = {s = 2222, o = 7, p = 0.5, c = 512}, - c2 = {s = 3333, o = 7, p = 0.5, c = 512}, - d2 = {s = 4444, o = 7, p = 0.5, c = 512}, l = {s = 125, o = 6, p = 0.5, c = 256}, + c = {s = 1024, o = 7, p = 0.5, c = 512}, + d = {s = 2048, o = 7, p = 0.5, c = 512}, } local np = amgmt.np @@ -101,7 +98,12 @@ local function build_cave_segment(x, y, z, data, area, shape, radius, deletednod for yy = -radius, radius do for xx = -radius, radius do local vi = area:index(x+xx,y+yy,z+zz) - if data[vi] == deletednodes and distance3(x,y,z,x+xx,y+yy,z+zz) <= radius then + local via = area:index(x+xx,y+yy+1,z+zz) + if + data[vi] == deletednodes and + distance3(x,y,z,x+xx,y+yy,z+zz) <= radius and + data[via] == deletednodes + then data[vi] = c_air end end @@ -112,7 +114,8 @@ local function build_cave_segment(x, y, z, data, area, shape, radius, deletednod for yy = -radius, radius do for xx = -radius, radius do local vi = area:index(x+xx,y+yy,z+zz) - if data[vi] == deletednodes then + local via = area:index(x+xx,y+yy+1,z+zz) + if data[vi] == deletednodes and data[via] == deletednodes then data[vi] = c_air end end @@ -124,7 +127,8 @@ local function build_cave_segment(x, y, z, data, area, shape, radius, deletednod if distance2(x,z,x+xx,z+zz) <= radius then for yy = -radius, radius do local vi = area:index(x+xx,y+yy,z+zz) - if data[vi] == deletednodes then + local via = area:index(x+xx,y+yy+1,z+zz) + if data[vi] == deletednodes and data[via] == deletednodes then data[vi] = c_air end end @@ -143,16 +147,29 @@ local function amgmt_generate(minp, maxp, seed, vm, emin, emax) MaxEdge={x=emax.x, y=emax.y, z=emax.z}, } local data = vm:get_data() + + --noise local base = get_perlin_map(np.b, minp, maxp) -- base height local moun = get_perlin_map(np.m, minp, maxp) -- addition local temp = get_perlin_map(np.t, minp, maxp) -- temperature (0-2) local humi = get_perlin_map(np.h, minp, maxp) -- humidity (0-100) local lake = get_perlin_map(np.l, minp, maxp) -- lake - local cav1 = get_perlin_map(np.c1, minp, maxp) -- cave1 - local dep1 = get_perlin_map(np.d1, minp, maxp) -- deep1 - local cav2 = get_perlin_map(np.c2, minp, maxp) -- cave2 - local dep2 = get_perlin_map(np.d2, minp, maxp) -- deep2 + + local cave = {} -- list of caves + local deep = {} -- list of cave deepness + for o = 1, 10 do + local cnp = np.c + cnp.s = cnp.s + o + cave[o] = get_perlin_map(cnp, minp, maxp) + local dnp = np.d + dnp.s = dnp.s + o + deep[o] = get_perlin_map(dnp, minp, maxp) + end + local fissure = minetest.get_perlin(3456, 6, 0.5, 360) -- fissure + amgmt.debug("noise calculated") + + --terraforming local nizx = 0 for z = minp.z, maxp.z do for x = minp.x, maxp.x do @@ -174,17 +191,19 @@ local function amgmt_generate(minp, maxp, seed, vm, emin, emax) -- world height limit :( if y_ < HMIN or y_ > HMAX then -- air - elseif y_ == BEDROCK or y_ == BEDROCK2 then + elseif y_ == BEDROCK then data[vi] = c_bedrock -- -- fissure elseif math.abs(fissure:get3d({x=x,y=y_,z=z})) < 0.0045 then - data[vi] = c_air + -- air --]] -- biome else - --data[vi] = c_air - data[vi] = amgmt.biome.get_block_by_temp_humi(temp_, humi_, base_, wl, y_, x, z) + local node = amgmt.biome.get_block_by_temp_humi(temp_, humi_, base_, wl, y_, x, z) + if node ~= c_air then + data[vi] = node + end end end end @@ -200,33 +219,31 @@ local function amgmt_generate(minp, maxp, seed, vm, emin, emax) for z = minp.z, maxp.z do for x = minp.x, maxp.x do nizx = nizx + 1 - local cav1_ = math.abs(cav1[nizx]) - local dep1_ = dep1[nizx] * 30 + 5 - local cav2_ = math.abs(cav2[nizx]) - local dep2_ = dep2[nizx] * 50 - 25 local base_ = math.ceil((base[nizx] * -50) + wl + 16.67 + (moun[nizx] * 15)) - --amgmt.debug(x..","..z..":"..cav1_..","..dep1_..","..cav2_..","..dep2_) - if cav1_ < 0.015 or cav1_ > 1-0.015 then - local y = math.floor(wl + dep1_ + 0.5) - local shape = (base_%3) + 1 - build_cave_segment(x, y, z, data, area, shape, 1, c_stone) - build_cave_segment(x, y, z, data, area, shape, 1, c_dirt) - build_cave_segment(x, y, z, data, area, shape, 1, c_dirt_grass) - build_cave_segment(x, y, z, data, area, shape, 1, c_dirt_snow) - build_cave_segment(x, y, z, data, area, shape, 1, c_dirt_savanna) - --amgmt.debug("cave generated at:"..x..","..y..","..z) - end - - if cav2_ < 0.015 or cav2_ > 1-0.015 then - local y = math.floor(wl - dep2_ - 0.5) - local shape = (base_%3) + 1 - build_cave_segment(x, y, z, data, area, shape, 1, c_stone) - build_cave_segment(x, y, z, data, area, shape, 1, c_dirt) - build_cave_segment(x, y, z, data, area, shape, 1, c_dirt_grass) - build_cave_segment(x, y, z, data, area, shape, 1, c_dirt_snow) - build_cave_segment(x, y, z, data, area, shape, 1, c_dirt_savanna) - --amgmt.debug("cave generated at:"..x..","..y..","..z) + for o = 1, 10 do + local cave_ = (cave[o][nizx]+1)/2 + local deep_ = deep[o][nizx] + if o < 4 then + deep_ = deep_ * 30 + 5 + elseif o < 7 then + deep_ = deep_ * 50 - 25 + else + deep_ = deep_ * 50 - 45 + end + + if cave_ < 0.001 or cave_ > 1-0.001 then + local y = math.floor(wl + deep_ + 0.5) + local shape = (base_%3) + 1 + build_cave_segment(x, y, z, data, area, shape, 1, c_stone) + build_cave_segment(x, y, z, data, area, shape, 1, c_dirt) + build_cave_segment(x, y, z, data, area, shape, 1, c_dirt_grass) + build_cave_segment(x, y, z, data, area, shape, 1, c_dirt_snow) + build_cave_segment(x, y, z, data, area, shape, 1, c_dirt_savanna) + build_cave_segment(x, y, z, data, area, shape, 1, c_sandstone) + build_cave_segment(x, y, z, data, area, shape, 1, c_sand) + --amgmt.debug("cave generated at:"..x..","..y..","..z) + end end end end @@ -239,9 +256,9 @@ local function amgmt_generate(minp, maxp, seed, vm, emin, emax) for cx = 0, chulen-1 do nizx = (cz*chulen + cx) * 16 local found_lake = false - for z = minp.z + cz*16, minp.z + (cz+1)*16 do + for z = minp.z + cz*16 +3, minp.z + (cz+1)*16 -3 do -- +-3 for lake borders if found_lake == true then break end - for x = minp.x + cx*16, minp.x + (cx+1)*16 do + for x = minp.x + cx*16 +3, minp.x + (cx+1)*16 -3 do -- +-3 for lake borders if found_lake == true then break end nizx = nizx + 1 local base_ = math.ceil((base[nizx] * -50) + wl + 16.67 + (moun[nizx] * 15)) @@ -292,6 +309,7 @@ local function amgmt_generate(minp, maxp, seed, vm, emin, emax) end amgmt.debug("lake formed") + -- --tree planting local nizx = 0 for z = minp.z, maxp.z do @@ -308,12 +326,12 @@ local function amgmt_generate(minp, maxp, seed, vm, emin, emax) humi_ = math.abs(humi[nizx] * 100) end base_ = get_base(base_, temp_, humi_) - local biome__ = amgmt.biome.list[amgmt.biome.get_by_temp_humi(temp_,humi_)[1]] + local biome__ = amgmt.biome.list[ amgmt.biome.get_by_temp_humi(temp_,humi_)[1] ] local tr = biome__.trees local filled = false for i = 1, #tr do if filled == true then break end - local tri = amgmt.tree.registered[tr[i][1]] or amgmt.tree.registered["nil"] + local tri = amgmt.tree.registered[ tr[i][1] ] or amgmt.tree.registered["nil"] local chance = tr[i][2] or 1024 if pr:next(1,chance) == 1 and @@ -334,21 +352,6 @@ local function amgmt_generate(minp, maxp, seed, vm, emin, emax) end end amgmt.debug("tree planted") - - --[[ - for z = minp.z, maxp.z do - for y = minp.y, maxp.y do - local vi = area:index(x,y,z) - for x = minp.x, maxp.x do - local pos = {x:x,y:y,z:z} - if data[vi] = c_dirt then - if minetest.find_node_near(pos, 3, {"default:dirt_with_grass"}) ~= nil then - data[vi] = c_dirt_grass - end - end - end - end - end --]] amgmt.debug("applying map data") @@ -367,6 +370,80 @@ minetest.register_on_generated(function(minp, maxp, seed) amgmt_generate(minp, maxp, seed, vm, emin, emax) end) +local function amgmt_regenerate(pos, name) + minetest.chat_send_all("Regenerating "..name.."'s map chunk...") + local minp = {x = 80*math.floor((pos.x+32)/80)-32, + y = 80*math.floor((pos.y+32)/80)-32, + z = 80*math.floor((pos.z+32)/80)-32} + local maxp = {x = minp.x+79, y = minp.y+79, z = minp.z+79} + local vm = minetest.get_voxel_manip() + local emin, emax = vm:read_from_map(minp, maxp) + local data = {} + for i = 1, (maxp.x-minp.x+1)*(maxp.y-minp.y+1)*(maxp.z-minp.z+1) do + data[i] = c_air + end + vm:set_data(data) + vm:write_to_map() + amgmt_generate(minp, maxp, amgmt.seed or os.clock(), vm, emin, emax) + + minetest.chat_send_player(name, "Regenerating done, fixing lighting. This may take a while...") + -- Fix lighting + local nodes = minetest.find_nodes_in_area(minp, maxp, "air") + local nnodes = #nodes + local p = math.floor(nnodes/5) + local dig_node = minetest.dig_node + for _, pos in ipairs(nodes) do + dig_node(pos) + if _%p == 0 then + minetest.chat_send_player(name, math.floor(_/nnodes*100).."%") + end + end + minetest.chat_send_all("Done") +end + +minetest.register_chatcommand("amgmt_regenerate", { + privs = {server = true}, + func = function(name, param) + local player = minetest.get_player_by_name(name) + if player then + local pos = player:getpos() + amgmt_regenerate(pos, name) + end + end, +}) + +local function amgmt_fixlight(pos, name) + minetest.chat_send_player(name, "Fixing lightning. This may take a while...") + local minp = {x = 80*math.floor((pos.x+32)/80)-32, + y = 80*math.floor((pos.y+32)/80)-32, + z = 80*math.floor((pos.z+32)/80)-32} + local maxp = {x = minp.x+79, y = minp.y+79, z = minp.z+79} + + -- Fix lighting + local nodes = minetest.find_nodes_in_area(minp, maxp, "air") + local nnodes = #nodes + local p = math.floor(nnodes/5) + local dig_node = minetest.dig_node + for _, pos in ipairs(nodes) do + dig_node(pos) + if _%p == 0 then + minetest.chat_send_player(name, math.floor(_/nnodes*100).."%") + end + end + minetest.chat_send_all("Done") +end + +minetest.register_chatcommand("amgmt_fixlight", { + privs = {server = true}, + func = function(name, param) + local player = minetest.get_player_by_name(name) + if player then + local pos = player:getpos() + amgmt_fixlight(pos, name) + end + end, +}) + dofile(minetest.get_modpath(minetest.get_current_modname()).."/hud.lua") print("[amgmt]:"..amgmt.tree.count.." tree(s) registered") diff --git a/nodes.lua b/nodes.lua index 49151d9..45ccac5 100644 --- a/nodes.lua +++ b/nodes.lua @@ -1,5 +1,5 @@ minetest.register_node("amgmt:bedrock", { - description = "amgmt's BEDROCK", + description = "amgmt's BEDROCK (How you get this?)", tiles ={"default_cobble.png"}, groups = {unbreakable = 1, not_in_creative_inventory = 1}, sounds = default.node_sound_stone_defaults() @@ -14,4 +14,95 @@ minetest.register_node("amgmt:dirt_at_savanna", { sounds = default.node_sound_dirt_defaults({ footstep = {name="default_grass_footstep", gain=0.25}, }), -}) \ No newline at end of file +}) + +local tree_add = { + {"savanna","Savanna"}, + {"pine","Pine"}, +} + +for i=1, #tree_add do + minetest.register_node("amgmt:"..tree_add[i][1].."_tree", { + description = tree_add[i][2].." Tree", + tiles = { + "default_tree_top.png", + "default_tree_top.png", + "default_tree.png", + }, + paramtype2 = "facedir", + is_ground_content = false, + groups = {tree=1,choppy=2,oddly_breakable_by_hand=1,flammable=2}, + sounds = default.node_sound_wood_defaults(), + on_place = minetest.rotate_node + }) + + minetest.register_node("amgmt:"..tree_add[i][1].."_sapling", { + description = tree_add[i][2].." Sapling", + drawtype = "plantlike", + visual_scale = 1.0, + tiles = {"amgmt_"..tree_add[i][1].."_sapling.png"}, + inventory_image = "amgmt_"..tree_add[i][1].."_sapling.png", + wield_image = "amgmt_"..tree_add[i][1].."_sapling.png", + paramtype = "light", + walkable = false, + is_ground_content = true, + selection_box = { + type = "fixed", + fixed = {-0.3, -0.5, -0.3, 0.3, 0.35, 0.3} + }, + groups = {snappy=2,dig_immediate=3,flammable=2,attached_node=1}, + sounds = default.node_sound_leaves_defaults(), + }) + + minetest.register_node("amgmt:"..tree_add[i][1].."_leaves", { + description = tree_add[i][2].." Leaves", + drawtype = "allfaces_optional", + waving = 1, + visual_scale = 1.3, + tiles = {"amgmt_"..tree_add[i][1].."_leaves.png"}, + paramtype = "light", + is_ground_content = false, + groups = {snappy=3, leafdecay=3, flammable=2, leaves=1}, + drop = { + max_items = 1, + items = { + { + -- player will get sapling with 1/20 chance + items = {'amgmt:'..tree_add[i][1]..'_sapling'}, + rarity = 20, + }, + { + -- player will get leaves only if he get no saplings, + -- this is because max_items is 1 + items = {'amgmt:'..tree_add[i][1]..'_leaves'}, + } + } + }, + sounds = default.node_sound_leaves_defaults(), + }) + + minetest.register_abm({ + nodenames = {"amgmt:"..tree_add[i][1].."_sapling"}, + interval = 10, + chance = 50, + action = function(pos, node) + local nu = minetest.get_node({x=pos.x, y=pos.y-1, z=pos.z}).name + local is_soil = minetest.get_item_group(nu, "soil") + if is_soil == 0 then + return + end + + minetest.log("action", "A "..tree_add[i][1].." sapling grows into a tree at "..minetest.pos_to_string(pos)) + local vm = minetest.get_voxel_manip() + local minp, maxp = vm:read_from_map({x=pos.x-16, y=pos.y, z=pos.z-16}, {x=pos.x+16, y=pos.y+16, z=pos.z+16}) + local area = VoxelArea:new{MinEdge=minp, MaxEdge=maxp} + local data = vm:get_data() + amgmt.tree[tree_add[i][1].."_tree"]( + pos, data, area, (amgmt.seed or i), minp, maxp, PseudoRandom(os.clock()) + ) + vm:set_data(data) + vm:write_to_map(data) + vm:update_map() + end + }) +end \ No newline at end of file diff --git a/oremgr.lua b/oremgr.lua index 2f0f224..0964617 100644 --- a/oremgr.lua +++ b/oremgr.lua @@ -35,6 +35,34 @@ function amgmt.ore.register_sheet(def) seeddiff_count = seeddiff_count +1 end + +--[[ +minetest.register_ore({ + ore_type = "scatter", + ore = "default:stone_with_coal", + wherein = "default:stone", + clust_scarcity = 8*8*8, + clust_num_ores = 8, + clust_size = 3, + height_min = -31000, + height_max = 64, +}) +--]] +function minetest.register_ore(def) + amgmt.debug(def.ore.." added") + if def.ore_type == "scatter" then + def.wherein = def.wherein or "default:stone" + + local multiplier = 16*16*16 / clust_scarcity + def.clust_num = def.clust_size * multiplier + + def.minh = def.height_min + def.maxh = def.height_max + + amgmt.ore.register_ore(def) + end +end + local function get_nearest_cube(n) for i=1, 16 do if i*i*i>=n then return i end end return 0 diff --git a/textures/amgmt_pine_leaves.png b/textures/amgmt_pine_leaves.png new file mode 100644 index 0000000000000000000000000000000000000000..6acb6ca66d74a575dff6ffaf665873749c833037 GIT binary patch literal 3681 zcmW;Pbx_n>8wc8Vx&z$%1jCX0EMoOhS^+j>{@x&DXg4ZzSD7g6n zgYw1J8B{+W{YKx%jGmao44QLcm}@PZe}h=D%CfpHHU%pg5iW?zE@Z!8pnW98NX`OKC6i<0IiMmy^@Z&E8C{uNnY+35=M# z5f*DCi+j|to#lNCR^NOEhYQfmc@57rQ;zW?<`vm~u!b#-rdcSUaqYU4P8 z2){uM*!Ll>pZtnY`g3vqx%Vqiq@-P>Ho@iRfvGcta@Ls)l2=X}-%_>zw2|HZVO!uD z(sk-ULg;o(Y5h_(@{>;`%efMu8G^&S^S3Tvw}r3pRkme-Mo$&Iuym0sJ7@fV_4%oh zfqh>u0N|v{r~i`xF+SQo`pZnv?N8Nf?P6X4?WUXI2LO*Xctqh7Evlo$0H9GE329Vk zIqQEQ+(*dTe{Z9o?2m)&D=5#<0F)X^>VjtVcMzKEvaBq2~ABfjs*xfYM-l!)X`A!f{rx#aBEA)rm-;TVsnGv(4x zm(h_hON4V+=&+qA`~M{$XRFnjt~drrM*WHH)|Pk^*=(x(iM$ooQ62`l}DOpjYN(F|CQ+gKUZdz{s+EJ znqNZ?oFpaUkUG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ovPDHLkV1hiqA5s7S literal 0 HcmV?d00001 diff --git a/textures/amgmt_savanna_leaves.png b/textures/amgmt_savanna_leaves.png new file mode 100644 index 0000000000000000000000000000000000000000..6a8b35217c0d9d212f815d6f07448cb065cb3817 GIT binary patch literal 3681 zcmW;PWmJ?~6b9gr3(}<$B7$^xO2Z7@F~CsL3?YqDf^;g~Fi1#u4c!egl;jZ70s>b; zQ0j8$S!-qnpx1q`Nh^Ki9ucw-9yKFe@D7({QMLh5qu9HbT% zl%nRUOO8vY3yKXQOJw1o$0JpZqR(F<*Xez%pnyd^k{5*;7Z>!AT!)J=27eJ}o4z0} zv@j}W?0Un$&}qKoa(CjcX+e6g@(kWEiPM8in5HbKBOF9n2BLlZJ#=_rXk(j4HW;7D z?cv=GHuRpij2OUGprj-xLk~_DfZ;PsfD80!WcTpBh`c8`0A-qD1chPrcqP74!wn(> zWc}hm#el3LMi4xMMGwfs0xZU@t+oJdZoq=|!|p5)1i#Ak#{f)H=*cni5&^oWwo&qc zy#!D>X%M3TK=}YNJGB8ZV38Z(Q!%tt25Osu9waG2J%CFH@aaT_vjbTEfW-(SqYn_4 z36LqC8cP1+tR~&#c<5ASy<{tsm_o1#F1I_5p&<_~8&ZXmlT5_&AImIRo<849DuG}j zlJ93<0U$4t{NcA}w?0VXY9vx54nb_reb9}4&tPS>b+(bKB_V%Lc0La90%rM{%)@R;h zc>Cs0pybWv#rLjFreFcHU?r@p?|om-)r($CCgFuyt?b4t-82*2-_Xo545(POLOIB` zbe_1!$!C2$6DVSc1|_i%GSA%GY_4-%V@j_J1GSFQ82*XerDoQcztvbtpI3+AYmqdxC_#?^!U zqW95CFTst4NEnD|pbta}!nX-};bFmE83JO9n5d=Uu;BeBOC!{yV;_<1M$FTv-$E?q zM)KDZH@BCqBNz`$ZUpzKCH-;~hE)udF%Fk9GyICaR~hR`EEC;m6qyc#TB5KrziteK zPG6bkRLbKYu}D+JwnT{$Kp^BMqC<&4CAeNk>KkDbxV2RDd6;4W!IX^`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Vfu*3|$2 zKV|?33I%{a_Yb)b0B`vK;J^X^#4`YZ(lyC^P!Rwy0c~}N0u>dNdjPAr6sNX6yPH2N zE!xYMFX`y$=;`Sh7#J8C8JU=vn3_fs;X*gYU*ej8XB6Knp#>~+S=MWIy$<#x_Wwg z5C}vc&A`CG(9jSHg&G+d85uIyyNyy?OJ-+1c5}#l_Xt)eX(v-QB~(!_(8#%ggKS+qduDz4P|= z_VMxY_4V~b^Y{0E|NebIKtNz%;D-+%f`WpAgM&jtLPF8P!otGC!y_UhA|oTCqN1Xs zqhn%XVq;@JqJ8@GDK0K9K0ZDnAt5m_F)1l2IXO8cB_$OtEiElQJv}2MBQrBID=RBI zJ3A*Q2M&klqJ94SIWI3SKR>^qprEj@@XMDkMMXu$#l{xw*NerKPpCwGFMky}hHOqqDQKtE;QK zySt~Sr?{$3WZu(Sy^3OU0YjQNBjQ$`^Lt`=H}+s z*4Fm+_Rh}E?(Xj1-rf(i{r&xegM-7v!=FEY9vvMWA0MBboc#OmzrWBA|Neb>d3kkp_2o73o2>baK_ijZ4*%c`0UeT^=?x8XVUcb+vomlm2NEd0e$_9Dmq4ptH zZMA={TrLUIk5%fXHErNO$Og@vL}#NWjKpT3%FP1gd)qHDPr4JO#Vr+Mt2-4q*6QP1 iI=_8_-Agji1Y!aT2D*HQ=L-KXk${SVrhGNXBIG~jFbhfm literal 0 HcmV?d00001 diff --git a/textures/amgmt_savanna_sapling.png b/textures/amgmt_savanna_sapling.png new file mode 100644 index 0000000000000000000000000000000000000000..3b4ad1c70236b88ed41f312e147f29d67285adda GIT binary patch literal 3063 zcmVKLZ*U+IBfRsybQWXdwQbLP>6pAqfylh#{fb6;Z(vMMVS~$e@S=j*ftg6;Uhf59&ghTmgWD0l;*T zI709Y^p6lP1rIRMx#05C~cW=H_Aw*bJ-5DT&Z2n+x)QHX^p z00esgV8|mQcmRZ%02D^@S3L16t`O%c004NIvOKvYIYoh62rY33S640`D9%Y2D-rV&neh&#Q1i z007~1e$oCcFS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OYk6Gy>druMhhCYBZw_yu}NMRuMSNZkPT2834sEcL^hewmkp<002ovPDHLk FV1jU;r@#OJ literal 0 HcmV?d00001 diff --git a/textures/amgmt_savanna_wood.png b/textures/amgmt_savanna_wood.png new file mode 100644 index 0000000000000000000000000000000000000000..93d533482e613401d821fbd10102c2740da7073e GIT binary patch literal 3719 zcmV;24tVj2P)KLZ*U+IBfRsybQWXdwQbLP>6pAqfylh#{fb6;Z(vMMVS~$e@S=j*ftg6;Uhf59&ghTmgWD0l;*T zI709Y^p6lP1rIRMx#05C~cW=H_Aw*bJ-5DT&Z2n+x)QHX^p z00esgV8|mQcmRZ%02D^@S3L16t`O%c004NIvOKvYIYoh62rY33S640`D9%Y2D-rV&neh&#Q1i z007~1e$oCcFS8neI|hJl{-P!B1ZZ9hpmq0)X0i`JwE&>$+E?>%_LC6RbVIkUx0b+_+BaR3cnT7Zv!AJxW zizFb)h!jyGOOZ85F;a?DAXP{m@;!0_IfqH8(HlgRxt7s3}k3K`kFu>>-2Q$QMFfPW!La{h336o>X zu_CMttHv6zR;&ZNiS=X8v3CR#fknUxHUxJ0uoBa_M6WNWeqIg~6QE69c9o#eyhGvpiOA@W-aonk<7r1(?fC{oI5N*U!4 zfg=2N-7=cNnjjOr{yriy6mMFgG#l znCF=fnQv8CDz++o6_Lscl}eQ+l^ZHARH>?_s@|##Rr6KLRFA1%Q+=*RRWnoLsR`7U zt5vFIcfW3@?wFpwUVxrVZ>QdQz32KIeJ}k~{cZZE^+ya? z2D1z#2HOnI7(B%_ac?{wFUQ;QQA1tBKtrWrm0_3Rgps+?Jfqb{jYbcQX~taRB;#$y zZN{S}1|}gUOHJxc?wV3fxuz+mJ4`!F$IZ;mqRrNsHJd##*D~ju=bP7?-?v~|cv>vB zsJ6IeNwVZxrdjT`yl#bBIa#GxRa#xMMy;K#CDyyGyQdMSxlWT#tDe?p!?5wT$+oGt z8L;Kp2HUQ-ZMJ=3XJQv;x5ci*?vuTfeY$;({XGW_huIFR9a(?@3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x1lt)=I7_<=;-L_>FMg~>g((4?Ck9A?d|UF?(gsK z@bK{Q@$vHV^7Hfa^z`)g_4W4l_V@Sq`1ttw`T6?#`uqF){QUg={r&#_{{R2~4hH#9 z0001{Nkl9k5Cm(+RX1yb4-`T0phy4zmjn;Kq6Q>!cRa-C!9Esrb<2`e zPXj=6H$V^pFayCryuHSK0AgkN16h`Z#ZmPf^#DNpdY|$hXy#k+=h*Q}eRv_h(D>*` zp*ZG3cJQGk=`O%W)2&b_>az|wHUc!4q0RYHSHZ$HG7FqxR002ovPDHLkV1ieqA@u+N literal 0 HcmV?d00001 diff --git a/textures/jpg.jpg b/textures/jpg.jpg new file mode 100644 index 0000000000000000000000000000000000000000..fb06b68e9e82d8e82c1ebafbecbe09b63e1dc942 GIT binary patch literal 14336 zcmeI230zFuAHeT4(>kRlZQ>~vp@gE9LW@vRBxRXOB<*|Aq7;Uwv@1&ziZ+C(G}5Y< z7aCEaO@vZIAoUp&=u&1v2w!A69fnVD}e4fJHP>O z0dT7^BESvs0Am1NfCPvD{J>a101yI@JqSZRZunSqxc(1amY-&*Mwlb~xMAX$Hs%1e z3+4@Xi}4}^7Bh0Okp28!x%P@}{))R5I6M-PekVEm?;0@h9RXv(jp#=;15JiRw1x(O zVe*VN7)1{0M{6SLj#2%{f9!_!D~!@FqaT0E{3k%?tA_QXv7$(b|C4fDip2 z`8V=^v@W1E;6wjM>j+u{kpH8#0j&YZ|HlKU-7ip21jGPwU=kn!NCHy8WMB$_%wsAr z4M6Q=pq2$@0CK=gU>1Pv2i-$-9p?aZ0VJ;kwKAXrr~+!hJYYVc4rl-ifQ0~(*MwRN z&<1pX#egob1Xv0z1M~oW0LdFby#g=?64VVCH08_vWSPP(b>!IENkO6bR z01*AfX#q4um!LIwgR?*9bgYQ0FHnY;0&OCU7>aZ+yM{36Yv6%H*W*B13rK+ z;0O2vs2w-dI6xT>_IrP@9^+f8vqT5Ofl-^I0S?w;ni!si1^q%Hz%MHYD=UG(%Eivk z#=*_S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LhS zRx}i2p&Cu%OC=Nu49CA;l4az3q<5q+BL7dzjOa%7KixMY{e6#q=KH(M_jgBmGx9FTq9Z%9*gZT7IhBc)t+ZP?xb#-T)m_8b+i8K@(D|tXi^6t ukKVa2J~AMLXw_3oE^5nkj2pyU$$hbJsdCW+RLQ~WZ~31kBR=)B$ovnNH>aHd literal 0 HcmV?d00001 diff --git a/trees.lua b/trees.lua index 7f1c628..3e57a23 100644 --- a/trees.lua +++ b/trees.lua @@ -32,6 +32,7 @@ local c_ignore = gci("ignore") local c_dirt_grass = gci("default:dirt_with_grass") local c_tree = gci("default:tree") local c_leaves = gci("default:leaves") +local c_apple = gci("default:apple") local c_jungletree = gci("default:jungletree") local c_jungleleaves = gci("default:jungleleaves") local c_snow = gci("default:snow") @@ -45,6 +46,56 @@ local function add_leaves(data, vi, c_leaf, other) end --normal tree +function amgmt.tree.normal_tree(pos, data, area, seed, minp, maxp, pr) + local x, y, z = pos.x, pos.y, pos.z + local is_apple_tree = false + if pr:next(1,100) < 25 then + is_apple_tree = true + end + local th = pr:next(4,5) + + for yy = y, y+th do + local vi = area:index(x, yy, z) + data[vi] = c_tree + end + + local y = y + th - 1 + + for xx = x-1, x+1 do + for yy = y-1, y+1 do + for zz = z-1, z+1 do + if area:contains(xx,yy,zz) then + local vi = area:index(xx, yy, zz) + if pr:next(1,100) > 25 then + add_leaves(data, vi, c_leaves) + else + if is_apple_tree == true then + add_leaves(data, vi, c_apple) + else + add_leaves(data, vi, c_leaves) + end + end + end + end + end + end + + for ii = 1, 8 do + local xx = x + pr:next(-2,2) + local yy = y + pr:next(-1,2) + local zz = z + pr:next(-2,2) + for xxx = 0, 1 do + for yyy = 0, 1 do + for zzz = 0, 1 do + if area:contains(xx+xxx, yy+yyy, zz+zzz) then + local vi = area:index(xx+xxx, yy+yyy, zz+zzz) + add_leaves(data, vi, c_leaves, c_leaves) + end + end + end + end + end +end regtr({ name = "normal", chance = 15, @@ -52,44 +103,60 @@ regtr({ maxh = 85, grows_on = "default:dirt_with_grass", grow = function(pos, data, area, seed, minp, maxp, pr) - local x, y, z = pos.x, pos.y, pos.z - local th = pr:next(4,5) - - for yy = math.max(y,minp.y), math.min(y+th,maxp.y) do - local vi = area:index(x, yy, z) - data[vi] = c_tree - end - - local y = y + th - 1 - - for xx = math.max(x-1,minp.x), math.min(x+1,maxp.x) do - for yy = math.max(y-1,minp.y), math.min(y+1,maxp.y) do - for zz = math.max(z-1,minp.z), math.min(z+1,maxp.z) do - local vi = area:index(xx, yy, zz) - add_leaves(data, vi, c_leaves) - end - end - end - - for ii = 1, 8 do - local xx = x + pr:next(-2,2) - local yy = y + pr:next(-1,2) - local zz = z + pr:next(-2,2) - for xxx = 0, 1 do - for yyy = 0, 1 do - for zzz = 0, 1 do - local vi = area:index(xx+xxx, yy+yyy, zz+zzz) - add_leaves(data, vi, c_leaves, c_leaves) - end - end - end - end + amgmt.tree.normal_tree(pos, data, area, seed, minp, maxp, pr) --amgmt.debug("normal tree spawned at:"..x..","..y..","..z) end }) --jungle tree +function amgmt.tree.jungle_tree(pos, data, area, seed, minp, maxp, pr) + local x, y, z = pos.x, pos.y, pos.z + local th = pr:next(8,12) + + for zz = z-1, z+1,maxp.z do + for xx = x-1, x+1,maxp.x do + if pr:next(1,3) >= 2 and area:contains(xx,y,zz) then + local vi = area:index(xx, y, zz) + add_leaves(data, vi, c_jungletree) + end + end + end + + for yy = y, y+th do + local vi = area:index(x, yy, z) + data[vi] = c_jungletree + end + + local y = y + th - 1 + + for xx = x-1, x+1 do + for yy = y-1, y+1 do + for zz = z-1, z+1 do + if area:contains(xx,yy,zz) then + local vi = area:index(xx, yy, zz) + add_leaves(data, vi, c_jungleleaves) + end + end + end + end + + for ii = 1, 30 do + local xx = x + pr:next(-3,3) + local yy = y + pr:next(-2,2) + local zz = z + pr:next(-3,3) + for xxx = 0, 1 do + for yyy = 0, 1 do + for zzz = 0, 1 do + if area:contains(xx+xxx, yy+yyy, zz+zzz) then + local vi = area:index(xx+xxx, yy+yyy, zz+zzz) + add_leaves(data, vi, c_jungleleaves, c_jungleleaves) + end + end + end + end + end +end regtr({ name = "jungle", chance = 10, @@ -97,53 +164,53 @@ regtr({ maxh = 85, grows_on = "default:dirt_with_grass", grow = function(pos, data, area, seed, minp, maxp, pr) - local x, y, z = pos.x, pos.y, pos.z - local th = pr:next(8,12) - - for zz = math.max(z-1,minp.z), math.min(z+1,maxp.z) do - for xx = math.max(x-1,minp.x), math.min(x+1,maxp.x) do - if pr:next(1,3) >= 2 then - local vi = area:index(xx, y, zz) - add_leaves(data, vi, c_jungletree) - end - end - end - - for yy = math.max(y,minp.y), math.min(y+th,maxp.y) do - local vi = area:index(x, yy, z) - data[vi] = c_jungletree - end - - local y = y + th - 1 - - for xx = math.max(x-1,minp.x), math.min(x+1,maxp.x) do - for yy = math.max(y-1,minp.y), math.min(y+1,maxp.y) do - for zz = math.max(z-1,minp.z), math.min(z+1,maxp.z) do - local vi = area:index(xx, yy, zz) - add_leaves(data, vi, c_jungleleaves) - end - end - end - - for ii = 1, 30 do - local xx = x + pr:next(-3,3) - local yy = y + pr:next(-2,2) - local zz = z + pr:next(-3,3) - for xxx = 0, 1 do - for yyy = 0, 1 do - for zzz = 0, 1 do - local vi = area:index(xx+xxx, yy+yyy, zz+zzz) - add_leaves(data, vi, c_jungleleaves, c_jungleleaves) - end - end - end - end + amgmt.tree.jungle_tree(pos, data, area, seed, minp, maxp, pr) --amgmt.debug("jungle tree spawned at:"..x..","..y..","..z) end }) --savanna tree +local c_savanna_tree = gci("amgmt:savanna_tree") +local c_savanna_leaves = gci("amgmt:savanna_leaves") +function amgmt.tree.savanna_tree(pos, data, area, seed, minp, maxp, pr) + local x, y, z = pos.x, pos.y, pos.z + local th = pr:next(7,11) + + for yy = y, y+th do + local vi = area:index(x, yy, z) + data[vi] = c_savanna_tree + end + y = y+th-1 + + for xx = x-1, x+1 do + for yy = y-1, y+1 do + for zz = z-1, z+1 do + if area:contains(xx,yy,zz) then + local vi = area:index(xx, yy, zz) + add_leaves(data, vi, c_savanna_leaves) + end + end + end + end + + for ii = 1, 12 do + local xx = x + pr:next(-2,2) + local yy = y + pr:next(-2,2) + local zz = z + pr:next(-2,2) + + for xxx = 0, 1 do + for yyy = 0, 1 do + for zzz = 0, 1 do + if area:contains(xx+xxx, yy+yyy, zz+zzz) then + local vi = area:index(xx+xxx, yy+yyy, zz+zzz) + add_leaves(data, vi, c_savanna_leaves, c_leaves) + end + end + end + end + end +end regtr({ name = "savanna", chance = 225, @@ -151,44 +218,42 @@ regtr({ maxh = 85, grows_on = "amgmt:dirt_at_savanna", grow = function(pos, data, area, seed, minp, maxp, pr) - local x, y, z = pos.x, pos.y, pos.z - local th = pr:next(7,11) - - for yy = math.max(y,minp.y), math.min(y+th,maxp.y) do - local vi = area:index(x, yy, z) - data[vi] = c_tree - end - y = y+th-1 - - for xx = math.max(x-1,minp.x), math.min(x+1,maxp.x) do - for yy = math.max(y-1,minp.y), math.min(y+1,maxp.y) do - for zz = math.max(z-1,minp.z), math.min(z+1,maxp.z) do - local vi = area:index(xx, yy, zz) - add_leaves(data, vi, c_leaves) - end - end - end - - for ii = 1, 12 do - local xx = x + pr:next(-2,2) - local yy = y + pr:next(-2,2) - local zz = z + pr:next(-2,2) - - for xxx = 0, 1 do - for yyy = 0, 1 do - for zzz = 0, 1 do - local vi = area:index(xx+xxx, yy+yyy, zz+zzz) - add_leaves(data, vi, c_leaves, c_leaves) - end - end - end - end + amgmt.tree.savanna_tree(pos, data, area, seed, minp, maxp, pr) --amgmt.debug("savanna tree spawned at:"..x..","..y..","..z) end }) +local c_pine_tree = gci("amgmt:pine_tree") +local c_pine_leaves = gci("amgmt:pine_leaves") --pine tree at cold taiga +function amgmt.tree.pine_cold_tree(pos, data, area, seed, minp, maxp, pr) + local x, y, z = pos.x, pos.y, pos.z + local th = pr:next(8,9) + + for yy = y, y+th do + local vi = area:index(x, yy, z) + data[vi] = c_pine_tree + end + + for xx = x-1, x+1 do + for yy = 1, 3 do + for zz = z-1, z+1 do + if area:contains(xx, y+(yy*2)+1, zz) then + local vi = area:index(xx, y+(yy*2)+1, zz) + add_leaves(data, vi, c_pine_leaves) + local vi = area:index(xx, y+(yy*2)+2, zz) + add_leaves(data, vi, c_snow) + end + end + end + end + + local vi = area:index(x, y+th+1, z) + add_leaves(data, vi, c_pine_leaves) + local vi = area:index(x, y+th+2, z) + add_leaves(data, vi, c_snow) +end regtr({ name = "pine_cold", chance = 40, @@ -196,42 +261,36 @@ regtr({ maxh = 100, grows_on = "default:dirt_with_snow", grow = function(pos, data, area, seed, minp, maxp, pr) - local x, y, z = pos.x, pos.y, pos.z - local th = pr:next(5,8) - - for yy = math.max(y,minp.y), math.min(y+th,maxp.y) do - local vi = area:index(x, yy, z) - data[vi] = c_tree - end - - for xx = math.max(x-2,minp.x), math.min(x+2,maxp.x) do - for zz = math.max(z-2,minp.z), math.min(z+2,maxp.z) do - local vi = area:index(xx, y+3, zz) - add_leaves(data, vi, c_leaves) - local vi = area:index(xx, y+4, zz) - add_leaves(data, vi, c_snow) - end - end - - local vi = area:index(x, y+th+1, z) - add_leaves(data, vi, c_leaves) - local vi = area:index(x, y+th+2, z) - add_leaves(data, vi, c_snow) - - for xx = math.max(x-1,minp.x), math.min(x+1,maxp.x) do - for zz = math.max(z-1,minp.z), math.min(z+1,maxp.z) do - local vi = area:index(xx, y+th, zz) - add_leaves(data, vi, c_leaves) - local vi = area:index(xx, y+th+1, zz) - add_leaves(data, vi, c_snow) - end - end + amgmt.tree.pine_cold_tree(pos, data, area, seed, minp, maxp, pr) --amgmt.debug("pine tree spawned at:"..x..","..y..","..z) end }) --pine tree at taiga +function amgmt.tree.pine_tree(pos, data, area, seed, minp, maxp, pr) + local x, y, z = pos.x, pos.y, pos.z + local th = pr:next(8,9) + + for yy = y, y+th do + local vi = area:index(x, yy, z) + data[vi] = c_pine_tree + end + + for xx = x-1, x+1 do + for yy = 1, 3 do + for zz = z-1, z+1 do + if area:contains(xx, y+(yy*2)+1, zz) then + local vi = area:index(xx, y+(yy*2)+1, zz) + add_leaves(data, vi, c_pine_leaves) + end + end + end + end + + local vi = area:index(x, y+th+1, z) + add_leaves(data, vi, c_pine_leaves) +end regtr({ name = "pine_taiga", chance = 40, @@ -239,30 +298,7 @@ regtr({ maxh = 100, grows_on = "default:dirt_with_grass", grow = function(pos, data, area, seed, minp, maxp, pr) - local x, y, z = pos.x, pos.y, pos.z - local th = pr:next(5,8) - - for yy = math.max(y,minp.y), math.min(y+th,maxp.y) do - local vi = area:index(x, yy, z) - data[vi] = c_tree - end - - for xx = math.max(x-2,minp.x), math.min(x+2,maxp.x) do - for zz = math.max(z-2,minp.z), math.min(z+2,maxp.z) do - local vi = area:index(xx, y+3, zz) - add_leaves(data, vi, c_leaves) - end - end - - for xx = math.max(x-1,minp.x), math.min(x+1,maxp.x) do - for zz = math.max(z-1,minp.z), math.min(z+1,maxp.z) do - local vi = area:index(xx, y+th, zz) - add_leaves(data, vi, c_leaves) - end - end - - local vi = area:index(x, y+th+1, z) - add_leaves(data, vi, c_leaves) + amgmt.tree.pine_tree(pos, data, area, seed, minp, maxp, pr) --amgmt.debug("pine tree spawned at:"..x..","..y..","..z) end