From d7aa8360524411f9ac9438c0616b91dfdbdb24d8 Mon Sep 17 00:00:00 2001 From: kaadmy Date: Thu, 1 Oct 2015 17:10:41 -0700 Subject: [PATCH] added savanna biome and dry grass stuff --- mods/default/mapgen.lua | 181 +++++------------- mods/default/nodes.lua | 42 ++++ mods/default/textures/default_dry_grass.png | Bin 0 -> 264 bytes mods/default/textures/default_dry_grass.xcf | Bin 0 -> 890 bytes .../textures/default_dry_grass_clump.png | Bin 0 -> 522 bytes .../textures/default_dry_grass_clump.xcf | Bin 0 -> 1482 bytes .../default_dry_grass_clump_inventory.png | Bin 0 -> 318 bytes .../default_dry_grass_clump_inventory.xcf | Bin 0 -> 1239 bytes .../textures/default_dry_grass_side.png | Bin 0 -> 290 bytes .../textures/default_dry_grass_side.xcf | Bin 0 -> 1095 bytes mods/default/textures/default_grass_side.png | Bin 277 -> 277 bytes mods/default/textures/default_grass_side.xcf | Bin 1095 -> 1095 bytes 12 files changed, 90 insertions(+), 133 deletions(-) create mode 100644 mods/default/textures/default_dry_grass.png create mode 100644 mods/default/textures/default_dry_grass.xcf create mode 100644 mods/default/textures/default_dry_grass_clump.png create mode 100644 mods/default/textures/default_dry_grass_clump.xcf create mode 100644 mods/default/textures/default_dry_grass_clump_inventory.png create mode 100644 mods/default/textures/default_dry_grass_clump_inventory.xcf create mode 100644 mods/default/textures/default_dry_grass_side.png create mode 100644 mods/default/textures/default_dry_grass_side.xcf diff --git a/mods/default/mapgen.lua b/mods/default/mapgen.lua index 66f87a7..98aebff 100644 --- a/mods/default/mapgen.lua +++ b/mods/default/mapgen.lua @@ -1,7 +1,7 @@ -- minetest/default/mapgen.lua -- --- Aliases for map generator outputs +-- Aliases for map generator outputs(Might not be needed with v7, but JIC) -- minetest.register_alias("mapgen_stone", "default:stone") @@ -34,10 +34,10 @@ minetest.register_ore( ore_type = "scatter", ore = "default:stone_with_coal", wherein = "default:stone", - clust_scarcity = 8*8*8, + clust_scarcity = 10*10*10, clust_num_ores = 6, clust_size = 4, - height_min = -128, + height_min = -31000, height_max = 32, }) @@ -47,10 +47,22 @@ minetest.register_ore( ore = "default:stone_with_coal", wherein = "default:stone", clust_scarcity = 8*8*8, + clust_num_ores = 8, + clust_size = 6, + height_min = -31000, + height_max = -32, + }) + +minetest.register_ore( + { + ore_type = "scatter", + ore = "default:stone_with_coal", + wherein = "default:stone", + clust_scarcity = 9*9*9, clust_num_ores = 20, clust_size = 10, - height_min = -128, - height_max = -32, + height_min = -31000, + height_max = -64, }) minetest.register_ore( @@ -61,7 +73,7 @@ minetest.register_ore( clust_scarcity = 8*8*8, clust_num_ores = 6, clust_size = 4, - height_min = -128, + height_min = -31000, height_max = 0, }) @@ -73,7 +85,7 @@ minetest.register_ore( clust_scarcity = 8*8*8, clust_num_ores = 20, clust_size = 10, - height_min = -128, + height_min = -31000, height_max = -32, }) @@ -82,134 +94,13 @@ minetest.register_ore( ore_type = "blob", ore = "default:block_steel", wherein = "default:stone", - clust_scarcity = 8*8*8, + clust_scarcity = 12*12*12, clust_num_ores = 10, clust_size = 10, - height_min = -128, - height_max = -64, + height_min = -31000, + height_max = -128, }) -function default.make_papyrus(pos, size) - for y=0,size-1 do - local p = {x=pos.x, y=pos.y+y, z=pos.z} - local nn = minetest.get_node(p).name - if minetest.registered_nodes[nn] and - minetest.registered_nodes[nn].buildable_to then - minetest.set_node(p, {name="default:papyrus"}) - else - return - end - end -end - -function default.make_cactus(pos, size) - for y=0,size-1 do - local p = {x=pos.x, y=pos.y+y, z=pos.z} - local nn = minetest.get_node(p).name - if minetest.registered_nodes[nn] and - minetest.registered_nodes[nn].buildable_to then - minetest.set_node(p, {name="default:cactus"}) - else - return - end - end -end - -function default.mgv6_ongen(minp, maxp, seed) - -- Generate cactuses - local perlin1 = minetest.get_perlin(230, 3, 0.6, 100) - -- Assume X and Z lengths are equal - local divlen = 16 - local divs = (maxp.x-minp.x)/divlen+1; - for divx=0,divs-1 do - for divz=0,divs-1 do - local x0 = minp.x + math.floor((divx+0)*divlen) - local z0 = minp.z + math.floor((divz+0)*divlen) - local x1 = minp.x + math.floor((divx+1)*divlen) - local z1 = minp.z + math.floor((divz+1)*divlen) - -- Determine cactus amount from perlin noise - local cactus_amount = math.floor(perlin1:get2d({x=x0, y=z0}) * 6 - 3) - -- Find random positions for cactus based on this random - local pr = PseudoRandom(seed+1) - for i=0,cactus_amount do - local x = pr:next(x0, x1) - local z = pr:next(z0, z1) - -- Find ground level (0...15) - local ground_y = nil - for y=30,0,-1 do - if minetest.get_node({x=x,y=y,z=z}).name ~= "air" then - ground_y = y - break - end - end - if (ground_y and ground_y > 10) and minetest.get_node({x=x,y=ground_y,z=z}).name == "default:sand" then - default.make_cactus({x=x,y=ground_y+1,z=z}, pr:next(2, 3)) - end - end - end - end - - local pr = PseudoRandom(seed+541) - for x=minp.x,maxp.x do - for z=minp.z,maxp.z do - local perlin1=((minetest.get_perlin(5123, 3, 0.6, 1):get2d({x=x*0.03, y=z*0.03}) * 0.5) + 0.5)*60 - if pr:next(0, 15) > perlin1 then - local ground_y = nil - - for y=2,0,-1 do - if minetest.get_node({x=x,y=y,z=z}).name ~= "air" then - ground_y = y - break - end - end - - local pos={x=x, y=ground_y, z=z} - - if (ground_y and ground_y < 20) and minetest.get_node(pos).name == "default:sand" then - if minetest.find_node_near(pos, 3, {"group:water"}) then - default.make_papyrus({x=pos.x, y=pos.y+1, z=pos.z}, pr:next(1, 3)) - end - end - end - - local perlin2=((minetest.get_perlin(8175, 12, 0.8, 0.7):get2d({x=x*0.025, y=z*0.025}) * 0.5) + 0.5)*1000 - if pr:next(0, 15) > perlin2 then - local ground_y = nil - for y=30,0,-1 do - if minetest.get_node({x=x,y=y,z=z}).name ~= "air" then - ground_y = y - break - end - end - if ground_y ~= nil then - local p = {x = x, y = ground_y+1, z = z} - local nn=minetest.get_node(p).name - if minetest.registered_nodes[nn] and - minetest.registered_nodes[nn].buildable_to then - nn = minetest.get_node({x=x,y=ground_y,z=z}).name - if nn == "default:dirt_with_grass" then - if pr:next(0, 100) < 1 then - minetest.set_node(p, {name = "farming:wheat_4"}) - else - minetest.set_node(p, {name = "default:grass"}) - end - elseif nn == "default:sand" and pr:next(0, 300) < 1 then - minetest.set_node(p, {name = "farming:cotton_4"}) - end - end - end - end - end - end -end - -local mg_params = minetest.get_mapgen_params() - -if mg_params.mgname == "v6" then - default.log("please use v5 or v7 mapgen instead; v6 mapgen may not work and is not supported.", "info") - -- minetest.register_on_generated(default.mgv6_ongen) -end - -- -- Biome setup -- @@ -266,6 +157,18 @@ minetest.register_biome( heat_point = 50, humidity_point = 35, }) +minetest.register_biome( + { + name = "Savanna", + node_top = "default:dirt_with_dry_grass", depth_top = 1, + node_filler = "default:dirt", depth_filler = 2, + node_underwater = "default:dirt", + node_shore_top = "default:sand", + node_shore_filler = "default:sand", height_shore = 0, + y_min = -32000, y_max = 32000, + heat_point = 60, humidity_point = 25, + }) + minetest.register_biome( { name = "Desert", @@ -274,8 +177,8 @@ minetest.register_biome( node_underwater = "default:dirt", node_shore_top = "default:sand", node_shore_filler = "default:sand", height_shore = 0, - y_min = -32000, y_max = 32000, - heat_point = 80, humidity_point = 10, + y_min = 0, y_max = 32000, + heat_point = 70, humidity_point = 20, }) -- Decorations @@ -392,6 +295,18 @@ minetest.register_decoration( y_max = 32000, }) +minetest.register_decoration( + { + deco_type = "simple", + place_on = "default:dirt_with_dry_grass", + sidelen = 16, + fill_ratio = 0.07, + biomes = {"Savanna"}, + decoration = {"default:dry_grass"}, + y_min = 0, + y_max = 50, + }) + minetest.register_decoration( { deco_type = "simple", diff --git a/mods/default/nodes.lua b/mods/default/nodes.lua index 9c218f3..d796594 100644 --- a/mods/default/nodes.lua +++ b/mods/default/nodes.lua @@ -87,6 +87,26 @@ minetest.register_node( sounds = default.node_sound_dirt_defaults(), }) +minetest.register_node( + "default:dirt_with_dry_grass", + { + description = "Dirt with Dry Grass", + tiles ={"default_dry_grass.png", "default_dirt.png", "default_dirt.png^default_dry_grass_side.png"}, + groups = {crumbly=3, soil=1, fall_damage_add_percent=-5, not_in_craftingguide = 1}, + drop = { + max_items = 3, + items = { + {items = {"default:dirt"}, rarity = 1}, + {items = {"default:grass 2"}, rarity = 6}, + } + }, + is_ground_content = true, + sounds = default.node_sound_dirt_defaults( + { + footstep = {name="default_soft_footstep", gain=0.3}, + }), + }) + minetest.register_node( "default:dirt_with_grass", { @@ -963,6 +983,28 @@ minetest.register_node( end, }) +minetest.register_node( + "default:dry_grass", + { + description = "Dry Grass Clump", + drawtype = "plantlike", + selection_box = { + type = "fixed", + fixed = {-0.5, -0.5, -0.5, 0.5, 0, 0.5} + }, + visual_scale = 1.15, + tiles ={"default_dry_grass_clump.png"}, + inventory_image = "default_dry_grass_clump_inventory.png", + wield_image = "default_dry_grass_clump_inventory.png", + paramtype = "light", + waving = 1, + walkable = false, + buildable_to = true, + is_ground_content = true, + groups = {snappy=2,dig_immediate=3,attached_node=1}, + sounds = default.node_sound_leaves_defaults(), + }) + minetest.register_node( "default:grass", { diff --git a/mods/default/textures/default_dry_grass.png b/mods/default/textures/default_dry_grass.png new file mode 100644 index 0000000000000000000000000000000000000000..f8c623df133c74ea8be4b646370d024c416feb55 GIT binary patch literal 264 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61SBU+%rFB|oCO|{#S9GG!XV7ZFl&wkP>{XE z)7O>#J{P07mdf;v&n5wdBuiW)N}Tg^b5rw57@Uhz6H8K46v{J8G8EiBeFMT9`NV;W znmk<`Lp09M4RYi=pumxw65coK#rba=YE$|zrO5p~z^B%xkeqU7&9rHc%I30fIMwL& z`a_(?xo_F63=Ci2eVw*NMuYtlXW3irDN1V}Z0T}7x4z-qf<4zI-Xyc#%Z_kWmdszH z=hS6#IC7~))4T}Fq{vyfr%wC#-f@Ti+RqVFZCA{9x?}hCyh+;?S82T$UgsT7!=|FGNB$c z(4KRLn7<^CaO}iS7Kmm)jJebKxmEX$CtKZk`?5#)D!i$1Ql&TpSriC%i z^5=OVvt+Jj$J^sD@{@Uz%JI5P(&)yMrzfZD*kI0d>lmvy8&>PS{Mm5zDZBT46-V-{ z{w=`gO;EGRL#%SCV*fVCxSxb!7UZ8V$nEdwKl!@K@1R4x)eg0JKRf51e;1|6L%jZM zEj`vjv*@8zfzE3*{u9bFy50h1`JRp|itAmCNmW*TDHV&8(XNxDq^(k!aiVpNEw zS%}w;t`6aVNfgzxaDaOd@Umz#4KZx7Z^76kU8a6vx>e|oTro9W5q5NS2nS5Ut){L6 W+=GCpZkuU{VT*kW#wO`9_1%BBiOKZ< literal 0 HcmV?d00001 diff --git a/mods/default/textures/default_dry_grass_clump.png b/mods/default/textures/default_dry_grass_clump.png new file mode 100644 index 0000000000000000000000000000000000000000..171799793b2f5c4572199a33e06d196fdcbd5826 GIT binary patch literal 522 zcmV+l0`>igP)e zSad^gZEa<4bO1wgWnpw>WFU8GbZ8()Nlj2!fese{00DAIL_t(I%hgdmOT$nUJ+GJy z(hdrxS`^2EtN%cUWO+EKL$h?N(Erd7@*@Iv>kdk5J(m#?c0mC<;-3+iLWe2zzY(lA0)Wju0D!SlEBrRF4L0|XMCmd? zM5y;QwEG%}=v%b=8gAUnA8SOkP~c|LatOzuZPEdtV{zK*!S%-(nL>wf40<^Y*!p0O zrX|?x(>;x{GbF)e79vmD+=D4}+&*5RF|W|7`@%8k;_iV-1%}Yku{iOT%K(74T-LF; z+)yo-5cu)NhkEtlQo*1WGvOH2s}Erc9ZgHH#=JsmQNd&u;_!GMqbP-N4B{=9<>ZFY zQE<73qcBCaT!JZdjG|P^O`;V3dx*e~p%xX{b6!+7O`Oa^*xZ9!R4@kcy!XZ$^9l`W zG1ERzDDMgUST1q7x9}kFV{{LuEPqiFrSfhy+m=Krx(8E9HqK7?0(rC2WEj_H?*IS* M07*qoM6N<$f-Lsh!vFvP literal 0 HcmV?d00001 diff --git a/mods/default/textures/default_dry_grass_clump.xcf b/mods/default/textures/default_dry_grass_clump.xcf new file mode 100644 index 0000000000000000000000000000000000000000..d41a9cd9105366e42b77889e305a9957e7e90447 GIT binary patch literal 1482 zcma)6J#X7E5T)d}O_QccKc@~FlfgxT%wE`mXyE__G;wqsNfG=N*bbTug3_UTJ800_ z02(~r(4WxBKgeyJuM3C z<9kvo-T61*)Qj<1yAuuq=b+jP^JF3^pR zKrSMemt31i#*m3vT%?Ah=d*}Fx`?=$F@H@iM^F?Y(lt88l)CP$3m<`+RYRH(!m{bk zP@mkit7k}oPe$u5ifHO$W3Am(yBePBlB3{&VZO&P)6J^D|0d? zF~rg$Mnhnxlz_~*;VJXiNyZTg5h61~F{U`nrYU>`LP1`FBml@JouYn{#VJjZ0v|f1 zC_+h!jp-_jDZ7G~Wl2VY(6Br5|&d4a17A=!AzS1Bi zH|#TittCfjr4T8NYGGi~WGHU0{oGKG_BOjf-D0wSxJ{Ir!xzEV1I+;uot%)K_Eq z#oYZPZo6L3>rBGoz&UDArkzHLF(zhSK&4fy)^ Ng0Hyx5B6hAm_O-;;za-e literal 0 HcmV?d00001 diff --git a/mods/default/textures/default_dry_grass_clump_inventory.png b/mods/default/textures/default_dry_grass_clump_inventory.png new file mode 100644 index 0000000000000000000000000000000000000000..1940a299cbca2fbc2bef5d57391383258c0ac34d GIT binary patch literal 318 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61|;P_|4#%`oCO|{#S9GG!XV7ZFl&wkP>{XE z)7O>#J{P07E+4b^&Ss#HWQl7;iF1B#Zfaf$gL6@8Vo7R>LV0FMhJw4NZ$Nk>pEyv_ z4o?@y5R21q12^&>a^TtHvSo@$VuMaWb_(Myk;I;GFSZ4q6B#uGlOM1eF-%-=hGCh5 z{+tI3N=#xtfBKzs|K$ z!MBDxiq_7Oc+bxy=*f^EntC;tUC=YjVYQNTbNI!w&2igIwC^7K`1MV%&KciV@AI?e zj^AzUP$|8wIK^_7cYnaM&DCDHjnzucH%g{Go}2UQf9`?&4=nZ?1wE%8bTt6|z~JfX K=d#Wzp$Py<+IJ=Z literal 0 HcmV?d00001 diff --git a/mods/default/textures/default_dry_grass_clump_inventory.xcf b/mods/default/textures/default_dry_grass_clump_inventory.xcf new file mode 100644 index 0000000000000000000000000000000000000000..e982ed1a9ebdd133121989f812e1a3183d1f71e2 GIT binary patch literal 1239 zcmaJ<%Wl&^6usj_p|n(#=ZeL2mo9=@%^#FX6%t5nvveKX9g*0T2=%G08~w#c^)u=DFQs5Ot-e%E7c@~nf`J9wjm?{)BI2j2(g+_3Hd@O@n2&j?u{ zMYeVRMn`Y-{-zdvAU}|6gGqSw3F(2_zZVH=7TH6>rY zwKN0~xU*ajc{`6&0D9n@K;k%JDESVFFWtTsZsEdRxNuhn+=sg&T2Kfj25l$ PKRE4h+y{p9x8IiECO`{d literal 0 HcmV?d00001 diff --git a/mods/default/textures/default_dry_grass_side.png b/mods/default/textures/default_dry_grass_side.png new file mode 100644 index 0000000000000000000000000000000000000000..92e17de49523f9bd97c3106ce7f8a2fa0c266c9a GIT binary patch literal 290 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61|;P_|4#%`oCO|{#S9GG!XV7ZFl&wkP>{XE z)7O>#J{P07KEGSl>*+ut$r9Iy66gHf+|;}h2Ir#G#FEq$h4Rdj3Q&FEdv8MLHWXIvq1u=|Bo(}x1YoE ivP0fGTweF}FXNQ6mJ^j{xcUR#$>8bg=d#Wzp$PzY1Z%PY literal 0 HcmV?d00001 diff --git a/mods/default/textures/default_dry_grass_side.xcf b/mods/default/textures/default_dry_grass_side.xcf new file mode 100644 index 0000000000000000000000000000000000000000..4c53e062ce0e827842e85ede381a27b8b783ecf8 GIT binary patch literal 1095 zcmb7C%WB&|6rHgo+fC})>cdb|%q*RSi}MS~A{1QcR!c>e6cO7BmO_(4@fQ@j(Zauw zMFaYd{7!d8?m6yEs}gt73+LW5=bjmfxf3UgD|Hh@DoW;|K=d@oT|i2t7eM>us}Ka@ zC13+jfWGGRy@LM?wG-pmagZ(+;WEcsu=)IS75aHNQy-K3LY=*P|AC#}&YCRzI2^~T zWJV2cDMnd-I}cTs&Xd{E!6=G@be^u%XjjIo_}o{Mx07A$A;-FPgsta$wwk{BH{sTs z?8*<4Wvq_Pw;`S(yL+LGFGm{Zjtk%6rfuzZr&FpU>fm zA6&+(^m@6wwuZJfQ8}G0(AJy-;IybS-T;Ol)cB$1^gpffPR-K==eZ_YAm%LdGAz>+ zqLBz;eZt!OI(m)Iy05jy7q0EHdMJmb+}NdjXzJ=x>@&%-+LSKj4gh&mT1*3&9rhiN zHkB4rx3r7ut{4__Z5Q&csjEw|&m@a#UAT}t0OWOHF%4jL*mpqMR9Z~k!uG1j8+vkT zdopV3>Qd}8Nw1oEF60gXdFokA1DGB59gsGa7E{-&T}bcG9M!_lE_oOKJH%(aKY)Yd srRo8gd6>7s&UbC04R)LFf}v+&zvg1Ht;AN=(hsrS!d^W}YjH1r0#1qPnE(I) literal 0 HcmV?d00001 diff --git a/mods/default/textures/default_grass_side.png b/mods/default/textures/default_grass_side.png index 334e4acfb75a718fc47e9a637077a0715318ac77..17ab826bed3d97ef0fb1543e1a8f6b9e3c3856a0 100644 GIT binary patch delta 19 acmbQrG?i(B11A@wxR$s^VtdO(&oclpZ3U$O delta 19 acmbQrG?i(B11E=|h@61xhUl`1o@W3s^aZZ~ diff --git a/mods/default/textures/default_grass_side.xcf b/mods/default/textures/default_grass_side.xcf index 498069cd528f566840c0a133ae0d565862e019c2..ee4c599ba80b339ddce97d7933433ee45235f809 100644 GIT binary patch delta 12 TcmX@kahzj<9izZTdkz)=8{-3d delta 12 TcmX@kahzj<9V7ondkz)=8{PwX