diff options
Diffstat (limited to 'technic/technic_worldgen')
65 files changed, 933 insertions, 0 deletions
| diff --git a/technic/technic_worldgen/config.lua b/technic/technic_worldgen/config.lua new file mode 100644 index 0000000..4ac748c --- /dev/null +++ b/technic/technic_worldgen/config.lua @@ -0,0 +1,15 @@ +technic.config = technic.config or Settings(minetest.get_worldpath().."/technic.conf") + +local conf_table = technic.config:to_table() + +local defaults = { +	enable_granite_generation = "true", +	enable_marble_generation = "true", +	enable_rubber_tree_generation = "true", +} + +for k, v in pairs(defaults) do +	if conf_table[k] == nil then +		technic.config:set(k, v) +	end +end diff --git a/technic/technic_worldgen/crafts.lua b/technic/technic_worldgen/crafts.lua new file mode 100644 index 0000000..fba9df9 --- /dev/null +++ b/technic/technic_worldgen/crafts.lua @@ -0,0 +1,198 @@ + +local S = technic.worldgen.gettext + +minetest.register_craftitem(":technic:uranium_lump", { +	description = S("Uranium Lump"), +	inventory_image = "technic_uranium_lump.png", +}) +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}, +}) + +minetest.register_craftitem(":technic:chromium_lump", { +	description = S("Chromium Lump"), +	inventory_image = "technic_chromium_lump.png", +}) + +minetest.register_craftitem(":technic:chromium_ingot", { +	description = S("Chromium Ingot"), +	inventory_image = "technic_chromium_ingot.png", +}) + +minetest.register_craftitem(":technic:zinc_lump", { +	description = S("Zinc Lump"), +	inventory_image = "technic_zinc_lump.png", +}) + +minetest.register_craftitem(":technic:zinc_ingot", { +	description = S("Zinc Ingot"), +	inventory_image = "technic_zinc_ingot.png", +}) + +minetest.register_craftitem(":technic:lead_lump", { +	description = S("Lead Lump"), +	inventory_image = "technic_lead_lump.png", +}) + +minetest.register_craftitem(":technic:lead_ingot", { +	description = S("Lead Ingot"), +	inventory_image = "technic_lead_ingot.png", +}) + +minetest.register_craftitem(":technic:sulfur_lump", { +	description = S("Sulfur Lump"), +	inventory_image = "technic_sulfur_lump.png", +}) + +minetest.register_craftitem(":technic:brass_ingot", { +	description = S("Brass Ingot"), +	inventory_image = "technic_brass_ingot.png", +}) + +minetest.register_alias("technic:wrought_iron_ingot", "default:steel_ingot") + +minetest.override_item("default:steel_ingot", { +	description = S("Wrought Iron Ingot"), +	inventory_image = "technic_wrought_iron_ingot.png", +}) + +minetest.register_craftitem(":technic:cast_iron_ingot", { +	description = S("Cast Iron Ingot"), +	inventory_image = "technic_cast_iron_ingot.png", +}) + +minetest.register_craftitem(":technic:carbon_steel_ingot", { +	description = S("Carbon Steel Ingot"), +	inventory_image = "technic_carbon_steel_ingot.png", +}) + +minetest.register_craftitem(":technic:stainless_steel_ingot", { +	description = S("Stainless Steel Ingot"), +	inventory_image = "technic_stainless_steel_ingot.png", +}) + +local function register_block(block, ingot) +	minetest.register_craft({ +		output = block, +		recipe = { +			{ingot, ingot, ingot}, +			{ingot, ingot, ingot}, +			{ingot, ingot, ingot}, +		} +	}) + +	minetest.register_craft({ +		output = ingot.." 9", +		recipe = { +			{block} +		} +	}) +end + +register_block("technic:uranium_block", "technic:uranium_ingot") +register_block("technic:chromium_block", "technic:chromium_ingot") +register_block("technic:zinc_block", "technic:zinc_ingot") +register_block("technic:lead_block", "technic:lead_ingot") +register_block("technic:brass_block", "technic:brass_ingot") +register_block("technic:cast_iron_block", "technic:cast_iron_ingot") +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', +	recipe = "technic:zinc_lump", +	output = "technic:zinc_ingot", +}) + +minetest.register_craft({ +	type = 'cooking', +	recipe = "technic:chromium_lump", +	output = "technic:chromium_ingot", +}) + +minetest.register_craft({ +	type = 'cooking', +	recipe = "technic:uranium_lump", +	output = "technic:uranium_ingot", +}) + +minetest.register_craft({ +	type = 'cooking', +	recipe = "technic:lead_lump", +	output = "technic:lead_ingot", +}) + + +minetest.register_craft({ +	type = 'cooking', +	recipe = minetest.registered_aliases["technic:wrought_iron_ingot"], +	output = "technic:cast_iron_ingot", +}) + +minetest.register_craft({ +	type = 'cooking', +	recipe = "technic:cast_iron_ingot", +	cooktime = 2, +	output = "technic:wrought_iron_ingot", +}) + +minetest.register_craft({ +	type = 'cooking', +	recipe = "technic:carbon_steel_ingot", +	cooktime = 2, +	output = "technic:wrought_iron_ingot", +}) + +local function for_each_registered_item(action) +	local already_reg = {} +	for k, _ in pairs(minetest.registered_items) do +		table.insert(already_reg, k) +	end +	local really_register_craftitem = minetest.register_craftitem +	minetest.register_craftitem = function(name, def) +		really_register_craftitem(name, def) +		action(string.gsub(name, "^:", "")) +	end +	local really_register_tool = minetest.register_tool +	minetest.register_tool = function(name, def) +		really_register_tool(name, def) +		action(string.gsub(name, "^:", "")) +	end +	local really_register_node = minetest.register_node +	minetest.register_node = function(name, def) +		really_register_node(name, def) +		action(string.gsub(name, "^:", "")) +	end +	for _, name in ipairs(already_reg) do +		action(name) +	end +end + +local steel_to_iron = {} +for _, i in ipairs({ +	"default:axe_steel", +	"default:pick_steel", +	"default:shovel_steel", +	"default:sword_steel", +	"doors:door_steel", +	"farming:hoe_steel", +	"glooptest:hammer_steel", +	"glooptest:handsaw_steel", +	"glooptest:reinforced_crystal_glass", +	"mesecons_doors:op_door_steel", +	"mesecons_doors:sig_door_steel", +	"vessels:steel_bottle", +}) do +	steel_to_iron[i] = true +end + +for_each_registered_item(function(item_name) +	local item_def = minetest.registered_items[item_name] +	if steel_to_iron[item_name] and string.find(item_def.description, "Steel") then +		minetest.override_item(item_name, { description = string.gsub(item_def.description, "Steel", S("Iron")) }) +	end +end) diff --git a/technic/technic_worldgen/depends.txt b/technic/technic_worldgen/depends.txt new file mode 100644 index 0000000..ac858d0 --- /dev/null +++ b/technic/technic_worldgen/depends.txt @@ -0,0 +1,3 @@ +default +intllib? +mg? diff --git a/technic/technic_worldgen/init.lua b/technic/technic_worldgen/init.lua new file mode 100644 index 0000000..2f36920 --- /dev/null +++ b/technic/technic_worldgen/init.lua @@ -0,0 +1,26 @@ +local modpath = minetest.get_modpath("technic_worldgen") + +technic = rawget(_G, "technic") or {} +technic.worldgen = { +	gettext = rawget(_G, "intllib") and intllib.Getter() or function(s) return s end, +} + +dofile(modpath.."/config.lua") +dofile(modpath.."/nodes.lua") +dofile(modpath.."/oregen.lua") +dofile(modpath.."/crafts.lua") + +-- Rubber trees, moretrees also supplies these +if not minetest.get_modpath("moretrees") then +	dofile(modpath.."/rubber.lua") +else +	-- older versions of technic provided rubber trees regardless +	minetest.register_alias("technic:rubber_sapling", "moretrees:rubber_tree_sapling") +	minetest.register_alias("technic:rubber_tree_empty", "moretrees:rubber_tree_trunk_empty") +end + +-- mg suppport +if minetest.get_modpath("mg") then +	dofile(modpath.."/mg.lua") +end + diff --git a/technic/technic_worldgen/locale/de.txt b/technic/technic_worldgen/locale/de.txt new file mode 100644 index 0000000..401c94c --- /dev/null +++ b/technic/technic_worldgen/locale/de.txt @@ -0,0 +1,39 @@ +# German Translation for technic_worldgen +# Deutsche Übersetzung von technic_worldgen +# by Xanthin + +## crafts.lua +Uranium Lump = Uranklumpen +Uranium Ingot = Uranbarren +Chromium Lump = Chromklumpen +Chromium Ingot = Chrombarren +Zinc Lump = Zinkklumpen +Zinc Ingot = Zinkbarren +Brass Ingot = Messingbarren +Wrought Iron Ingot = Schmiedeeisenbarren +Cast Iron Ingot = Gusseisenbarren +Carbon Steel Ingot = Kohlenstoffstahlbarren +Stainless Steel Ingot = Edelstahlbarren +Iron = Eisen + +## nodes.lua +Uranium Ore = Uranerz +Chromium Ore = Chromerz +Zinc Ore = Zinkerz +Granite = Granit +Marble = Marmor +Marble Bricks = Marmorziegel +Uranium Block = Uranblock +Chromium Block = Chromblock +Zinc Block = Zinkblock +Wrought Iron Block = Schmiedeeisenblock +Cast Iron Block = Gusseisenblock +Carbon Steel Block = Kohlenstoffstahlblock +Stainless Steel Block = Edelstahlblock +Brass Block = Messingblock +Wrought Iron = Schmiedeeisen + +## rubber.lua +Rubber Tree Sapling = Gummibaumsetzling +Rubber Tree = Gummibaum + diff --git a/technic/technic_worldgen/locale/template.txt b/technic/technic_worldgen/locale/template.txt new file mode 100644 index 0000000..594e0ce --- /dev/null +++ b/technic/technic_worldgen/locale/template.txt @@ -0,0 +1,37 @@ +# template.txt +# technic_worldgen translation template + +###crafts.lua +Uranium Lump =  +Uranium Ingot =  +Chromium Lump =  +Chromium Ingot =  +Zinc Lump =  +Zinc Ingot =  +Brass Ingot =  +Wrought Iron Ingot = +Cast Iron Ingot = +Carbon Steel Ingot = +Stainless Steel Ingot =  +Iron = + +###nodes.lua +Uranium Ore =  +Chromium Ore =  +Zinc Ore =  +Granite =  +Marble =  +Marble Bricks =  +Uranium Block =  +Chromium Block =  +Zinc Block =  +Wrought Iron Block = +Cast Iron Block = +Carbon Steel Block = +Stainless Steel Block =  +Brass Block =  +Wrought Iron = + +###rubber.lua +Rubber Tree Sapling =  +Rubber Tree =  diff --git a/technic/technic_worldgen/locale/tr.txt b/technic/technic_worldgen/locale/tr.txt new file mode 100644 index 0000000..a04597f --- /dev/null +++ b/technic/technic_worldgen/locale/tr.txt @@ -0,0 +1,38 @@ +# Turkish translation +# mahmutelmas06@hotmail.com  +# Türkçe çeviri + +###crafts.lua +Uranium Lump = Uranyum yığını  +Uranium Ingot = Uranyum külçesi +Chromium Lump = Krom yığını +Chromium Ingot = Krom külçesi +Zinc Lump = Çinko yığını +Zinc Ingot = Çünko külçesi +Brass Ingot = Pirinç yığını  +Wrought Iron Ingot = İşlenmiş demir yığını +Cast Iron Ingot = Döküm demir yığını +Carbon Steel Ingot = Karbon çelik külçe  +Stainless Steel Ingot =Paslanmaz çelik külçe  +Iron = Demir + +###nodes.lua +Uranium Ore = Uranyum madeni  +Chromium Ore = Krom madeni  +Zinc Ore = Çinko madeni  +Granite = Granit +Marble = Mermer +Marble Bricks = Mermer tuğla  +Uranium Block = Uranyum blok  +Chromium Block = Karbon blok  +Zinc Block = Çinko blok  +Wrought Iron Block = İşlenmiş demir blok +Cast Iron Block = Döküm demir blok +Carbon Steel Block = Karbon çelik blok +Stainless Steel Block = Paslanmaz çelik blok  +Brass Block = Pirinç blok +Wrought Iron = İşlenmiş demir + +###rubber.lua +Rubber Tree Sapling = Kauçuk ağacı fidanı +Rubber Tree = Kauçuk ağacı  diff --git a/technic/technic_worldgen/mg.lua b/technic/technic_worldgen/mg.lua new file mode 100644 index 0000000..4025384 --- /dev/null +++ b/technic/technic_worldgen/mg.lua @@ -0,0 +1,90 @@ +mg.register_ore({ +	name = "technic:mineral_uranium", +	wherein = "default:stone", +	seeddiff = 11, +	maxvdistance = 10.5, +	maxheight = -80, +	minheight = -300, +	sizen = 20, +	sizedev = 10, +	seglenghtn = 3, +	seglenghtdev = 1, +	segincln = 0.4, +	segincldev = 0.6, +	turnangle = 57, +	numperblock = 1, +	fork_chance = 0 +}) + +mg.register_ore({ +	name = "technic:mineral_chromium", +	wherein = "default:stone", +	seeddiff = 12, +	maxvdistance = 10.5, +	maxheight = -100, +	sizen = 50, +	sizedev = 20, +	seglenghtn = 8, +	seglenghtdev = 3, +	segincln = 0, +	segincldev = 0.6, +	turnangle = 57, +	forkturnangle = 57, +	numperblock = 2 +}) + +mg.register_ore({ +	name = "technic:mineral_zinc", +	wherein = "default:stone", +	seeddiff = 13, +	maxvdistance = 10.5, +	maxheight = 2, +	seglenghtn = 15, +	seglenghtdev = 6, +	segincln = 0, +	segincldev = 0.6, +	turnangle = 57, +	forkturnangle = 57, +	numperblock = 2 +}) + +mg.register_ore({ +	name = "technic:mineral_lead", +	wherein = "default:stone", +	seeddiff = 13, +	maxvdistance = 10.5, +	maxheight = 16, +	seglenghtn = 15, +	seglenghtdev = 6, +	segincln = 0, +	segincldev = 0.6, +	turnangle = 57, +	forkturnangle = 57, +	numperblock = 3 +}) + +if technic.config:get_bool("enable_granite_generation") then +	mg.register_ore_sheet({ +		name = "technic:granite", +		wherein = "default:stone", +		height_min = -31000, +		height_max = -150, +		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} +	}) +end + +if technic.config:get_bool("enable_marble_generation") then +	mg.register_ore_sheet({ +		name = "technic:marble", +		wherein = "default:stone", +		height_min = -31000, +		height_max = -50, +		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} +	}) +end diff --git a/technic/technic_worldgen/nodes.lua b/technic/technic_worldgen/nodes.lua new file mode 100644 index 0000000..a4fe2dd --- /dev/null +++ b/technic/technic_worldgen/nodes.lua @@ -0,0 +1,196 @@ + +local S = technic.worldgen.gettext + +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=1000}, +	sounds = default.node_sound_stone_defaults(), +	drop = "technic:uranium_lump", +})  + +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}, +	sounds = default.node_sound_stone_defaults(), +	drop = "technic:chromium_lump", +})  + +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}, +	sounds = default.node_sound_stone_defaults(), +	drop = "technic:zinc_lump", +}) + +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}, +	sounds = default.node_sound_stone_defaults(), +	drop = "technic:lead_lump", +}) + +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}, +	sounds = default.node_sound_stone_defaults(), +	drop = "technic:sulfur_lump", +}) + +minetest.register_node( ":technic:granite", { +	description = S("Granite"), +	tiles = { "technic_granite.png" }, +	is_ground_content = true, +	groups = {cracky=1}, +	sounds = default.node_sound_stone_defaults(), +})  + +minetest.register_node( ":technic:marble", { +	description = S("Marble"), +	tiles = { "technic_marble.png" }, +	is_ground_content = true, +	groups = {cracky=3, marble=1}, +	sounds = default.node_sound_stone_defaults(), +})  + +minetest.register_node( ":technic:marble_bricks", { +	description = S("Marble Bricks"), +	tiles = { "technic_marble_bricks.png" }, +	is_ground_content = true, +	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=3000}, +	sounds = default.node_sound_stone_defaults() +}) + +minetest.register_node(":technic:chromium_block", { +	description = S("Chromium Block"), +	tiles = { "technic_chromium_block.png" }, +	is_ground_content = true, +	groups = {cracky=1, level=2}, +	sounds = default.node_sound_stone_defaults() +}) + +minetest.register_node(":technic:zinc_block", { +	description = S("Zinc Block"), +	tiles = { "technic_zinc_block.png" }, +	is_ground_content = true, +	groups = {cracky=1, level=2}, +	sounds = default.node_sound_stone_defaults() +}) + +minetest.register_node(":technic:lead_block", { +	description = S("Lead Block"), +	tiles = { "technic_lead_block.png" }, +	is_ground_content = true, +	groups = {cracky=1, level=2}, +	sounds = default.node_sound_stone_defaults() +}) + +minetest.register_alias("technic:wrought_iron_block", "default:steelblock") + +minetest.override_item("default:steelblock", { +	description = S("Wrought Iron Block"), +	tiles = { "technic_wrought_iron_block.png" }, +}) + +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}, +	sounds = default.node_sound_stone_defaults() +}) + +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}, +	sounds = default.node_sound_stone_defaults() +}) + +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}, +	sounds = default.node_sound_stone_defaults() +}) + +minetest.register_node(":technic:brass_block", { +	description = S("Brass Block"), +	tiles = { "technic_brass_block.png" }, +	is_ground_content = true, +	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'} +	} +}) + +minetest.register_alias("technic:diamond_block", "default:diamondblock") +minetest.register_alias("technic:diamond", "default:diamond") +minetest.register_alias("technic:mineral_diamond", "default:stone_with_diamond") + +local function for_each_registered_node(action) +	local really_register_node = minetest.register_node +	minetest.register_node = function(name, def) +		really_register_node(name, def) +		action(name:gsub("^:", ""), def) +	end +	for name, def in pairs(minetest.registered_nodes) do +		action(name, def) +	end +end + +for_each_registered_node(function(node_name, node_def) +	if node_name ~= "default:steelblock" and +			node_name:find("steelblock", 1, true) and +			node_def.description:find("Steel", 1, true) then +		minetest.override_item(node_name, { +			description = node_def.description:gsub("Steel", S("Wrought Iron")), +		}) +	end +	local tiles = node_def.tiles or node_def.tile_images +	if tiles then +		local new_tiles = {} +		local do_override = false +		if type(tiles) == "string" then +			tiles = {tiles} +		end +		for i, t in ipairs(tiles) do +			if type(t) == "string" and t == "default_steel_block.png" then +				do_override = true +				t = "technic_wrought_iron_block.png" +			end +			table.insert(new_tiles, t) +		end +		if do_override then +			minetest.override_item(node_name, { +				tiles = new_tiles +			}) +		end +	end +end) + diff --git a/technic/technic_worldgen/oregen.lua b/technic/technic_worldgen/oregen.lua new file mode 100644 index 0000000..795f0ec --- /dev/null +++ b/technic/technic_worldgen/oregen.lua @@ -0,0 +1,191 @@ +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_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_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_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, +	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, +	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, +	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   = 4, +	clust_size       = 3, +	y_min       = -32, +	y_max       = 2, +	noise_params     = zinc_params, +	noise_threshhold = zinc_threshhold, +}) + +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, +	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, +	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, +	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, +	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 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 +				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} +}) +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} +}) +end + diff --git a/technic/technic_worldgen/rubber.lua b/technic/technic_worldgen/rubber.lua new file mode 100644 index 0000000..3094fa0 --- /dev/null +++ b/technic/technic_worldgen/rubber.lua @@ -0,0 +1,100 @@ +-- Code of rubber tree by PilzAdam + +local S = technic.worldgen.gettext + +minetest.register_node(":moretrees:rubber_tree_sapling", { +	description = S("Rubber Tree Sapling"), +	drawtype = "plantlike", +	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}, +	sounds = default.node_sound_defaults(), +}) + +minetest.register_craft({ +	type = "fuel", +	recipe = "moretrees:rubber_tree_sapling", +	burntime = 10 +}) + +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}, +	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}, +	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"}, +	paramtype = "light", +	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"}, +		} +		} +	}, +	sounds = default.node_sound_leaves_defaults(), +}) + +technic.rubber_tree_model={ +	axiom = "FFFFA", +	rules_a = "[&FFBFA]////[&BFFFA]////[&FBFFA]", +	rules_b = "[&FFA]////[&FFA]////[&FFA]", +	trunk = "moretrees:rubber_tree_trunk", +	leaves = "moretrees:rubber_tree_leaves", +	angle = 35, +	iterations = 3, +	random_level = 1, +	trunk_type = "double", +	thin_branches = true +} + +minetest.register_abm({ +	nodenames = {"moretrees:rubber_tree_sapling"}, +	interval = 60, +	chance = 20, +	action = function(pos, node) +		minetest.remove_node(pos) +		minetest.spawn_tree(pos, technic.rubber_tree_model) +	end +}) + +if technic.config:get_bool("enable_rubber_tree_generation") then +	minetest.register_on_generated(function(minp, maxp, blockseed) +		if math.random(1, 100) > 5 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} +		local pos = minetest.find_node_near(tmp, maxp.x - minp.x, +				{"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) +		end +	end) +end + diff --git a/technic/technic_worldgen/textures/technic_brass_block.png b/technic/technic_worldgen/textures/technic_brass_block.pngBinary files differ new file mode 100644 index 0000000..bc6fe78 --- /dev/null +++ b/technic/technic_worldgen/textures/technic_brass_block.png diff --git a/technic/technic_worldgen/textures/technic_brass_dust.png b/technic/technic_worldgen/textures/technic_brass_dust.pngBinary files differ new file mode 100644 index 0000000..63d9ba4 --- /dev/null +++ b/technic/technic_worldgen/textures/technic_brass_dust.png diff --git a/technic/technic_worldgen/textures/technic_brass_ingot.png b/technic/technic_worldgen/textures/technic_brass_ingot.pngBinary files differ new file mode 100644 index 0000000..06056e7 --- /dev/null +++ b/technic/technic_worldgen/textures/technic_brass_ingot.png diff --git a/technic/technic_worldgen/textures/technic_carbon_steel_block.png b/technic/technic_worldgen/textures/technic_carbon_steel_block.pngBinary files differ new file mode 100644 index 0000000..f3cfdc1 --- /dev/null +++ b/technic/technic_worldgen/textures/technic_carbon_steel_block.png diff --git a/technic/technic_worldgen/textures/technic_carbon_steel_ingot.png b/technic/technic_worldgen/textures/technic_carbon_steel_ingot.pngBinary files differ new file mode 100644 index 0000000..c30ec80 --- /dev/null +++ b/technic/technic_worldgen/textures/technic_carbon_steel_ingot.png diff --git a/technic/technic_worldgen/textures/technic_cast_iron_block.png b/technic/technic_worldgen/textures/technic_cast_iron_block.pngBinary files differ new file mode 100644 index 0000000..2df61e5 --- /dev/null +++ b/technic/technic_worldgen/textures/technic_cast_iron_block.png diff --git a/technic/technic_worldgen/textures/technic_cast_iron_ingot.png b/technic/technic_worldgen/textures/technic_cast_iron_ingot.pngBinary files differ new file mode 100644 index 0000000..5c182ce --- /dev/null +++ b/technic/technic_worldgen/textures/technic_cast_iron_ingot.png diff --git a/technic/technic_worldgen/textures/technic_chromium_block.png b/technic/technic_worldgen/textures/technic_chromium_block.pngBinary files differ new file mode 100644 index 0000000..ad173ca --- /dev/null +++ b/technic/technic_worldgen/textures/technic_chromium_block.png diff --git a/technic/technic_worldgen/textures/technic_chromium_ingot.png b/technic/technic_worldgen/textures/technic_chromium_ingot.pngBinary files differ new file mode 100644 index 0000000..248b0c3 --- /dev/null +++ b/technic/technic_worldgen/textures/technic_chromium_ingot.png diff --git a/technic/technic_worldgen/textures/technic_chromium_lump.png b/technic/technic_worldgen/textures/technic_chromium_lump.pngBinary files differ new file mode 100644 index 0000000..0fe03a1 --- /dev/null +++ b/technic/technic_worldgen/textures/technic_chromium_lump.png diff --git a/technic/technic_worldgen/textures/technic_granite.png b/technic/technic_worldgen/textures/technic_granite.pngBinary files differ new file mode 100644 index 0000000..abb1385 --- /dev/null +++ b/technic/technic_worldgen/textures/technic_granite.png diff --git a/technic/technic_worldgen/textures/technic_lead_block.png b/technic/technic_worldgen/textures/technic_lead_block.pngBinary files differ new file mode 100644 index 0000000..11da56a --- /dev/null +++ b/technic/technic_worldgen/textures/technic_lead_block.png diff --git a/technic/technic_worldgen/textures/technic_lead_dust.png b/technic/technic_worldgen/textures/technic_lead_dust.pngBinary files differ new file mode 100644 index 0000000..af6ee29 --- /dev/null +++ b/technic/technic_worldgen/textures/technic_lead_dust.png diff --git a/technic/technic_worldgen/textures/technic_lead_ingot.png b/technic/technic_worldgen/textures/technic_lead_ingot.pngBinary files differ new file mode 100644 index 0000000..fae0cbf --- /dev/null +++ b/technic/technic_worldgen/textures/technic_lead_ingot.png diff --git a/technic/technic_worldgen/textures/technic_lead_lump.png b/technic/technic_worldgen/textures/technic_lead_lump.pngBinary files differ new file mode 100644 index 0000000..64584cb --- /dev/null +++ b/technic/technic_worldgen/textures/technic_lead_lump.png diff --git a/technic/technic_worldgen/textures/technic_marble.png b/technic/technic_worldgen/textures/technic_marble.pngBinary files differ new file mode 100644 index 0000000..846a170 --- /dev/null +++ b/technic/technic_worldgen/textures/technic_marble.png diff --git a/technic/technic_worldgen/textures/technic_marble_bricks.png b/technic/technic_worldgen/textures/technic_marble_bricks.pngBinary files differ new file mode 100644 index 0000000..2ea1e42 --- /dev/null +++ b/technic/technic_worldgen/textures/technic_marble_bricks.png diff --git a/technic/technic_worldgen/textures/technic_mineral_chromium.png b/technic/technic_worldgen/textures/technic_mineral_chromium.pngBinary files differ new file mode 100644 index 0000000..c66f1c5 --- /dev/null +++ b/technic/technic_worldgen/textures/technic_mineral_chromium.png diff --git a/technic/technic_worldgen/textures/technic_mineral_lead.png b/technic/technic_worldgen/textures/technic_mineral_lead.pngBinary files differ new file mode 100644 index 0000000..0309cd3 --- /dev/null +++ b/technic/technic_worldgen/textures/technic_mineral_lead.png diff --git a/technic/technic_worldgen/textures/technic_mineral_sulfur.png b/technic/technic_worldgen/textures/technic_mineral_sulfur.pngBinary files differ new file mode 100644 index 0000000..26cb19d --- /dev/null +++ b/technic/technic_worldgen/textures/technic_mineral_sulfur.png diff --git a/technic/technic_worldgen/textures/technic_mineral_uranium.png b/technic/technic_worldgen/textures/technic_mineral_uranium.pngBinary files differ new file mode 100644 index 0000000..aad9c07 --- /dev/null +++ b/technic/technic_worldgen/textures/technic_mineral_uranium.png diff --git a/technic/technic_worldgen/textures/technic_mineral_zinc.png b/technic/technic_worldgen/textures/technic_mineral_zinc.pngBinary files differ new file mode 100644 index 0000000..598efeb --- /dev/null +++ b/technic/technic_worldgen/textures/technic_mineral_zinc.png diff --git a/technic/technic_worldgen/textures/technic_rubber.png b/technic/technic_worldgen/textures/technic_rubber.pngBinary files differ new file mode 100644 index 0000000..9ed4a9d --- /dev/null +++ b/technic/technic_worldgen/textures/technic_rubber.png diff --git a/technic/technic_worldgen/textures/technic_rubber_leaves.png b/technic/technic_worldgen/textures/technic_rubber_leaves.pngBinary files differ new file mode 100644 index 0000000..ae013e0 --- /dev/null +++ b/technic/technic_worldgen/textures/technic_rubber_leaves.png diff --git a/technic/technic_worldgen/textures/technic_rubber_sapling.png b/technic/technic_worldgen/textures/technic_rubber_sapling.pngBinary files differ new file mode 100644 index 0000000..e5c9f5d --- /dev/null +++ b/technic/technic_worldgen/textures/technic_rubber_sapling.png diff --git a/technic/technic_worldgen/textures/technic_rubber_tree_empty.png b/technic/technic_worldgen/textures/technic_rubber_tree_empty.pngBinary files differ new file mode 100644 index 0000000..1792951 --- /dev/null +++ b/technic/technic_worldgen/textures/technic_rubber_tree_empty.png diff --git a/technic/technic_worldgen/textures/technic_rubber_tree_full.png b/technic/technic_worldgen/textures/technic_rubber_tree_full.pngBinary files differ new file mode 100644 index 0000000..08067ef --- /dev/null +++ b/technic/technic_worldgen/textures/technic_rubber_tree_full.png diff --git a/technic/technic_worldgen/textures/technic_rubber_tree_grindings.png b/technic/technic_worldgen/textures/technic_rubber_tree_grindings.pngBinary files differ new file mode 100644 index 0000000..9f2f5d6 --- /dev/null +++ b/technic/technic_worldgen/textures/technic_rubber_tree_grindings.png diff --git a/technic/technic_worldgen/textures/technic_stainless_steel_block.png b/technic/technic_worldgen/textures/technic_stainless_steel_block.pngBinary files differ new file mode 100644 index 0000000..e451768 --- /dev/null +++ b/technic/technic_worldgen/textures/technic_stainless_steel_block.png diff --git a/technic/technic_worldgen/textures/technic_sulfur_dust.png b/technic/technic_worldgen/textures/technic_sulfur_dust.pngBinary files differ new file mode 100644 index 0000000..04ffee0 --- /dev/null +++ b/technic/technic_worldgen/textures/technic_sulfur_dust.png diff --git a/technic/technic_worldgen/textures/technic_sulfur_lump.png b/technic/technic_worldgen/textures/technic_sulfur_lump.pngBinary files differ new file mode 100644 index 0000000..017c8e1 --- /dev/null +++ b/technic/technic_worldgen/textures/technic_sulfur_lump.png diff --git a/technic/technic_worldgen/textures/technic_uranium_block.png b/technic/technic_worldgen/textures/technic_uranium_block.pngBinary files differ new file mode 100644 index 0000000..99dd51c --- /dev/null +++ b/technic/technic_worldgen/textures/technic_uranium_block.png diff --git a/technic/technic_worldgen/textures/technic_uranium_ingot.png b/technic/technic_worldgen/textures/technic_uranium_ingot.pngBinary files differ new file mode 100644 index 0000000..38978f8 --- /dev/null +++ b/technic/technic_worldgen/textures/technic_uranium_ingot.png diff --git a/technic/technic_worldgen/textures/technic_uranium_lump.png b/technic/technic_worldgen/textures/technic_uranium_lump.pngBinary files differ new file mode 100644 index 0000000..2f5a66c --- /dev/null +++ b/technic/technic_worldgen/textures/technic_uranium_lump.png diff --git a/technic/technic_worldgen/textures/technic_wrought_iron_block.png b/technic/technic_worldgen/textures/technic_wrought_iron_block.pngBinary files differ new file mode 100644 index 0000000..cf6c961 --- /dev/null +++ b/technic/technic_worldgen/textures/technic_wrought_iron_block.png diff --git a/technic/technic_worldgen/textures/technic_wrought_iron_ingot.png b/technic/technic_worldgen/textures/technic_wrought_iron_ingot.pngBinary files differ new file mode 100644 index 0000000..af00ea0 --- /dev/null +++ b/technic/technic_worldgen/textures/technic_wrought_iron_ingot.png diff --git a/technic/technic_worldgen/textures/technic_zinc_block.png b/technic/technic_worldgen/textures/technic_zinc_block.pngBinary files differ new file mode 100644 index 0000000..5ae7947 --- /dev/null +++ b/technic/technic_worldgen/textures/technic_zinc_block.png diff --git a/technic/technic_worldgen/textures/technic_zinc_ingot.png b/technic/technic_worldgen/textures/technic_zinc_ingot.pngBinary files differ new file mode 100644 index 0000000..a36a11c --- /dev/null +++ b/technic/technic_worldgen/textures/technic_zinc_ingot.png diff --git a/technic/technic_worldgen/textures/technic_zinc_lump.png b/technic/technic_worldgen/textures/technic_zinc_lump.pngBinary files differ new file mode 100644 index 0000000..1a620ab --- /dev/null +++ b/technic/technic_worldgen/textures/technic_zinc_lump.png diff --git a/technic/technic_worldgen/textures/x32/technic_brass_ingot.png b/technic/technic_worldgen/textures/x32/technic_brass_ingot.pngBinary files differ new file mode 100644 index 0000000..2d8b153 --- /dev/null +++ b/technic/technic_worldgen/textures/x32/technic_brass_ingot.png diff --git a/technic/technic_worldgen/textures/x32/technic_chromium_ingot.png b/technic/technic_worldgen/textures/x32/technic_chromium_ingot.pngBinary files differ new file mode 100644 index 0000000..91d5b20 --- /dev/null +++ b/technic/technic_worldgen/textures/x32/technic_chromium_ingot.png diff --git a/technic/technic_worldgen/textures/x32/technic_chromium_lump.png b/technic/technic_worldgen/textures/x32/technic_chromium_lump.pngBinary files differ new file mode 100644 index 0000000..1588f92 --- /dev/null +++ b/technic/technic_worldgen/textures/x32/technic_chromium_lump.png diff --git a/technic/technic_worldgen/textures/x32/technic_concrete_block.png b/technic/technic_worldgen/textures/x32/technic_concrete_block.pngBinary files differ new file mode 100644 index 0000000..91364f3 --- /dev/null +++ b/technic/technic_worldgen/textures/x32/technic_concrete_block.png diff --git a/technic/technic_worldgen/textures/x32/technic_granite.png b/technic/technic_worldgen/textures/x32/technic_granite.pngBinary files differ new file mode 100644 index 0000000..abb1385 --- /dev/null +++ b/technic/technic_worldgen/textures/x32/technic_granite.png diff --git a/technic/technic_worldgen/textures/x32/technic_marble.png b/technic/technic_worldgen/textures/x32/technic_marble.pngBinary files differ new file mode 100644 index 0000000..846a170 --- /dev/null +++ b/technic/technic_worldgen/textures/x32/technic_marble.png diff --git a/technic/technic_worldgen/textures/x32/technic_marble_bricks.png b/technic/technic_worldgen/textures/x32/technic_marble_bricks.pngBinary files differ new file mode 100644 index 0000000..2ea1e42 --- /dev/null +++ b/technic/technic_worldgen/textures/x32/technic_marble_bricks.png diff --git a/technic/technic_worldgen/textures/x32/technic_mineral_chromium.png b/technic/technic_worldgen/textures/x32/technic_mineral_chromium.pngBinary files differ new file mode 100644 index 0000000..c66f1c5 --- /dev/null +++ b/technic/technic_worldgen/textures/x32/technic_mineral_chromium.png diff --git a/technic/technic_worldgen/textures/x32/technic_mineral_uranium.png b/technic/technic_worldgen/textures/x32/technic_mineral_uranium.pngBinary files differ new file mode 100644 index 0000000..aad9c07 --- /dev/null +++ b/technic/technic_worldgen/textures/x32/technic_mineral_uranium.png diff --git a/technic/technic_worldgen/textures/x32/technic_mineral_zinc.png b/technic/technic_worldgen/textures/x32/technic_mineral_zinc.pngBinary files differ new file mode 100644 index 0000000..598efeb --- /dev/null +++ b/technic/technic_worldgen/textures/x32/technic_mineral_zinc.png diff --git a/technic/technic_worldgen/textures/x32/technic_rebar.png b/technic/technic_worldgen/textures/x32/technic_rebar.pngBinary files differ new file mode 100644 index 0000000..16d1fc5 --- /dev/null +++ b/technic/technic_worldgen/textures/x32/technic_rebar.png diff --git a/technic/technic_worldgen/textures/x32/technic_stainless_steel_ingot.png b/technic/technic_worldgen/textures/x32/technic_stainless_steel_ingot.pngBinary files differ new file mode 100644 index 0000000..46fa296 --- /dev/null +++ b/technic/technic_worldgen/textures/x32/technic_stainless_steel_ingot.png diff --git a/technic/technic_worldgen/textures/x32/technic_uranium.png b/technic/technic_worldgen/textures/x32/technic_uranium.pngBinary files differ new file mode 100644 index 0000000..54225f8 --- /dev/null +++ b/technic/technic_worldgen/textures/x32/technic_uranium.png diff --git a/technic/technic_worldgen/textures/x32/technic_zinc_ingot.png b/technic/technic_worldgen/textures/x32/technic_zinc_ingot.pngBinary files differ new file mode 100644 index 0000000..096ff9c --- /dev/null +++ b/technic/technic_worldgen/textures/x32/technic_zinc_ingot.png diff --git a/technic/technic_worldgen/textures/x32/technic_zinc_lump.png b/technic/technic_worldgen/textures/x32/technic_zinc_lump.pngBinary files differ new file mode 100644 index 0000000..d28a6dc --- /dev/null +++ b/technic/technic_worldgen/textures/x32/technic_zinc_lump.png | 
