From 688313a28ddec1946a99480e1e38c33b35061e6a Mon Sep 17 00:00:00 2001 From: Wuzzy Date: Wed, 20 Mar 2019 15:01:03 +0100 Subject: [PATCH] Update deprecated get_mapgen_params call --- mods/gold/init.lua | 3 ++- mods/village/init.lua | 3 ++- mods/village/mapgen.lua | 7 ++++--- mods/weather/init.lua | 3 ++- 4 files changed, 10 insertions(+), 6 deletions(-) diff --git a/mods/gold/init.lua b/mods/gold/init.lua index 3c423d9..5184d1e 100644 --- a/mods/gold/init.lua +++ b/mods/gold/init.lua @@ -5,7 +5,8 @@ gold = {} -gold.pr = PseudoRandom(minetest.get_mapgen_params().seed+8732) +local mapseed = minetest.get_mapgen_setting("seed") +gold.pr = PseudoRandom(mapseed+8732) gold.trades = {} gold.trade_names = {} diff --git a/mods/village/init.lua b/mods/village/init.lua index 65c4158..4654a01 100644 --- a/mods/village/init.lua +++ b/mods/village/init.lua @@ -11,7 +11,8 @@ village.max_size = 6 -- Max chunk gen iterations -- Closest distance a village will spawn from another village village.min_spawn_dist = 512 -village.pr = PseudoRandom(minetest.get_mapgen_params().seed) +local mapseed = minetest.get_mapgen_setting("seed") +village.pr = PseudoRandom(mapseed) dofile(minetest.get_modpath("village") .. "/names.lua") dofile(minetest.get_modpath("village") .. "/generate.lua") diff --git a/mods/village/mapgen.lua b/mods/village/mapgen.lua index f08f099..4c0cc74 100644 --- a/mods/village/mapgen.lua +++ b/mods/village/mapgen.lua @@ -5,6 +5,7 @@ local spawn_pos = minetest.setting_get_pos("static_spawnpoint") or {x = 0, y = 0, z = 0} local spawn_radius = minetest.settings:get("static_spawn_radius") or 256 +local mapseed = minetest.get_mapgen_setting("seed") -- Nodes @@ -30,7 +31,7 @@ minetest.register_node( on_construct = function(pos) minetest.remove_node(pos) - local pr = PseudoRandom(minetest.get_mapgen_params().seed + local pr = PseudoRandom(mapseed + pos.x + pos.y + pos.z) village.spawn_village(pos, pr) @@ -73,10 +74,10 @@ minetest.register_lbm( return end - local pr = PseudoRandom(minetest.get_mapgen_params().seed + local pr = PseudoRandom(mapseed + pos.x + pos.y + pos.z) - if ((minetest.get_mapgen_params().seed + pos.x + pos.y + pos.z) % 30) == 1 then + if ((mapseed + pos.x + pos.y + pos.z) % 30) == 1 then local nearest = village.get_nearest_village(pos) if nearest.dist > village.min_spawn_dist then diff --git a/mods/weather/init.lua b/mods/weather/init.lua index 4057b33..b8396a6 100644 --- a/mods/weather/init.lua +++ b/mods/weather/init.lua @@ -14,7 +14,8 @@ end local snow_enable = minetest.settings:get_bool("weather_snow_enable") or false local weather_soundspec=nil -local weather_pr=PseudoRandom(minetest.get_mapgen_params().seed + 2387) +local mapseed = minetest.get_mapgen_setting("seed") +local weather_pr=PseudoRandom(mapseed + 2387) local sound_min_height = -20 -- Below -20m you can't hear weather