mirror of
https://gitlab.com/gaelysam/mapgen_rivers.git
synced 2024-11-13 14:20:20 +01:00
Remove 'default' hard dependency
This commit is contained in:
parent
2f7098d752
commit
1ad8c96b8c
|
@ -17,7 +17,7 @@ Code: Gaël de Sailly
|
|||
Flow routing algorithm concept (in `terrainlib/rivermapper.lua`): Cordonnier, G., Bovy, B., & Braun, J. (2019). A versatile, linear complexity algorithm for flow routing in topographies with depressions. Earth Surface Dynamics, 7(2), 549-562.
|
||||
|
||||
# Requirements
|
||||
Mod dependencies: `default` required, and [`biomegen`](https://github.com/Gael-de-Sailly/biomegen) optional (provides biome system).
|
||||
No required dependency, but [`biomegen`](https://gitlab.com/gaelysam/biomegen) recommended (provides biome system).
|
||||
|
||||
# Installation
|
||||
This mod should be placed in the `mods/` directory of Minetest like any other mod.
|
||||
|
|
24
init.lua
24
init.lua
|
@ -16,7 +16,7 @@ local elevation_chill = mapgen_rivers.settings.elevation_chill
|
|||
local use_distort = mapgen_rivers.settings.distort
|
||||
local use_biomes = mapgen_rivers.settings.biomes
|
||||
local use_biomegen_mod = use_biomes and minetest.global_exists('biomegen')
|
||||
use_biomes = use_biomes and not use_biomegen_mod
|
||||
use_biomes = use_biomes and minetest.global_exists('default') and not use_biomegen_mod
|
||||
|
||||
if use_biomegen_mod then
|
||||
biomegen.set_elevation_chill(elevation_chill)
|
||||
|
@ -147,15 +147,19 @@ local function generate(minp, maxp, seed)
|
|||
end
|
||||
end
|
||||
|
||||
local c_stone = minetest.get_content_id("default:stone")
|
||||
local c_dirt = minetest.get_content_id("default:dirt")
|
||||
local c_lawn = minetest.get_content_id("default:dirt_with_grass")
|
||||
local c_dirtsnow = minetest.get_content_id("default:dirt_with_snow")
|
||||
local c_snow = minetest.get_content_id("default:snowblock")
|
||||
local c_sand = minetest.get_content_id("default:sand")
|
||||
local c_water = minetest.get_content_id("default:water_source")
|
||||
local c_rwater = minetest.get_content_id("default:river_water_source")
|
||||
local c_ice = minetest.get_content_id("default:ice")
|
||||
local c_stone = minetest.get_content_id("mapgen_stone")
|
||||
local c_water = minetest.get_content_id("mapgen_water_source")
|
||||
local c_rwater = minetest.get_content_id("mapgen_river_water_source")
|
||||
|
||||
local c_dirt, c_lawn, c_dirtsnow, c_snow, c_sand, c_ice
|
||||
if use_biomes then
|
||||
c_dirt = minetest.get_content_id("default:dirt")
|
||||
c_lawn = minetest.get_content_id("default:dirt_with_grass")
|
||||
c_dirtsnow = minetest.get_content_id("default:dirt_with_snow")
|
||||
c_snow = minetest.get_content_id("default:snowblock")
|
||||
c_sand = minetest.get_content_id("default:sand")
|
||||
c_ice = minetest.get_content_id("default:ice")
|
||||
end
|
||||
|
||||
local vm, emin, emax = minetest.get_mapgen_object("voxelmanip")
|
||||
vm:get_data(data)
|
||||
|
|
Loading…
Reference in New Issue
Block a user