Skip to content

Commit

Permalink
Mount Gen: restruct mod files. Relates to #1906
Browse files Browse the repository at this point in the history
  • Loading branch information
alek13 committed Jan 6, 2025
1 parent c806cde commit 685b589
Show file tree
Hide file tree
Showing 8 changed files with 43 additions and 31 deletions.
10 changes: 4 additions & 6 deletions mods/lord/World/mountgen/init.lua
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
dofile(minetest.get_modpath("mountgen").."/ui.lua")
dofile(minetest.get_modpath("mountgen").."/algorithms/height_map.lua")
dofile(minetest.get_modpath("mountgen").."/algorithms/cone.lua")
dofile(minetest.get_modpath("mountgen").."/algorithms/diamond_square.lua")
dofile(minetest.get_modpath("mountgen").."/mountgen.lua")
dofile(minetest.get_modpath("mountgen").."/map.lua")

minetest.mod(function(mod)
require('mountgen').init(mod)
end)
File renamed without changes.
File renamed without changes.
16 changes: 16 additions & 0 deletions mods/lord/World/mountgen/src/mountgen.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@

mountgen = {}

require('algorithms.cone')
require('algorithms.diamond_square')
require('generator')
require('generator.height_map')
require('map')
require('ui')



return {
init = function(mod)
end
}
Original file line number Diff line number Diff line change
@@ -1,31 +1,29 @@
local S = minetest.get_mod_translator()
local esc = minetest.formspec_escape

mountgen = {
required_priv = "server",
config = {
-- for cone:
TOP_RADIUS = 10,
MAX_RADIUS = 20,
-- /for cone

ANGLE = 60,
Y0 = 0,
METHOD = "cone",
SNOW_LINE = 50,
SNOW_LINE_RAND = 4,
GRASS_PERCENT = 10,
FLOWERS_LINE = 35,
FLOWERS_PERCENT = 10,
TREE_LINE = 20,
TREE_PROMILLE = 4,

rk_big = 5,
rk_small = 100,
rk_thr = 5,

top_cover = "lord_ground:dirt_dunland",
},
mountgen.required_priv = "server"
mountgen.config = {
-- for cone:
TOP_RADIUS = 10,
MAX_RADIUS = 20,
-- /for cone

ANGLE = 60,
Y0 = 0,
METHOD = "cone",
SNOW_LINE = 50,
SNOW_LINE_RAND = 4,
GRASS_PERCENT = 10,
FLOWERS_LINE = 35,
FLOWERS_PERCENT = 10,
TREE_LINE = 20,
TREE_PROMILLE = 4,

rk_big = 5,
rk_small = 100,
rk_thr = 5,

top_cover = "lord_ground:dirt_dunland",
}

mountgen.show_config_menu = function(user_name, config)
Expand Down

0 comments on commit 685b589

Please sign in to comment.