forked from Wuzzy/realtest_mt5
More deprecation fixes
This commit is contained in:
parent
c59cfbfa8e
commit
9365816fe4
|
@ -25,8 +25,8 @@ minetest.register_ore({
|
||||||
clust_scarcity = 25*25*25,
|
clust_scarcity = 25*25*25,
|
||||||
clust_num_ores = 343,
|
clust_num_ores = 343,
|
||||||
clust_size = 7,
|
clust_size = 7,
|
||||||
height_min = -31000,
|
y_min = -31000,
|
||||||
height_max = 64,
|
y_max = 64,
|
||||||
})
|
})
|
||||||
|
|
||||||
dofile(minetest.get_modpath("grounds").."/dirt.lua")
|
dofile(minetest.get_modpath("grounds").."/dirt.lua")
|
||||||
|
|
|
@ -46,12 +46,12 @@ function icicles.make_stalagmite(pos, length)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
local function generate(minp, maxp, seed, chunks_per_volume, icicles_per_chunk, height_min, height_max)
|
local function generate(minp, maxp, seed, chunks_per_volume, icicles_per_chunk, y_min, y_max)
|
||||||
if maxp.y < height_min or minp.y > height_max then
|
if maxp.y < y_min or minp.y > y_max then
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
local y_min = math.max(minp.y, height_min)
|
local y_min = math.max(minp.y, y_min)
|
||||||
local y_max = math.min(maxp.y, height_max)
|
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 volume = (maxp.x-minp.x+1)*(y_max-y_min+1)*(maxp.z-minp.z+1)
|
||||||
local pr = PseudoRandom(seed)
|
local pr = PseudoRandom(seed)
|
||||||
local num_chunks = math.floor(chunks_per_volume * volume)
|
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)
|
local inverse_chance = math.floor(chunk_size*chunk_size*chunk_size / icicles_per_chunk)
|
||||||
for i=1,num_chunks do
|
for i=1,num_chunks do
|
||||||
local y0 = pr:next(y_min, y_max-chunk_size+1)
|
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 x0 = pr:next(minp.x, maxp.x-chunk_size+1)
|
||||||
local z0 = pr:next(minp.z, maxp.z-chunk_size+1)
|
local z0 = pr:next(minp.z, maxp.z-chunk_size+1)
|
||||||
local p0 = {x=x0, y=y0, z=z0}
|
local p0 = {x=x0, y=y0, z=z0}
|
||||||
|
|
|
@ -8,8 +8,8 @@ minetest.register_ore({
|
||||||
clust_scarcity = 20*20*20,
|
clust_scarcity = 20*20*20,
|
||||||
clust_num_ores = 343,
|
clust_num_ores = 343,
|
||||||
clust_size = 7,
|
clust_size = 7,
|
||||||
height_min = -31000,
|
y_min = -31000,
|
||||||
height_max = 0,
|
y_max = 0,
|
||||||
})
|
})
|
||||||
|
|
||||||
dofile(minetest.get_modpath("ores").."/registration.lua")
|
dofile(minetest.get_modpath("ores").."/registration.lua")
|
||||||
|
|
|
@ -2,7 +2,7 @@ realtest.registered_ores = {}
|
||||||
realtest.registered_ores_list = {}
|
realtest.registered_ores_list = {}
|
||||||
local d_seed = 0
|
local d_seed = 0
|
||||||
local function copytable(t)
|
local function copytable(t)
|
||||||
t2 = {}
|
local t2 = {}
|
||||||
for k,i in pairs(t) do
|
for k,i in pairs(t) do
|
||||||
t2[k] = i
|
t2[k] = i
|
||||||
end
|
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_scarcity = 1/(OreDef.chunks_per_volume or 1/3/3/3/2),
|
||||||
clust_size = OreDef.chunk_size or 3,
|
clust_size = OreDef.chunk_size or 3,
|
||||||
clust_num_ores = OreDef.ore_per_chunk or 10,
|
clust_num_ores = OreDef.ore_per_chunk or 10,
|
||||||
height_min = OreDef.height_min or -30912,
|
y_min = OreDef.y_min or -30912,
|
||||||
height_max = OreDef.height_max or 30912,
|
y_max = OreDef.y_max or 30912,
|
||||||
noise_threshhold = OreDef.noise_min or 1.2,
|
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},
|
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
|
generate = true
|
||||||
}
|
}
|
||||||
|
@ -162,31 +162,31 @@ realtest.register_ore("ores:native_gold", {
|
||||||
|
|
||||||
realtest.register_ore("ores:lignite", {
|
realtest.register_ore("ores:lignite", {
|
||||||
description = "Lignite",
|
description = "Lignite",
|
||||||
height_max = -500,
|
y_max = -500,
|
||||||
height_min = -3000,
|
y_min = -3000,
|
||||||
ore_per_chunk = 15,
|
ore_per_chunk = 15,
|
||||||
chunks_per_volume = 1/3/3/3,
|
chunks_per_volume = 1/3/3/3,
|
||||||
})
|
})
|
||||||
|
|
||||||
realtest.register_ore("ores:bituminous_coal", {
|
realtest.register_ore("ores:bituminous_coal", {
|
||||||
description = "Bituminous Coal",
|
description = "Bituminous Coal",
|
||||||
height_max = -3000,
|
y_max = -3000,
|
||||||
height_min = -6000,
|
y_min = -6000,
|
||||||
ore_per_chunk = 15,
|
ore_per_chunk = 15,
|
||||||
chunks_per_volume = 1/3/3/3,
|
chunks_per_volume = 1/3/3/3,
|
||||||
})
|
})
|
||||||
|
|
||||||
realtest.register_ore("ores:anthracite", {
|
realtest.register_ore("ores:anthracite", {
|
||||||
description = "Anthracite",
|
description = "Anthracite",
|
||||||
height_max = -6000,
|
y_max = -6000,
|
||||||
height_min = -8000,
|
y_min = -8000,
|
||||||
ore_per_chunk = 15,
|
ore_per_chunk = 15,
|
||||||
chunks_per_volume = 1/3/3/3,
|
chunks_per_volume = 1/3/3/3,
|
||||||
})
|
})
|
||||||
|
|
||||||
realtest.register_ore("ores:graphite", {
|
realtest.register_ore("ores:graphite", {
|
||||||
description = "Graphite",
|
description = "Graphite",
|
||||||
height_max = -8000,
|
y_max = -8000,
|
||||||
ore_per_chunk = 15,
|
ore_per_chunk = 15,
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue