small changes

This commit is contained in:
HybridDog
2015-08-16 13:20:12 +02:00
parent 54b6d9976c
commit e4e856dd7f

View File

@ -118,32 +118,32 @@ minetest.register_ore({
}) })
-- Sulfur -- Sulfur
minetest.register_on_generated(function(minp, maxp, seed) minetest.register_on_generated(function(minp, maxp)
local vm, emin, emax = minetest.get_mapgen_object("voxelmanip") local vm, emin, emax = minetest.get_mapgen_object("voxelmanip")
local a = VoxelArea:new{
MinEdge = {x = emin.x, y = emin.y, z = emin.z},
MaxEdge = {x = emax.x, y = emax.y, z = emax.z},
}
local data = vm:get_data() local data = vm:get_data()
local a = VoxelArea:new{MinEdge=emin, MaxEdge=emax}
local pr = PseudoRandom(17 * minp.x + 42 * minp.y + 101 * minp.z) local pr = PseudoRandom(17 * minp.x + 42 * minp.y + 101 * minp.z)
local noise = minetest.get_perlin(9876, 3, 0.5, 100) local noise = minetest.get_perlin(9876, 3, 0.5, 100)
local c_lava = minetest.get_content_id("default:lava_source") local c_lava = minetest.get_content_id("default:lava_source")
local c_lava_flowing = minetest.get_content_id("default:lava_flowing") local c_lava_flowing = minetest.get_content_id("default:lava_flowing")
local c_stone = minetest.get_content_id("default:stone") local c_stone = minetest.get_content_id("default:stone")
local c_sulfur = minetest.get_content_id("technic:mineral_sulfur") local c_sulfur = minetest.get_content_id("technic:mineral_sulfur")
local grid_size = 5 local grid_size = 5
for x = minp.x + math.floor(grid_size / 2), maxp.x, grid_size do for x = minp.x + math.floor(grid_size / 2), maxp.x, grid_size do
for y = minp.y + math.floor(grid_size / 2), maxp.y, grid_size do for y = minp.y + math.floor(grid_size / 2), maxp.y, grid_size do
for z = minp.z + math.floor(grid_size / 2), maxp.z, grid_size do for z = minp.z + math.floor(grid_size / 2), maxp.z, grid_size do
local c = data[a:index(x, y, z)] local c = data[a:index(x, y, z)]
if (c == c_lava or c == c_lava_flowing) and noise:get3d({x = x, y = z, z = z}) >= 0.4 then if (c == c_lava or c == c_lava_flowing)
and noise:get3d({x = x, y = z, z = z}) >= 0.4 then
for xx = math.max(minp.x, x - grid_size), math.min(maxp.x, x + grid_size) do for xx = math.max(minp.x, x - grid_size), math.min(maxp.x, x + grid_size) do
for yy = math.max(minp.y, y - grid_size), math.min(maxp.y, y + grid_size) do for yy = math.max(minp.y, y - grid_size), math.min(maxp.y, y + grid_size) do
for zz = math.max(minp.z, z - grid_size), math.min(maxp.z, z + grid_size) do for zz = math.max(minp.z, z - grid_size), math.min(maxp.z, z + grid_size) do
local i = a:index(xx, yy, zz) local i = a:index(xx, yy, zz)
if data[i] == c_stone and pr:next(1, 10) <= 7 then if data[i] == c_stone
and pr:next(1, 10) <= 7 then
data[i] = c_sulfur data[i] = c_sulfur
end end
end end
@ -153,39 +153,38 @@ minetest.register_on_generated(function(minp, maxp, seed)
end end
end end
end end
vm:set_data(data) vm:set_data(data)
vm:write_to_map(data) vm:write_to_map(data)
end) end)
if technic.config:get_bool("enable_marble_generation") then if technic.config:get_bool("enable_marble_generation") then
minetest.register_ore({ minetest.register_ore({
ore_type = "sheet", ore_type = "sheet",
ore = "technic:marble", ore = "technic:marble",
wherein = "default:stone", wherein = "default:stone",
clust_scarcity = 1, clust_scarcity = 1,
clust_num_ores = 1, clust_num_ores = 1,
clust_size = 3, clust_size = 3,
y_min = -31000, y_min = -31000,
y_max = -50, y_max = -50,
noise_threshhold = 0.4, noise_threshhold = 0.4,
noise_params = {offset=0, scale=15, spread={x=150, y=150, z=150}, seed=23, octaves=3, persist=0.70} noise_params = {offset=0, scale=15, spread={x=150, y=150, z=150}, seed=23, octaves=3, persist=0.70}
}) })
end end
if technic.config:get_bool("enable_granite_generation") then if technic.config:get_bool("enable_granite_generation") then
minetest.register_ore({ minetest.register_ore({
ore_type = "sheet", ore_type = "sheet",
ore = "technic:granite", ore = "technic:granite",
wherein = "default:stone", wherein = "default:stone",
clust_scarcity = 1, clust_scarcity = 1,
clust_num_ores = 1, clust_num_ores = 1,
clust_size = 4, clust_size = 4,
y_min = -31000, y_min = -31000,
y_max = -150, y_max = -150,
noise_threshhold = 0.4, noise_threshhold = 0.4,
noise_params = {offset=0, scale=15, spread={x=130, y=130, z=130}, seed=24, octaves=3, persist=0.70} noise_params = {offset=0, scale=15, spread={x=130, y=130, z=130}, seed=24, octaves=3, persist=0.70}
}) })
end end