1
0
mirror of https://github.com/sys4-fr/server-nalc.git synced 2024-12-26 02:30:38 +01:00

Updated minetestforfun_game, part 2

- Merged :
	Add crafting grid result arrow to creative inventory
	Simple biomes for mgv5/mgv7. Uses get_mapgen_params
This commit is contained in:
LeMagnesium 2015-03-03 15:51:09 +01:00
parent afa51785fb
commit c4c6e9fe44
2 changed files with 317 additions and 0 deletions

View File

@ -82,6 +82,7 @@ creative_inventory.set_creative_formspec = function(player, start_i, pagenum)
"list[current_player;main;5,4.75;8,3;8]".. "list[current_player;main;5,4.75;8,3;8]"..
"list[current_player;craft;8,0;3,3;]".. "list[current_player;craft;8,0;3,3;]"..
"list[current_player;craftpreview;12,1;1,1;]".. "list[current_player;craftpreview;12,1;1,1;]"..
"image[11,1;1,1;gui_furnace_arrow_bg.png^[transformR270]"..
"list[detached:creative;main;0.3,0.5;4,6;"..tostring(start_i).."]".. "list[detached:creative;main;0.3,0.5;4,6;"..tostring(start_i).."]"..
"label[2.0,6.55;"..tostring(pagenum).."/"..tostring(pagemax).."]".. "label[2.0,6.55;"..tostring(pagenum).."/"..tostring(pagemax).."]"..
"button[0.3,6.5;1.6,1;creative_prev;<<]".. "button[0.3,6.5;1.6,1;creative_prev;<<]"..

View File

