More deprecation fixes

This commit is contained in:
Wuzzy 2020-03-30 22:57:09 +02:00
parent c59cfbfa8e
commit 9365816fe4
4 changed files with 20 additions and 20 deletions

View File

@ -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")

View File

@ -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}

View File

@ -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")

View File

@ -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,
})