From 95f4ccab51f0065f290733e9a41abea61544c343 Mon Sep 17 00:00:00 2001 From: Perttu Ahola Date: Wed, 4 Apr 2012 15:43:17 +0300 Subject: [PATCH] Move map generator stuff around a bit and generate coal and iron deep underground --- mods/default/init.lua | 24 ----------------- mods/default/mapgen.lua | 35 ++++++++++++++++++++++--- mods/default/textures/default_lava.png | Bin 766 -> 772 bytes 3 files changed, 31 insertions(+), 28 deletions(-) diff --git a/mods/default/init.lua b/mods/default/init.lua index d2569bf..6f0ed21 100644 --- a/mods/default/init.lua +++ b/mods/default/init.lua @@ -1290,30 +1290,6 @@ minetest.add_to_creative_inventory('default:water_source') minetest.add_to_creative_inventory('default:lava_source') minetest.add_to_creative_inventory('default:ladder') --- --- Aliases for map generator outputs --- (required at least by an in-development branch) --- - -minetest.register_alias("mapgen_air", "air") -minetest.register_alias("mapgen_stone", "default:stone") -minetest.register_alias("mapgen_tree", "default:tree") -minetest.register_alias("mapgen_leaves", "default:leaves") -minetest.register_alias("mapgen_apple", "default:apple") -minetest.register_alias("mapgen_water_source", "default:water_source") -minetest.register_alias("mapgen_dirt", "default:dirt") -minetest.register_alias("mapgen_sand", "default:sand") -minetest.register_alias("mapgen_gravel", "default:gravel") -minetest.register_alias("mapgen_clay", "default:clay") -minetest.register_alias("mapgen_lava_source", "default:lava_source") -minetest.register_alias("mapgen_cobble", "default:cobble") -minetest.register_alias("mapgen_mossycobble", "default:mossycobble") -minetest.register_alias("mapgen_dirt_with_grass", "default:dirt_with_grass") -minetest.register_alias("mapgen_junglegrass", "default:junglegrass") -minetest.register_alias("mapgen_stone_with_coal", "default:stone_with_coal") -minetest.register_alias("mapgen_stone_with_iron", "default:stone_with_iron") -minetest.register_alias("mapgen_mese", "default:mese") - -- -- Some common functions -- diff --git a/mods/default/mapgen.lua b/mods/default/mapgen.lua index d01f051..af94505 100644 --- a/mods/default/mapgen.lua +++ b/mods/default/mapgen.lua @@ -1,5 +1,32 @@ -- minetest/default/mapgen.lua +-- +-- Aliases for map generator outputs +-- + +minetest.register_alias("mapgen_air", "air") +minetest.register_alias("mapgen_stone", "default:stone") +minetest.register_alias("mapgen_tree", "default:tree") +minetest.register_alias("mapgen_leaves", "default:leaves") +minetest.register_alias("mapgen_apple", "default:apple") +minetest.register_alias("mapgen_water_source", "default:water_source") +minetest.register_alias("mapgen_dirt", "default:dirt") +minetest.register_alias("mapgen_sand", "default:sand") +minetest.register_alias("mapgen_gravel", "default:gravel") +minetest.register_alias("mapgen_clay", "default:clay") +minetest.register_alias("mapgen_lava_source", "default:lava_source") +minetest.register_alias("mapgen_cobble", "default:cobble") +minetest.register_alias("mapgen_mossycobble", "default:mossycobble") +minetest.register_alias("mapgen_dirt_with_grass", "default:dirt_with_grass") +minetest.register_alias("mapgen_junglegrass", "default:junglegrass") +minetest.register_alias("mapgen_stone_with_coal", "default:stone_with_coal") +minetest.register_alias("mapgen_stone_with_iron", "default:stone_with_iron") +minetest.register_alias("mapgen_mese", "default:mese") + +-- +-- Ore generation +-- + local function generate_ore(name, wherein, minp, maxp, seed, chunks_per_volume, ore_per_chunk, height_min, height_max) if maxp.y < height_min or minp.y > height_max then return @@ -42,10 +69,10 @@ local function generate_ore(name, wherein, minp, maxp, seed, chunks_per_volume, end minetest.register_on_generated(function(minp, maxp, seed) - generate_ore("default:stone_with_coal", "default:stone", minp, maxp, seed, 1/8/8/8, 5, -64, 64) - generate_ore("default:stone_with_iron", "default:stone", minp, maxp, seed+1, 1/16/16/16, 5, 3, 7) - generate_ore("default:stone_with_iron", "default:stone", minp, maxp, seed+2, 1/12/12/12, 5, -16, 2) - generate_ore("default:stone_with_iron", "default:stone", minp, maxp, seed+3, 1/9/9/9, 5, -64, -17) + generate_ore("default:stone_with_coal", "default:stone", minp, maxp, seed, 1/8/8/8, 5, -31000, 64) + generate_ore("default:stone_with_iron", "default:stone", minp, maxp, seed+1, 1/16/16/16, 5, -5, 7) + generate_ore("default:stone_with_iron", "default:stone", minp, maxp, seed+2, 1/12/12/12, 5, -16, -5) + generate_ore("default:stone_with_iron", "default:stone", minp, maxp, seed+3, 1/9/9/9, 5, -31000, -17) -- Generate clay if maxp.y >= 2 and minp.y <= 0 then -- Assume X and Z lengths are equal diff --git a/mods/default/textures/default_lava.png b/mods/default/textures/default_lava.png index 2c7d9ad9931acc4ec391ac1c56fa432651831ed3..9cf9fa81afa4f33cff9a8b4b1109cc767cbca6f2 100644 GIT binary patch delta 749 zcmVFFY3y@B2L8 zH@HF6dY=8Sy{a^M(T#U`@*IhtHoJEhEl(C~1`K}04jSGav z*hNrDkgb>PBY&JhVU1rtU>NJjbYXqn{mV;6KI5-ECwrN|0R*j-HXi!%Q{pSwj`$K4 zc=1_^JIsIayLdH6a@0LR_B5U2oPH~-GF24RY^iK1XQ47d4u9Z4H;E3~J3B>NOV%$v zkiW>nEN6xY!d8+q!uk_>&R!GNpd!1^%cp3={Yip4Vt*}Z@%D_mmq?;!p738vOL@~D zuZvc$NgO9kBRrHeb+vrL%nyXS$aIs*k*2nVBBCNeDsA*C`Ohhg5P#tU6+Oo-`%W89 zeL@%~*eQsL1tO{&sYc-r@dmaqafQ1x#Ey&^XbS%{e3QOjvV8;zq6ZVA?b|ko*qo=h z%l>XEpMPq1Ftelz!@m+vV{DK!IdT^WA7$%0v;7oDSiQp1IJ>n>e@)ns(ER%2G7a29 z*opD~;i&5nru!8`R=4=}JX85{J3oz+%n>FJlE_K5(~Q_z209Q`QJ?-B6Dl5~u8HfT zEMiW1uI4#*a#^tPn}wms&K$w_M7`(uYOvhG(Pl1=y-i_(58q=MtJp?^a+pu=(Y}mu z2c>(w@(v-!rYNltPjd)8$~vs=eP9(zXhQ4_2L8#@)KB|il1nr`PmrQH%bjr!?->;K faIe_grV0N6+3DlX9Twj&00000NkvXXu0mjfi<)5s delta 743 zcmV-2L1(*BYy(LNklpLAzC9mif!Jn*RxzGL6kK+Ci3N&^#mkAF@Y3Fy8|8Mk2s>P3A$CjRDR%B2e_mikjQ>(J^yZ+~{$v(H zf@~^U61jH~`G8t%MS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