This commit is contained in:
Thomas--S
2017-03-29 22:04:51 +00:00
committed by GitHub
99 changed files with 3327 additions and 3110 deletions

View File

@ -1,4 +1,3 @@
local S = technic.worldgen.gettext
minetest.register_craftitem(":technic:uranium_lump", {
@ -10,7 +9,7 @@ minetest.register_alias("technic:uranium", "technic:uranium_lump")
minetest.register_craftitem(":technic:uranium_ingot", {
description = S("Uranium Ingot"),
inventory_image = "technic_uranium_ingot.png",
groups = {uranium_ingot=1},
groups = { uranium_ingot = 1 },
})
minetest.register_craftitem(":technic:chromium_lump", {
@ -79,16 +78,16 @@ local function register_block(block, ingot)
minetest.register_craft({
output = block,
recipe = {
{ingot, ingot, ingot},
{ingot, ingot, ingot},
{ingot, ingot, ingot},
{ ingot, ingot, ingot },
{ ingot, ingot, ingot },
{ ingot, ingot, ingot },
}
})
minetest.register_craft({
output = ingot.." 9",
recipe = {
{block}
{ block }
}
})
end
@ -103,45 +102,45 @@ register_block("technic:carbon_steel_block", "technic:carbon_steel_ingot")
register_block("technic:stainless_steel_block", "technic:stainless_steel_ingot")
minetest.register_craft({
type = 'cooking',
type = "cooking",
recipe = "technic:zinc_lump",
output = "technic:zinc_ingot",
})
minetest.register_craft({
type = 'cooking',
type = "cooking",
recipe = "technic:chromium_lump",
output = "technic:chromium_ingot",
})
minetest.register_craft({
type = 'cooking',
type = "cooking",
recipe = "technic:uranium_lump",
output = "technic:uranium_ingot",
})
minetest.register_craft({
type = 'cooking',
type = "cooking",
recipe = "technic:lead_lump",
output = "technic:lead_ingot",
})
minetest.register_craft({
type = 'cooking',
type = "cooking",
recipe = minetest.registered_aliases["technic:wrought_iron_ingot"],
output = "technic:cast_iron_ingot",
})
minetest.register_craft({
type = 'cooking',
type = "cooking",
recipe = "technic:cast_iron_ingot",
cooktime = 2,
output = "technic:wrought_iron_ingot",
})
minetest.register_craft({
type = 'cooking',
type = "cooking",
recipe = "technic:carbon_steel_ingot",
cooktime = 2,
output = "technic:wrought_iron_ingot",

View File

@ -72,7 +72,7 @@ if technic.config:get_bool("enable_granite_generation") then
tmin = 3,
tmax = 6,
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
@ -85,6 +85,6 @@ if technic.config:get_bool("enable_marble_generation") then
tmin = 3,
tmax = 6,
threshhold = 0.4,
noise_params = {offset=0, scale=15, spread={x=130, y=130, z=130}, seed=23, octaves=3, persist=0.70}
noise_params = { offset = 0, scale = 15, spread = { x = 130, y = 130, z = 130 }, seed = 23, octaves = 3, persist = 0.70 }
})
end

View File

@ -1,80 +1,79 @@
local S = technic.worldgen.gettext
minetest.register_node( ":technic:mineral_uranium", {
minetest.register_node(":technic:mineral_uranium", {
description = S("Uranium Ore"),
tiles = { "default_stone.png^technic_mineral_uranium.png" },
is_ground_content = true,
groups = {cracky=3, radioactive=1},
groups = { cracky = 3, radioactive = 1 },
sounds = default.node_sound_stone_defaults(),
drop = "technic:uranium_lump",
})
})
minetest.register_node( ":technic:mineral_chromium", {
minetest.register_node(":technic:mineral_chromium", {
description = S("Chromium Ore"),
tiles = { "default_stone.png^technic_mineral_chromium.png" },
is_ground_content = true,
groups = {cracky=3},
groups = { cracky = 3 },
sounds = default.node_sound_stone_defaults(),
drop = "technic:chromium_lump",
})
})
minetest.register_node( ":technic:mineral_zinc", {
minetest.register_node(":technic:mineral_zinc", {
description = S("Zinc Ore"),
tiles = { "default_stone.png^technic_mineral_zinc.png" },
is_ground_content = true,
groups = {cracky=3},
groups = { cracky = 3 },
sounds = default.node_sound_stone_defaults(),
drop = "technic:zinc_lump",
})
minetest.register_node( ":technic:mineral_lead", {
minetest.register_node(":technic:mineral_lead", {
description = S("Lead Ore"),
tiles = { "default_stone.png^technic_mineral_lead.png" },
is_ground_content = true,
groups = {cracky=3},
groups = { cracky = 3 },
sounds = default.node_sound_stone_defaults(),
drop = "technic:lead_lump",
})
minetest.register_node( ":technic:mineral_sulfur", {
minetest.register_node(":technic:mineral_sulfur", {
description = S("Sulfur Ore"),
tiles = { "default_stone.png^technic_mineral_sulfur.png" },
is_ground_content = true,
groups = {cracky=3},
groups = { cracky = 3 },
sounds = default.node_sound_stone_defaults(),
drop = "technic:sulfur_lump",
})
minetest.register_node( ":technic:granite", {
minetest.register_node(":technic:granite", {
description = S("Granite"),
tiles = { "technic_granite.png" },
is_ground_content = true,
groups = {cracky=1},
groups = { cracky = 1 },
sounds = default.node_sound_stone_defaults(),
})
})
minetest.register_node( ":technic:marble", {
minetest.register_node(":technic:marble", {
description = S("Marble"),
tiles = { "technic_marble.png" },
is_ground_content = true,
groups = {cracky=3, marble=1},
groups = { cracky = 3, marble = 1 },
sounds = default.node_sound_stone_defaults(),
})
})
minetest.register_node( ":technic:marble_bricks", {
minetest.register_node(":technic:marble_bricks", {
description = S("Marble Bricks"),
tiles = { "technic_marble_bricks.png" },
is_ground_content = true,
groups = {cracky=3},
groups = { cracky = 3 },
sounds = default.node_sound_stone_defaults(),
})
})
minetest.register_node(":technic:uranium_block", {
description = S("Uranium Block"),
tiles = { "technic_uranium_block.png" },
is_ground_content = true,
groups = {uranium_block=1, cracky=1, level=2, radioactive=2},
groups = { uranium_block = 1, cracky = 1, level = 2, radioactive = 2 },
sounds = default.node_sound_stone_defaults()
})
@ -82,7 +81,7 @@ minetest.register_node(":technic:chromium_block", {
description = S("Chromium Block"),
tiles = { "technic_chromium_block.png" },
is_ground_content = true,
groups = {cracky=1, level=2},
groups = { cracky = 1, level = 2 },
sounds = default.node_sound_stone_defaults()
})
@ -90,7 +89,7 @@ minetest.register_node(":technic:zinc_block", {
description = S("Zinc Block"),
tiles = { "technic_zinc_block.png" },
is_ground_content = true,
groups = {cracky=1, level=2},
groups = { cracky = 1, level = 2 },
sounds = default.node_sound_stone_defaults()
})
@ -98,7 +97,7 @@ minetest.register_node(":technic:lead_block", {
description = S("Lead Block"),
tiles = { "technic_lead_block.png" },
is_ground_content = true,
groups = {cracky=1, level=2},
groups = { cracky = 1, level = 2 },
sounds = default.node_sound_stone_defaults()
})
@ -113,7 +112,7 @@ minetest.register_node(":technic:cast_iron_block", {
description = S("Cast Iron Block"),
tiles = { "technic_cast_iron_block.png" },
is_ground_content = true,
groups = {cracky=1, level=2},
groups = { cracky = 1, level = 2 },
sounds = default.node_sound_stone_defaults()
})
@ -121,7 +120,7 @@ minetest.register_node(":technic:carbon_steel_block", {
description = S("Carbon Steel Block"),
tiles = { "technic_carbon_steel_block.png" },
is_ground_content = true,
groups = {cracky=1, level=2},
groups = { cracky = 1, level = 2 },
sounds = default.node_sound_stone_defaults()
})
@ -129,7 +128,7 @@ minetest.register_node(":technic:stainless_steel_block", {
description = S("Stainless Steel Block"),
tiles = { "technic_stainless_steel_block.png" },
is_ground_content = true,
groups = {cracky=1, level=2},
groups = { cracky = 1, level = 2 },
sounds = default.node_sound_stone_defaults()
})
@ -137,15 +136,15 @@ minetest.register_node(":technic:brass_block", {
description = S("Brass Block"),
tiles = { "technic_brass_block.png" },
is_ground_content = true,
groups = {cracky=1, level=2},
groups = { cracky = 1, level = 2 },
sounds = default.node_sound_stone_defaults()
})
minetest.register_craft({
output = 'technic:marble_bricks 4',
recipe = {
{'technic:marble','technic:marble'},
{'technic:marble','technic:marble'}
{ "technic:marble", "technic:marble" },
{ "technic:marble", "technic:marble" }
}
})
@ -177,7 +176,7 @@ for_each_registered_node(function(node_name, node_def)
local new_tiles = {}
local do_override = false
if type(tiles) == "string" then
tiles = {tiles}
tiles = { tiles }
end
for i, t in ipairs(tiles) do
if type(t) == "string" and t == "default_steel_block.png" then

View File

@ -1,189 +1,189 @@
local uranium_params = {offset = 0, scale = 1, spread = {x = 100, y = 100, z = 100}, seed = 420, octaves = 3, persist = 0.7}
local uranium_params = { offset = 0, scale = 1, spread = { x = 100, y = 100, z = 100 }, seed = 420, octaves = 3, persist = 0.7 }
local uranium_threshhold = 0.55
local chromium_params = {offset = 0, scale = 1, spread = {x = 100, y = 100, z = 100}, seed = 421, octaves = 3, persist = 0.7}
local chromium_params = { offset = 0, scale = 1, spread = { x = 100, y = 100, z = 100 }, seed = 421, octaves = 3, persist = 0.7 }
local chromium_threshhold = 0.55
local zinc_params = {offset = 0, scale = 1, spread = {x = 100, y = 100, z = 100}, seed = 422, octaves = 3, persist = 0.7}
local zinc_params = { offset = 0, scale = 1, spread = { x = 100, y = 100, z = 100 }, seed = 422, octaves = 3, persist = 0.7 }
local zinc_threshhold = 0.5
local lead_params = {offset = 0, scale = 1, spread = {x = 100, y = 100, z = 100}, seed = 423, octaves = 3, persist = 0.7}
local lead_params = { offset = 0, scale = 1, spread = { x = 100, y = 100, z = 100 }, seed = 423, octaves = 3, persist = 0.7 }
local lead_threshhold = 0.3
minetest.register_ore({
ore_type = "scatter",
ore = "technic:mineral_uranium",
wherein = "default:stone",
clust_scarcity = 8*8*8,
clust_num_ores = 4,
clust_size = 3,
y_min = -300,
y_max = -80,
noise_params = uranium_params,
ore_type = "scatter",
ore = "technic:mineral_uranium",
wherein = "default:stone",
clust_scarcity = 8 * 8 * 8,
clust_num_ores = 4,
clust_size = 3,
y_min = -300,
y_max = -80,
noise_params = uranium_params,
noise_threshhold = uranium_threshhold,
})
minetest.register_ore({
ore_type = "scatter",
ore = "technic:mineral_chromium",
wherein = "default:stone",
clust_scarcity = 8*8*8,
clust_num_ores = 2,
clust_size = 3,
y_min = -200,
y_max = -100,
noise_params = chromium_params,
ore_type = "scatter",
ore = "technic:mineral_chromium",
wherein = "default:stone",
clust_scarcity = 8 * 8 * 8,
clust_num_ores = 2,
clust_size = 3,
y_min = -200,
y_max = -100,
noise_params = chromium_params,
noise_threshhold = chromium_threshhold,
})
minetest.register_ore({
ore_type = "scatter",
ore = "technic:mineral_chromium",
wherein = "default:stone",
clust_scarcity = 6*6*6,
clust_num_ores = 2,
clust_size = 3,
y_min = -31000,
y_max = -200,
flags = "absheight",
noise_params = chromium_params,
ore_type = "scatter",
ore = "technic:mineral_chromium",
wherein = "default:stone",
clust_scarcity = 6 * 6 * 6,
clust_num_ores = 2,
clust_size = 3,
y_min = -31000,
y_max = -200,
flags = "absheight",
noise_params = chromium_params,
noise_threshhold = chromium_threshhold,
})
minetest.register_ore({
ore_type = "scatter",
ore = "technic:mineral_zinc",
wherein = "default:stone",
clust_scarcity = 8*8*8,
clust_num_ores = 5,
clust_size = 7,
y_min = -32,
y_max = 2
ore_type = "scatter",
ore = "technic:mineral_zinc",
wherein = "default:stone",
clust_scarcity = 8 * 8 * 8,
clust_num_ores = 5,
clust_size = 7,
y_min = -32,
y_max = 2
})
minetest.register_ore({
ore_type = "scatter",
ore = "technic:mineral_zinc",
wherein = "default:stone",
clust_scarcity = 6*6*6,
clust_num_ores = 4,
clust_size = 3,
y_min = -31000,
y_max = -32,
flags = "absheight",
noise_params = zinc_params,
ore_type = "scatter",
ore = "technic:mineral_zinc",
wherein = "default:stone",
clust_scarcity = 6 * 6 * 6,
clust_num_ores = 4,
clust_size = 3,
y_min = -31000,
y_max = -32,
flags = "absheight",
noise_params = zinc_params,
noise_threshhold = zinc_threshhold,
})
minetest.register_ore({
ore_type = "scatter",
ore = "technic:mineral_lead",
wherein = "default:stone",
clust_scarcity = 9*9*9,
clust_num_ores = 5,
clust_size = 3,
y_min = -16,
y_max = 16,
noise_params = lead_params,
ore_type = "scatter",
ore = "technic:mineral_lead",
wherein = "default:stone",
clust_scarcity = 9 * 9 * 9,
clust_num_ores = 5,
clust_size = 3,
y_min = -16,
y_max = 16,
noise_params = lead_params,
noise_threshhold = lead_threshhold,
})
minetest.register_ore({
ore_type = "scatter",
ore = "technic:mineral_lead",
wherein = "default:stone",
clust_scarcity = 8*8*8,
clust_num_ores = 5,
clust_size = 3,
y_min = -128,
y_max = -16,
noise_params = lead_params,
ore_type = "scatter",
ore = "technic:mineral_lead",
wherein = "default:stone",
clust_scarcity = 8 * 8 * 8,
clust_num_ores = 5,
clust_size = 3,
y_min = -128,
y_max = -16,
noise_params = lead_params,
noise_threshhold = lead_threshhold,
})
minetest.register_ore({
ore_type = "scatter",
ore = "technic:mineral_lead",
wherein = "default:stone",
clust_scarcity = 6*6*6,
clust_num_ores = 5,
clust_size = 3,
y_min = -31000,
y_max = -128,
flags = "absheight",
noise_params = lead_params,
ore_type = "scatter",
ore = "technic:mineral_lead",
wherein = "default:stone",
clust_scarcity = 6 * 6 * 6,
clust_num_ores = 5,
clust_size = 3,
y_min = -31000,
y_max = -128,
flags = "absheight",
noise_params = lead_params,
noise_threshhold = lead_threshhold,
})
-- Sulfur
minetest.register_on_generated(function(minp, maxp, seed)
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 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 pr = PseudoRandom(17 * minp.x + 42 * minp.y + 101 * minp.z)
local noise = minetest.get_perlin(9876, 3, 0.5, 100)
local c_lava = minetest.get_content_id("default:lava_source")
local c_lava_flowing = minetest.get_content_id("default:lava_flowing")
local c_stone = minetest.get_content_id("default:stone")
local c_sulfur = minetest.get_content_id("technic:mineral_sulfur")
local grid_size = 5
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 z = minp.z + math.floor(grid_size / 2), maxp.z, grid_size do
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
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 zz = math.max(minp.z, z - grid_size), math.min(maxp.z, z + grid_size) do
local i = a:index(xx, yy, zz)
if data[i] == c_stone and pr:next(1, 10) <= 7 then
data[i] = c_sulfur
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
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
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 zz = math.max(minp.z, z - grid_size), math.min(maxp.z, z + grid_size) do
local i = a:index(xx, yy, zz)
if data[i] == c_stone and pr:next(1, 10) <= 7 then
data[i] = c_sulfur
end
end
end
end
end
end
end
end
end
end
end
end
vm:set_data(data)
vm:write_to_map(data)
end)
if technic.config:get_bool("enable_marble_generation") then
minetest.register_ore({
ore_type = "sheet",
ore = "technic:marble",
wherein = "default:stone",
clust_scarcity = 1,
clust_num_ores = 1,
clust_size = 3,
y_min = -31000,
y_max = -50,
noise_threshhold = 0.4,
noise_params = {offset=0, scale=15, spread={x=150, y=150, z=150}, seed=23, octaves=3, persist=0.70}
})
minetest.register_ore({
ore_type = "sheet",
ore = "technic:marble",
wherein = "default:stone",
clust_scarcity = 1,
clust_num_ores = 1,
clust_size = 3,
y_min = -31000,
y_max = -50,
noise_threshhold = 0.4,
noise_params = { offset = 0, scale = 15, spread = { x = 150, y = 150, z = 150 }, seed = 23, octaves = 3, persist = 0.70 }
})
end
if technic.config:get_bool("enable_granite_generation") then
minetest.register_ore({
ore_type = "sheet",
ore = "technic:granite",
wherein = "default:stone",
clust_scarcity = 1,
clust_num_ores = 1,
clust_size = 4,
y_min = -31000,
y_max = -150,
noise_threshhold = 0.4,
noise_params = {offset=0, scale=15, spread={x=130, y=130, z=130}, seed=24, octaves=3, persist=0.70}
})
minetest.register_ore({
ore_type = "sheet",
ore = "technic:granite",
wherein = "default:stone",
clust_scarcity = 1,
clust_num_ores = 1,
clust_size = 4,
y_min = -31000,
y_max = -150,
noise_threshhold = 0.4,
noise_params = { offset = 0, scale = 15, spread = { x = 130, y = 130, z = 130 }, seed = 24, octaves = 3, persist = 0.70 }
})
end

View File

@ -5,12 +5,12 @@ local S = technic.worldgen.gettext
minetest.register_node(":moretrees:rubber_tree_sapling", {
description = S("Rubber Tree Sapling"),
drawtype = "plantlike",
tiles = {"technic_rubber_sapling.png"},
tiles = { "technic_rubber_sapling.png" },
inventory_image = "technic_rubber_sapling.png",
wield_image = "technic_rubber_sapling.png",
paramtype = "light",
walkable = false,
groups = {dig_immediate=3, flammable=2},
groups = { dig_immediate = 3, flammable = 2 },
sounds = default.node_sound_defaults(),
})
@ -22,43 +22,59 @@ minetest.register_craft({
minetest.register_node(":moretrees:rubber_tree_trunk", {
description = S("Rubber Tree"),
tiles = {"default_tree_top.png", "default_tree_top.png",
"technic_rubber_tree_full.png"},
groups = {tree=1, snappy=1, choppy=2, oddly_breakable_by_hand=1,
flammable=2},
tiles = {
"default_tree_top.png", "default_tree_top.png",
"technic_rubber_tree_full.png"
},
groups = {
tree = 1,
snappy = 1,
choppy = 2,
oddly_breakable_by_hand = 1,
flammable = 2
},
sounds = default.node_sound_wood_defaults(),
})
minetest.register_node(":moretrees:rubber_tree_trunk_empty", {
description = S("Rubber Tree"),
tiles = {"default_tree_top.png", "default_tree_top.png",
"technic_rubber_tree_empty.png"},
groups = {tree=1, snappy=1, choppy=2, oddly_breakable_by_hand=1,
flammable=2, not_in_creative_inventory=1},
tiles = {
"default_tree_top.png", "default_tree_top.png",
"technic_rubber_tree_empty.png"
},
groups = {
tree = 1,
snappy = 1,
choppy = 2,
oddly_breakable_by_hand = 1,
flammable = 2,
not_in_creative_inventory = 1
},
sounds = default.node_sound_wood_defaults(),
})
minetest.register_node(":moretrees:rubber_tree_leaves", {
drawtype = "allfaces_optional",
description = S("Rubber Tree Leaves"),
tiles = {"technic_rubber_leaves.png"},
tiles = { "technic_rubber_leaves.png" },
paramtype = "light",
groups = {snappy=3, leafdecay=3, flammable=2, leaves=1},
groups = { snappy = 3, leafdecay = 3, flammable = 2, leaves = 1 },
drop = {
max_items = 1,
items = {{
items = {"moretrees:rubber_tree_sapling"},
rarity = 20,
},
{
items = {"moretrees:rubber_tree_leaves"},
}
items = {
{
items = { "moretrees:rubber_tree_sapling" },
rarity = 20,
},
{
items = { "moretrees:rubber_tree_leaves" },
}
}
},
sounds = default.node_sound_leaves_defaults(),
})
technic.rubber_tree_model={
technic.rubber_tree_model = {
axiom = "FFFFA",
rules_a = "[&FFBFA]////[&BFFFA]////[&FBFFA]",
rules_b = "[&FFA]////[&FFA]////[&FFA]",
@ -72,7 +88,7 @@ technic.rubber_tree_model={
}
minetest.register_abm({
nodenames = {"moretrees:rubber_tree_sapling"},
nodenames = { "moretrees:rubber_tree_sapling" },
interval = 60,
chance = 20,
action = function(pos, node)
@ -87,13 +103,14 @@ if technic.config:get_bool("enable_rubber_tree_generation") then
return
end
local tmp = {
x = (maxp.x - minp.x) / 2 + minp.x,
y = (maxp.y - minp.y) / 2 + minp.y,
z = (maxp.z - minp.z) / 2 + minp.z}
x = (maxp.x - minp.x) / 2 + minp.x,
y = (maxp.y - minp.y) / 2 + minp.y,
z = (maxp.z - minp.z) / 2 + minp.z
}
local pos = minetest.find_node_near(tmp, maxp.x - minp.x,
{"default:dirt_with_grass"})
{ "default:dirt_with_grass" })
if pos ~= nil then
minetest.spawn_tree({x=pos.x, y=pos.y+1, z=pos.z}, technic.rubber_tree_model)
minetest.spawn_tree({ x = pos.x, y = pos.y + 1, z = pos.z }, technic.rubber_tree_model)
end
end)
end