From 9365816fe4ca160e72ff7e0b09ec54855b10c2bb Mon Sep 17 00:00:00 2001 From: Wuzzy Date: Mon, 30 Mar 2020 22:57:09 +0200 Subject: [PATCH] More deprecation fixes --- mods/grounds/init.lua | 4 ++-- mods/icicles/init.lua | 10 +++++----- mods/ores/init.lua | 4 ++-- mods/ores/registration.lua | 22 +++++++++++----------- 4 files changed, 20 insertions(+), 20 deletions(-) diff --git a/mods/grounds/init.lua b/mods/grounds/init.lua index 65291fc..1afcf42 100644 --- a/mods/grounds/init.lua +++ b/mods/grounds/init.lua @@ -25,8 +25,8 @@ minetest.register_ore({ clust_scarcity = 25*25*25, clust_num_ores = 343, clust_size = 7, - height_min = -31000, - height_max = 64, + y_min = -31000, + y_max = 64, }) dofile(minetest.get_modpath("grounds").."/dirt.lua") diff --git a/mods/icicles/init.lua b/mods/icicles/init.lua index f82d0ed..cf88faa 100644 --- a/mods/icicles/init.lua +++ b/mods/icicles/init.lua @@ -46,12 +46,12 @@ function icicles.make_stalagmite(pos, length) end end -local function generate(minp, maxp, seed, chunks_per_volume, icicles_per_chunk, height_min, height_max) - if maxp.y < height_min or minp.y > height_max then +local function generate(minp, maxp, seed, chunks_per_volume, icicles_per_chunk, y_min, y_max) + if maxp.y < y_min or minp.y > y_max then return end - local y_min = math.max(minp.y, height_min) - local y_max = math.min(maxp.y, height_max) + local y_min = math.max(minp.y, y_min) + local y_max = math.min(maxp.y, y_max) local volume = (maxp.x-minp.x+1)*(y_max-y_min+1)*(maxp.z-minp.z+1) local pr = PseudoRandom(seed) local num_chunks = math.floor(chunks_per_volume * volume) @@ -62,7 +62,7 @@ local function generate(minp, maxp, seed, chunks_per_volume, icicles_per_chunk, local inverse_chance = math.floor(chunk_size*chunk_size*chunk_size / icicles_per_chunk) for i=1,num_chunks do local y0 = pr:next(y_min, y_max-chunk_size+1) - if y0 >= height_min and y0 <= height_max then + if y0 >= y_min and y0 <= y_max then local x0 = pr:next(minp.x, maxp.x-chunk_size+1) local z0 = pr:next(minp.z, maxp.z-chunk_size+1) local p0 = {x=x0, y=y0, z=z0} diff --git a/mods/ores/init.lua b/mods/ores/init.lua index 137329f..787c1fe 100644 --- a/mods/ores/init.lua +++ b/mods/ores/init.lua @@ -8,8 +8,8 @@ minetest.register_ore({ clust_scarcity = 20*20*20, clust_num_ores = 343, clust_size = 7, - height_min = -31000, - height_max = 0, + y_min = -31000, + y_max = 0, }) dofile(minetest.get_modpath("ores").."/registration.lua") diff --git a/mods/ores/registration.lua b/mods/ores/registration.lua index 7be3fd5..1af3804 100644 --- a/mods/ores/registration.lua +++ b/mods/ores/registration.lua @@ -2,7 +2,7 @@ realtest.registered_ores = {} realtest.registered_ores_list = {} local d_seed = 0 local function copytable(t) - t2 = {} + local t2 = {} for k,i in pairs(t) do t2[k] = i end @@ -18,9 +18,9 @@ function realtest.register_ore(name, OreDef) clust_scarcity = 1/(OreDef.chunks_per_volume or 1/3/3/3/2), clust_size = OreDef.chunk_size or 3, clust_num_ores = OreDef.ore_per_chunk or 10, - height_min = OreDef.height_min or -30912, - height_max = OreDef.height_max or 30912, - noise_threshhold = OreDef.noise_min or 1.2, + y_min = OreDef.y_min or -30912, + y_max = OreDef.y_max or 30912, + noise_threshold = OreDef.noise_min or 1.2, noise_params = {offset=0, scale=1, spread={x=100, y=100, z=100}, octaves=3, persist=0.70, seed = OreDef.delta_seed or d_seed}, generate = true } @@ -162,31 +162,31 @@ realtest.register_ore("ores:native_gold", { realtest.register_ore("ores:lignite", { description = "Lignite", - height_max = -500, - height_min = -3000, + y_max = -500, + y_min = -3000, ore_per_chunk = 15, chunks_per_volume = 1/3/3/3, }) realtest.register_ore("ores:bituminous_coal", { description = "Bituminous Coal", - height_max = -3000, - height_min = -6000, + y_max = -3000, + y_min = -6000, ore_per_chunk = 15, chunks_per_volume = 1/3/3/3, }) realtest.register_ore("ores:anthracite", { description = "Anthracite", - height_max = -6000, - height_min = -8000, + y_max = -6000, + y_min = -8000, ore_per_chunk = 15, chunks_per_volume = 1/3/3/3, }) realtest.register_ore("ores:graphite", { description = "Graphite", - height_max = -8000, + y_max = -8000, ore_per_chunk = 15, })