Add more things
This commit is contained in:
parent
be2262fa17
commit
d6662e8094
26 changed files with 565 additions and 26 deletions
|
|
@ -127,20 +127,20 @@ function rgt.add_tree(pos)
|
|||
vm:write_to_map()
|
||||
end
|
||||
|
||||
rgt.register_node("tree", {
|
||||
on_place = function(s, p, pt)
|
||||
--rgt.add_tree(pt.above)
|
||||
minetest.spawn_tree(pt.above, {
|
||||
axiom = "TTTTTT",
|
||||
trunk = "spruce_planks",
|
||||
leaves = "oak_planks"
|
||||
})
|
||||
end
|
||||
})
|
||||
|
||||
rgt.register_node("outback_planks", {
|
||||
tiles = {"rgt_outback_planks.png"},
|
||||
groups = {hand_breakable = 3}
|
||||
})
|
||||
|
||||
|
||||
rgt.register_node("dirt_stony", {
|
||||
tiles = {"rgt_dirt_stony.png", "rgt_dirt.png"},
|
||||
groups = {hand_breakable = 3}
|
||||
})
|
||||
|
||||
rgt.register_node("cobble_mossy", {
|
||||
tiles = {"rgt_cobble_mossy.png"},
|
||||
groups = {hand_breakable = 3}
|
||||
})
|
||||
|
||||
minetest.register_mapgen_script(minetest.get_modpath(minetest.get_current_modname()).."/mapgen.lua")
|
||||
|
|
|
|||
|
|
@ -14,7 +14,11 @@ end
|
|||
local c_air = minetest.get_content_id("air")
|
||||
|
||||
local c_stone = minetest.get_content_id("stone")
|
||||
local c_cobble = minetest.get_content_id("cobble")
|
||||
local c_mossy_cobble = minetest.get_content_id("cobble_mossy")
|
||||
local c_dirt = minetest.get_content_id("dirt")
|
||||
local c_stony_dirt = minetest.get_content_id("dirt_stony")
|
||||
local c_mossy_dirt = minetest.get_content_id("dirt_mossy")
|
||||
local c_grass = minetest.get_content_id("dirt_grass")
|
||||
|
||||
local c_planks = minetest.get_content_id("outback_planks")
|
||||
|
|
@ -32,6 +36,16 @@ local np_terrain = {
|
|||
}
|
||||
local n_terrain = {}
|
||||
|
||||
local np_surface = {
|
||||
offset = 0,
|
||||
scale = 1, -- Small height variation
|
||||
spread = {x = 4, y = 4, z = 4},
|
||||
seed = 87745,
|
||||
octaves = 3 ,
|
||||
persist = 0.6
|
||||
}
|
||||
local n_surface = {}
|
||||
|
||||
local np_trees = {
|
||||
offset = 0,
|
||||
scale = 1, -- Small height variation
|
||||
|
|
@ -160,6 +174,7 @@ local function tree(min, max, x, y, z)
|
|||
|
||||
end
|
||||
|
||||
|
||||
minetest.register_on_generated(function(vm, min, max)
|
||||
-- Only run for blocks that are part of this realm.
|
||||
if not intersection(min, max, REALM_START, REALM_END) then return end
|
||||
|
|
@ -170,6 +185,9 @@ minetest.register_on_generated(function(vm, min, max)
|
|||
local terrain = minetest.get_perlin_map(np_terrain, sides2d)
|
||||
terrain:get_2d_map_flat({x = min.x, y = min.z}, n_terrain)
|
||||
|
||||
local surface = minetest.get_perlin_map(np_surface, sides2d)
|
||||
surface:get_2d_map_flat({x = min.x, y = min.z}, n_surface)
|
||||
|
||||
local trees_map = minetest.get_perlin_map(np_trees, sides2d)
|
||||
trees_map:get_2d_map_flat({x = min.x, y = min.z}, n_trees)
|
||||
|
||||
|
|
@ -188,7 +206,17 @@ minetest.register_on_generated(function(vm, min, max)
|
|||
if y < height -1 then
|
||||
vm_data[vi] = c_stone
|
||||
elseif y < height then
|
||||
vm_data[vi] = c_grass
|
||||
if n_surface[ni] > 0.65 then
|
||||
vm_data[vi] = c_mossy_cobble
|
||||
elseif n_surface[ni] > 0.3 then
|
||||
vm_data[vi] = c_cobble
|
||||
elseif n_surface[ni] > -0.3 then
|
||||
vm_data[vi] = c_stony_dirt
|
||||
elseif n_surface[ni] < -0.8 then
|
||||
vm_data[vi] = c_mossy_dirt
|
||||
else
|
||||
vm_data[vi] = c_dirt
|
||||
end
|
||||
elseif y < height +1 and math.random() > 0.98 then
|
||||
trees[#trees +1] = vector.new(x, y, z)
|
||||
else
|
||||
|
|
|
|||
BIN
mods/rgt_outback/textures/rgt_cobble_mossy.png
Normal file
BIN
mods/rgt_outback/textures/rgt_cobble_mossy.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 556 B |
BIN
mods/rgt_outback/textures/rgt_dirt_dark.png
Normal file
BIN
mods/rgt_outback/textures/rgt_dirt_dark.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 546 B |
BIN
mods/rgt_outback/textures/rgt_dirt_stony.png
Normal file
BIN
mods/rgt_outback/textures/rgt_dirt_stony.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 626 B |
Loading…
Add table
Add a link
Reference in a new issue