From 8cad4a688672e990ad4391e8b825b7713efb54a3 Mon Sep 17 00:00:00 2001 From: cora Date: Sun, 10 Jul 2022 02:32:37 +0200 Subject: [PATCH] Add ruined portals --- mods/MAPGEN/mcl_structures/init.lua | 1 + mods/MAPGEN/mcl_structures/ruined_portal.lua | 82 ++++++++++++++++++ .../mcl_structures_ruined_portal_1.mts | Bin 0 -> 524 bytes .../mcl_structures_ruined_portal_2.mts | Bin 0 -> 521 bytes .../mcl_structures_ruined_portal_99.mts | Bin 0 -> 521 bytes 5 files changed, 83 insertions(+) create mode 100644 mods/MAPGEN/mcl_structures/ruined_portal.lua create mode 100644 mods/MAPGEN/mcl_structures/schematics/mcl_structures_ruined_portal_1.mts create mode 100644 mods/MAPGEN/mcl_structures/schematics/mcl_structures_ruined_portal_2.mts create mode 100644 mods/MAPGEN/mcl_structures/schematics/mcl_structures_ruined_portal_99.mts diff --git a/mods/MAPGEN/mcl_structures/init.lua b/mods/MAPGEN/mcl_structures/init.lua index 5b6be892d..44d21cd96 100644 --- a/mods/MAPGEN/mcl_structures/init.lua +++ b/mods/MAPGEN/mcl_structures/init.lua @@ -244,6 +244,7 @@ dofile(modpath.."/ocean_ruins.lua") dofile(modpath.."/witch_hut.lua") dofile(modpath.."/igloo.lua") dofile(modpath.."/woodland_mansion.lua") +dofile(modpath.."/ruined_portal.lua") dofile(modpath.."/geode.lua") diff --git a/mods/MAPGEN/mcl_structures/ruined_portal.lua b/mods/MAPGEN/mcl_structures/ruined_portal.lua new file mode 100644 index 000000000..cea89e0e9 --- /dev/null +++ b/mods/MAPGEN/mcl_structures/ruined_portal.lua @@ -0,0 +1,82 @@ +local modname = minetest.get_current_modname() +local modpath = minetest.get_modpath(modname) + +local function get_replacements(b,c,pr) + local r = {} + if not b then return r end + for k,v in pairs(b) do + if pr:next(1,100) < c then table.insert(r,v) end + end + return r +end + +local def = { + place_on = {"group:grass_block","group:dirt","mcl_core:dirt_with_grass","group:grass_block","group:sand","group:grass_block_snow","mcl_core:snow"}, + fill_ratio = 0.01, + flags = "place_center_x, place_center_z, all_floors", + solid_ground = true, + make_foundation = true, + chunk_probability = 400, + y_max = mcl_vars.mg_overworld_max, + y_min = 1, + sidelen = 10, + y_offset = -4, + filenames = { + modpath.."/schematics/mcl_structures_ruined_portal_1.mts", + modpath.."/schematics/mcl_structures_ruined_portal_2.mts", + modpath.."/schematics/mcl_structures_ruined_portal_99.mts", + }, + after_place = function(pos,def,pr) + local hl = def.sidelen / 2 + local p1 = vector.offset(pos,-hl,-hl,-hl) + local p2 = vector.offset(pos,hl,hl,hl) + local gold = minetest.find_nodes_in_area(p1,p2,{"mcl_core:goldblock"}) + local lava = minetest.find_nodes_in_area(p1,p2,{"mcl_core:lava_source"}) + local rack = minetest.find_nodes_in_area(p1,p2,{"mcl_nether:netherrack"}) + local brick = minetest.find_nodes_in_area(p1,p2,{"mcl_core:stonebrick"}) + local obby = minetest.find_nodes_in_area(p1,p2,{"mcl_core:obsidian"}) + minetest.bulk_set_node(get_replacements(gold,30,pr),{name="air"}) + minetest.bulk_set_node(get_replacements(lava,20,pr),{name="mcl_nether:magma"}) + minetest.bulk_set_node(get_replacements(rack,7,pr),{name="mcl_nether:magma"}) + minetest.bulk_set_node(get_replacements(obby,30,pr),{name="mcl_core:crying_obsidian"}) + minetest.bulk_set_node(get_replacements(obby,10,pr),{name="air"}) + minetest.bulk_set_node(get_replacements(brick,50,pr),{name="mcl_core:stonebrickcracked"}) + brick = minetest.find_nodes_in_area(p1,p2,{"mcl_core:stonebrick"}) + minetest.bulk_set_node(get_replacements(brick,50,pr),{name="mcl_core:stonebrickmossy"}) + end, + loot = { + ["mcl_chests:chest_small" ] ={{ + stacks_min = 2, + stacks_max = 6, + items = { + { itemstring = "mcl_core:iron_nugget", weight = 40, amount_min = 9, amount_max = 18 }, + { itemstring = "mcl_core:flint", weight = 40, amount_min = 1, amount_max=4 }, + { itemstring = "mcl_core:obsidian", weight = 40, amount_min = 1, amount_max=2 }, + { itemstring = "mcl_fire:fire_charge", weight = 40, amount_min = 1, amount_max = 1 }, + { itemstring = "mcl_fire:flint_and_steel", weight = 40, amount_min = 1, amount_max = 1 }, + { itemstring = "mcl_core:gold_nugget", weight = 15, amount_min = 4, amount_max = 24 }, + { itemstring = "mcl_core:apple_gold", weight = 15, }, + + { itemstring = "mcl_books:book", weight = 1, func = function(stack, pr) + mcl_enchanting.enchant_uniform_randomly(stack, {"soul_speed"}, pr) + end }, + --{ itemstring = "mcl_bamboo:bamboo", weight = 15, amount_min = 1, amount_max=3 }, --FIXME BAMBOO + + { itemstring = "mcl_core:diamond", weight = 3, amount_min = 1, amount_max = 3 }, + { itemstring = "mcl_mobitems:saddle", weight = 3, }, + { itemstring = "mcl_core:emerald", weight = 2, amount_min = 1, amount_max = 3 }, + + { itemstring = "mcl_mobitems:iron_horse_armor", weight = 1, }, + { itemstring = "mcl_mobitems:gold_horse_armor", weight = 1, }, + { itemstring = "mcl_mobitems:diamond_horse_armor", weight = 1, }, + { itemstring = "mcl_core:apple_gold", weight = 15, }, + } + }} + } +} +mcl_structures.register_structure("ruined_portal_overworld",def) +local ndef = table.copy(def) +ndef.y_min=mcl_vars.mg_nether_lava_min +ndef.y_max=mcl_vars.mg_nether_max - 15 +ndef.place_on = {"mcl_nether:netherrack","group:soul_block","mcl_blackstone:basalt,mcl_blackstone:blackstone","mcl_crimson:crimson_nylium","mcl_crimson:warped_nylium"}, +mcl_structures.register_structure("ruined_portal_nether",ndef) diff --git a/mods/MAPGEN/mcl_structures/schematics/mcl_structures_ruined_portal_1.mts b/mods/MAPGEN/mcl_structures/schematics/mcl_structures_ruined_portal_1.mts new file mode 100644 index 0000000000000000000000000000000000000000..ae37576dc259184903dd7af589154b8c066aeeda GIT binary patch literal 524 zcmeYb3HD`RVPI$AVc@Js0t{RX%!!#r45GQoIq`X^B^jwjRuHNvF*%z-8YEm?l9*Xk zYz3y`i%atJQj>}@ld~aulJkpFt#T5}664cy^2;;x(iwz6dceZz`8g>`Ir+)i48m|R zB>f_AL9qVf{L-T2R0ct~Xns<0W=dva9)lD}2*ni$lf}TwGg6C7imkv@d~t4KPEN&~ zz0=-`H7W44nJ-KFudRPQnx7>_`Q(oa(=VTteRB6Po0!AG3q2aFAz1~@I*%1B*bjT^ zFc}^<{nrtqZuKE&TJbIIS4y`$MKdM_a!jHDT_}Ul&$D}G9~t) zic{fPZ3)X*TV?gQ1D4X~YFzs*Wy4?Wemd#vo+jh9>2Vol^PhIl>ATuFpM9sjy!m_o z;}YxMR?d&uT0i&0?(@4vx?&4m+mzO>{(D99`HdHvbHh3E{#rzzkw{;Y@H%+;oHLjG zw^na@waaa|-%C!_U6rV3^?7ib&d&|l1E4$*qhVJK;|2R=G5dbah;!^+s literal 0 HcmV?d00001 diff --git a/mods/MAPGEN/mcl_structures/schematics/mcl_structures_ruined_portal_2.mts b/mods/MAPGEN/mcl_structures/schematics/mcl_structures_ruined_portal_2.mts new file mode 100644 index 0000000000000000000000000000000000000000..fd17f1365b9e9770b5337aea9e266e52b6ff8e12 GIT binary patch literal 521 zcmeYb3HD`RVPI$AVc@Js0t{RX%!!#r45GQoIq`X^B^jwjRuHNvF*%z-8YEm?l9*Xk zYz3y`i%atJQj>}@ld~CwK$6M%MX6Tl`8g>`Ir+)i48m|RB!ytZ!3uK{%M#<$a`MYF z^U@ha;A+9b#rdU0$*By2aMApv;>?uH#5@KmkPwP15EhDom1m?DmlRupsrcgD#GIUp zIajB>7HU!uXl*pz_D9-%UaaFfmAZy+@ll22{ml!UQoL?$@_Jgf-}MAXk8niw zs%xrQxo+Bj8=tqonC|jaFZ%4e6*EtNm0B)mWU(}Tsq0N2r@+nC>F=+LrXIFbUG2E2 z_nC@k-W=icwhu#E=hVnuc_V8Qajs&~@i~3kXRLpHw0X)~d93xk%BQt+`mT1aW1n~W z^Rwrd4cq?jxL0lTC_d_aOwH8#+W#hO{YFP+v~7287Cg9CHoaH!VT|w^*{{no(E8P~=k-c%_y2a-^()F^@|?A6p3nF&=g5n7 ptU=Zy4&HvYOOQvUqA;=^a(LvBXbUflhVImkjW1^{J%>8t<% literal 0 HcmV?d00001 diff --git a/mods/MAPGEN/mcl_structures/schematics/mcl_structures_ruined_portal_99.mts b/mods/MAPGEN/mcl_structures/schematics/mcl_structures_ruined_portal_99.mts new file mode 100644 index 0000000000000000000000000000000000000000..0834d8923e7ec5617c12bd757dc0119fa6d4133f GIT binary patch literal 521 zcmeYb3HD`RVPI$AVc@Js0t{RX%!!#r45GQoIq`X^B^jwjRuHNvF*%z-8YEm?l9*Xk zYz3y`i%atJQj>}@ld~CwK$6M%MX6Tl`8g>`Ir+)i48m|RB!wby!JNdh#Q5U;(xT*4 z20^%Jeo}E}N@ijngA_;z#X5w^U>AaI0~?Z-lV6^hm(CytHYFpqxTM$$OvM-HCg$W+ z%(*)Crckp2k1OZJTl=p6+WD_4Qgx$_Qcte_V-L2SGKUrkOl1mfO3D51y+m?ip;GpF zS7)_X#?b}+Pi40E{L<(#+a&n1re#O!BAKrt2RZwuimkj;JMoz9m1G^urz?K0I-tiC zwp@~Dj@kT1;VTt~51KAXne=s1myXNiu1k`=#Zh|u-_7cNF06MVJxbwSn|?uGN_dce z=B77acU06zxy4_9K6l>Sc&qm@2g;6Ke}BI8>UqnhGSap?KWpuYwm&Ckd`QyhhSh6Z z^^YaKZ|9|y-ZHqJ`$~R`?DZ9ggO=L-clC(pKIi`1miz6497mb|x>Hz=t$MJt<7QpA oN*C8g_2((Ol$8o^Mi>=s|E%q`qgp()_Uim!=6e|3ZYyd70M^an`v3p{ literal 0 HcmV?d00001