@ -757,3 +757,319 @@ minetest.register_on_generated(function(minp, maxp, seed)
generate_nyancats(seed, minp, maxp) generate_nyancats(seed, minp, maxp)
end) end)
--
-- Register biomes
--
function default.register_biomes()
minetest.clear_registered_biomes()
minetest.register_biome({
name = "grassland",
node_top = "default:dirt_with_grass",
node_shore_top = "default:sand",
depth_top = 1,
node_filler = "default:dirt",
node_shore_filler = "default:sand",
depth_filler = 2,
height_shore = 3,
node_underwater = "default:sand",
--node_stone = "",
--node_water_top = "",
--depth_water_top = ,
--node_water = "",
--node_dust = "",
y_min = -31000,
y_max = 31000,
heat_point = 50,
humidity_point = 50,
})
--
-- Register decorations
--
-- Flowers
minetest.register_decoration({
deco_type = "simple",
place_on = {"default:dirt_with_grass"},
sidelen = 16,
noise_params = {
offset = -0.02,
scale = 0.03,
spread = {x=100, y=100, z=100},
seed = 436,
octaves = 3,
persist = 0.6
},
biomes = {"grassland"},
y_min = -31000,
y_max = 31000,
decoration = "flowers:rose",
})
minetest.register_decoration({
deco_type = "simple",
place_on = {"default:dirt_with_grass"},
sidelen = 16,
noise_params = {
offset = -0.02,
scale = 0.03,
spread = {x=100, y=100, z=100},
seed = 19822,
octaves = 3,
persist = 0.6
},
biomes = {"grassland"},
y_min = -31000,
y_max = 31000,
decoration = "flowers:tulip",
})
minetest.register_decoration({
deco_type = "simple",
place_on = {"default:dirt_with_grass"},
sidelen = 16,
noise_params = {
offset = -0.02,
scale = 0.03,
spread = {x=100, y=100, z=100},
seed = 1220999,
octaves = 3,
persist = 0.6
},
biomes = {"grassland"},
y_min = -31000,
y_max = 31000,
decoration = "flowers:dandelion_yellow",
})
minetest.register_decoration({
deco_type = "simple",
place_on = {"default:dirt_with_grass"},
sidelen = 16,
noise_params = {
offset = -0.02,
scale = 0.03,
spread = {x=100, y=100, z=100},
seed = 36662,
octaves = 3,
persist = 0.6
},
biomes = {"grassland"},
y_min = -31000,
y_max = 31000,
decoration = "flowers:geranium",
})
minetest.register_decoration({
deco_type = "simple",
place_on = {"default:dirt_with_grass"},
sidelen = 16,
noise_params = {
offset = -0.02,
scale = 0.03,
spread = {x=100, y=100, z=100},
seed = 1133,
octaves = 3,
persist = 0.6
},
biomes = {"grassland"},
y_min = -31000,
y_max = 31000,
decoration = "flowers:viola",
})
minetest.register_decoration({
deco_type = "simple",
place_on = {"default:dirt_with_grass"},
sidelen = 16,
noise_params = {
offset = -0.02,
scale = 0.03,
spread = {x=100, y=100, z=100},
seed = 73133,
octaves = 3,
persist = 0.6
},
biomes = {"grassland"},
y_min = -31000,
y_max = 31000,
decoration = "flowers:dandelion_white",
})
-- Grasses
minetest.register_decoration({
deco_type = "simple",
place_on = {"default:dirt_with_grass"},
sidelen = 16,
noise_params = {
offset = 0.04,
scale = 0.08,
spread = {x=100, y=100, z=100},
seed = 66440,
octaves = 3,
persist = 0.6
},
biomes = {"grassland"},
y_min = -31000,
y_max = 31000,
decoration = "default:grass_1",
})
minetest.register_decoration({
deco_type = "simple",
place_on = {"default:dirt_with_grass"},
sidelen = 16,
noise_params = {
offset = 0.02,
scale = 0.08,
spread = {x=100, y=100, z=100},
seed = 66440,
octaves = 3,
persist = 0.6
},
biomes = {"grassland"},
y_min = -31000,
y_max = 31000,
decoration = "default:grass_2",
})
minetest.register_decoration({
deco_type = "simple",
place_on = {"default:dirt_with_grass"},
sidelen = 16,
noise_params = {
offset = 0,
scale = 0.08,
spread = {x=100, y=100, z=100},
seed = 66440,
octaves = 3,
persist = 0.6
},
biomes = {"grassland"},
y_min = -31000,
y_max = 31000,
decoration = "default:grass_3",
})
minetest.register_decoration({
deco_type = "simple",
place_on = {"default:dirt_with_grass"},
sidelen = 16,
noise_params = {
offset = -0.02,
scale = 0.08,
spread = {x=100, y=100, z=100},
seed = 66440,
octaves = 3,
persist = 0.6
},
biomes = {"grassland"},
y_min = -31000,
y_max = 31000,
decoration = "default:grass_4",
})
minetest.register_decoration({
deco_type = "simple",
place_on = {"default:dirt_with_grass"},
sidelen = 16,
noise_params = {
offset = -0.04,
scale = 0.08,
spread = {x=100, y=100, z=100},
seed = 66440,
octaves = 3,
persist = 0.6
},
biomes = {"grassland"},
y_min = -31000,
y_max = 31000,
decoration = "default:grass_5",
})
end
--
-- Register blob ore
--
function default.register_blobs()
minetest.register_ore({
ore_type = "blob",
ore = "default:sand",
wherein = {"default:stone"},
clust_scarcity = 24*24*24,
clust_size = 7,
y_min = -63,
y_max = 4,
noise_threshhold = 0,
noise_params = {
offset=0.35,
scale=0.2,
spread={x=5, y=5, z=5},
seed=2316,
octaves=1,
persist=0.5
},
})
minetest.register_ore({
ore_type = "blob",
ore = "default:dirt",
wherein = {"default:stone"},
clust_scarcity = 24*24*24,
clust_size = 7,
y_min = -63,
y_max = 31000,
noise_threshhold = 0,
noise_params = {
offset=0.35,
scale=0.2,
spread={x=5, y=5, z=5},
seed=17676,
octaves=1,
persist=0.5
},
})
minetest.register_ore({
ore_type = "blob",
ore = "default:gravel",
wherein = {"default:stone"},
clust_scarcity = 24*24*24,
clust_size = 7,
y_min = -31000,
y_max = 31000,
noise_threshhold = 0,
noise_params = {
offset=0.35,
scale=0.2,
spread={x=5, y=5, z=5},
seed=766,
octaves=1,
persist=0.5
},
})
end
--
-- Detect mapgen and select suitable biome code
--
local mg_params = minetest.get_mapgen_params()
if mg_params.mgname == "v5" then
default.register_biomes()
default.register_blobs()
default.register_ores()
elseif mg_params.mgname == "v6" then
minetest.register_on_generated(default.mgv6_ongen)
default.register_ores()
elseif mg_params.mgname == "v7" then
default.register_biomes()
default.register_blobs()
default.register_ores()
end