From 4af1094eedd431201bd580bf3af36628d17f9529 Mon Sep 17 00:00:00 2001 From: cora Date: Thu, 2 Jun 2022 03:12:14 +0200 Subject: [PATCH] Add shipwrecks schematics by chmodsayshello --- mods/MAPGEN/mcl_shipwrecks/init.lua | 104 ++++++++++++++++++ mods/MAPGEN/mcl_shipwrecks/mod.conf | 3 + .../shipwreck_full_back_damaged.mts | Bin 0 -> 1203 bytes .../schematics/shipwreck_full_damaged.mts | Bin 0 -> 1518 bytes .../schematics/shipwreck_full_normal.mts | Bin 0 -> 1545 bytes .../schematics/shipwreck_half_back.mts | Bin 0 -> 1248 bytes .../schematics/shipwreck_half_front.mts | Bin 0 -> 903 bytes 7 files changed, 107 insertions(+) create mode 100644 mods/MAPGEN/mcl_shipwrecks/init.lua create mode 100644 mods/MAPGEN/mcl_shipwrecks/mod.conf create mode 100644 mods/MAPGEN/mcl_shipwrecks/schematics/shipwreck_full_back_damaged.mts create mode 100644 mods/MAPGEN/mcl_shipwrecks/schematics/shipwreck_full_damaged.mts create mode 100644 mods/MAPGEN/mcl_shipwrecks/schematics/shipwreck_full_normal.mts create mode 100644 mods/MAPGEN/mcl_shipwrecks/schematics/shipwreck_half_back.mts create mode 100644 mods/MAPGEN/mcl_shipwrecks/schematics/shipwreck_half_front.mts diff --git a/mods/MAPGEN/mcl_shipwrecks/init.lua b/mods/MAPGEN/mcl_shipwrecks/init.lua new file mode 100644 index 0000000000..e9b957095f --- /dev/null +++ b/mods/MAPGEN/mcl_shipwrecks/init.lua @@ -0,0 +1,104 @@ +local modname = minetest.get_current_modname() +local modpath = minetest.get_modpath(modname) +--local S = minetest.get_translator(modname) + +local mgp = minetest.get_mapgen_params() +local pr = PseudoRandom(mgp.seed) + +--schematics by chmodsayshello +local schems = { + "shipwreck_full_damaged", + "shipwreck_full_normal", + "shipwreck_full_back_damaged", + "shipwreck_half_front", + "shipwreck_half_back", +} + +local loottable_supply = { + stacks_min = 3, + stacks_max = 10, + items = { + --{ itemstring = "TODO:sus_stew", weight = 10, amount_min = 1, amount_max = 1 }, + { itemstring = "mcl_core:paper", weight = 8, amount_min = 1, amount_max = 12 }, + { itemstring = "mcl_farming:wheat_item", weight = 7, amount_min = 8, amount_max = 21 }, + { itemstring = "mcl_farming:carrot_item", weight = 7, amount_min = 4, amount_max = 8 }, + { itemstring = "mcl_farming:potato_item_poison", weight = 7, amount_min = 2, amount_max = 6 }, + { itemstring = "mcl_farming:potato_item", weight = 7, amount_min = 2, amount_max = 6 }, + --{ itemstring = "TODO:moss_block", weight = 7, amount_min = 1, amount_max = 4 }, + { itemstring = "mcl_core:coal_lump", weight = 6, amount_min = 2, amount_max = 8 }, + { itemstring = "mcl_mobitems:rotten_flesh", weight = 5, amount_min = 5, amount_max = 24 }, + { itemstring = "mcl_farming:potato_item", weight = 3, amount_min = 1, amount_max = 5 }, + { itemstring = "mcl_armor:helmet_leather_enchanted", weight = 3 }, + { itemstring = "mcl_armor:chestplate_leather_enchanted", weight = 3 }, + { itemstring = "mcl_armor:leggings_leather_enchanted", weight = 3 }, + { itemstring = "mcl_armor:boots_leather_enchanted", weight = 3 }, + --{ itemstring = "TODO:bamboo", weight = 2, amount_min = 1, amount_max = 3 }, + { itemstring = "mcl_farming:pumpkin", weight = 2, amount_min = 1, amount_max = 3 }, + { itemstring = "mcl_tnt:tnt", weight = 1, amount_min = 1, amount_max = 2 }, + + } +} + +local loottable_treasure = { + stacks_min = 3, + stacks_max = 10, + items = { + { itemstring = "mcl_core:iron_ingot", weight = 8, amount_min = 1, amount_max = 5 }, + { itemstring = "mcl_core:iron_nugget", weight = 8, amount_min = 1, amount_max = 10 }, + { itemstring = "mcl_core:emerald", weight = 8, amount_min = 1, amount_max = 12 }, + { itemstring = "mcl_dye:blue", weight = 8, amount_min = 1, amount_max = 12 }, + { itemstring = "mcl_core:gold_ingot", weight = 8, amount_min = 1, amount_max = 5 }, + { itemstring = "mcl_core:gold_nugget", weight = 8, amount_min = 1, amount_max = 10 }, + { itemstring = "mcl_experience:bottle", weight = 8, amount_min = 1, amount_max = 10 }, + { itemstring = "mcl_core:diamond", weight = 8, amount_min = 1, amount_max = 10 }, + } +} + +local function fill_chests(p1,p2) + for _,p in pairs(minetest.find_nodes_in_area(p1,p2,{"mcl_chests:chest_small"})) do + if minetest.get_meta(p):get_string("infotext") ~= "Chest" then + minetest.registered_nodes["mcl_chests:chest_small"].on_construct(p) + end + local inv = minetest.get_inventory( {type="node", pos=p} ) + local loot = loottable_supply + if pr:next(1,10) == 1 then loot = loottable_treasure end + mcl_loot.fill_inventory(inv, "main", mcl_loot.get_multi_loot({loot}, pr), pr) + end +end + +local function get_ocean_biomes() + local r = {} + for k,_ in pairs(minetest.registered_biomes) do + if k:find("_ocean") then table.insert(r,k) end + end + return r +end + +minetest.register_node("mcl_shipwrecks:structblock", {drawtype="airlike",groups = {structblock=1,not_in_creative_inventory=1},}) + +minetest.register_decoration({ + decoration = "mcl_shipwrecks:structblock", + deco_type = "simple", + place_on = {"group:sand","mcl_core:gravel"}, + spawn_by = {"group:water"}, + num_spawn_by = 4, + sidelen = 80, + fill_ratio = 0.00002, + flags = "place_center_x, place_center_z, force_placement", + biomes = get_ocean_biomes(), + y_max=mgp.water_level-4, +}) + +minetest.register_lbm({ + name = "mcl_shipwrecks:struct_lbm", + run_at_every_load = true, + nodenames = {"mcl_shipwrecks:structblock"}, + action = function(pos, node) + minetest.set_node(pos,{name="air"}) + local file = modpath.."/schematics/"..schems[pr:next(1,#schems)]..".mts" + local pp = vector.offset(pos,0,pr:next(-4,-2),0) + mcl_structures.place_schematic(pp, file, "random", nil, true, "place_center_x,place_center_z", function() + fill_chests(vector.offset(pos,-20,-5,-20),vector.offset(pos,20,15,20)) + end)-- pr, callback_param + end +}) diff --git a/mods/MAPGEN/mcl_shipwrecks/mod.conf b/mods/MAPGEN/mcl_shipwrecks/mod.conf new file mode 100644 index 0000000000..a3ca2c02c6 --- /dev/null +++ b/mods/MAPGEN/mcl_shipwrecks/mod.conf @@ -0,0 +1,3 @@ +name = mcl_shipwrecks +author = cora +depends = mcl_loot, mcl_structures diff --git a/mods/MAPGEN/mcl_shipwrecks/schematics/shipwreck_full_back_damaged.mts b/mods/MAPGEN/mcl_shipwrecks/schematics/shipwreck_full_back_damaged.mts new file mode 100644 index 0000000000000000000000000000000000000000..12f3c9b1397a55b114129633349306c427bef496 GIT binary patch literal 1203 zcmeYb3HD`RVNhg{WZ0{D?YyI4lgO*pctQXX;XI?^i0)ZQ#{aV$N&O19v6LA z>McLP!0M>hJPZYOEC0IAlXO zztu&23?83X&#XJIw)btR>f5h#-(;rI`g;})5o_QwjhzK%(jVW`M+-_d{h z`HUCuALqQEk@5cVj3d7--dX>j#nU6pa3KF*Owq02qrZQz`DuKv?9$iBw_DAxPiCIQ zvvx}Q)jPMD8TwLwiS&K@Y_a#s`NulHcmJJ#oRMKpY~Ov$1I8D?feIuZFud9&=Dg32 z!D7m;wcWRh*31jDVm_wwca?*~Ix*%-mhx9e`}A|)bgh_P<2&Qt`MVqss~L*8-)}M$ zT(~QOrNZy@lS?yomu4SyToQh+;=uRmeS%8Mc1_fB&RE?msKn5?=Q{Uu&qF68#0}5< zc^*~v>}^oiLfOwe@9MJW?7Y8p9=ppFv90YJew^y^*lMm+-mkos*<;E>pR*jva|(O& zdz8zvE=jaI9o*QmPW3zEBRl(LAKrcm>Z-DH`(!F?A-++kg(159a6Q8oiH%_Yd^kHb z_2>TC3^KkqueoNjHZ?IGE2+P!;}XShGh9v#SL$1yrOQ(vk z^=Y}sy0p~%m=-?&>>FbNLyaRG4;DW88`!1s?fDM_=Z7j!0=6hWiY@wcH*ik;R7EAF zBex$<`C?I_cGZFJjG$m(jb4n*f#Q|N4pn)i{$$dSsWHFWBk{=JIg_E-uvU_R;lSh{ K>?#)@iUR;mO&+xX literal 0 HcmV?d00001 diff --git a/mods/MAPGEN/mcl_shipwrecks/schematics/shipwreck_full_damaged.mts b/mods/MAPGEN/mcl_shipwrecks/schematics/shipwreck_full_damaged.mts new file mode 100644 index 0000000000000000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574cy`D}f%r5^sYk8U1(kYpOZ5DainJkOH z=`Vi$y+m*O*Y`>`^H0~@XJ&}tdaDy#woGoyL&@D=_PqXnm-YIO-#I+n|2yg~71Xl+ zbns7*$W9LNdB4wZsGoN(yRC@3f`>up{M)*ZMwj(d&L>u@yceJPT=-W0)NeEQ?tBry z{^Gol^Pcgaf3KbO_(>S=*3wywGU>T8+*#X>Y)j{le!A~<_e;Z7b+Lvkte?!(-+D|! zsi$wTt3l^X9%cTw&5z&Y?6mn^tJm(*bLoC!=-yAhod&Ju(T6O1>Nf8`XgkmL{NehV z0-1(B@%4WSy}FwB3cdgJL+)Yx?c?jW@ju^u@8A=e<$lL1HYe|i+j`e4`Aplpo7qZj z?<|a(JkKnCXaD_r$8?M1n{P|Jwm5#Tu^^|SW)SN__YHS4j@?r`5? zo_C?l3>7Rf{kJ>Q|Ja_p!tuwJkKw?l5A&F1_dI7n1tJ%>z4d9FDXVDDazOl2)Gzk8 zFLGEp9k;LK?70`};^AjByP6?b!)Apt*G&|)9!gmW^F_B=+ zdh{i9t>EX3fEYr=C zRCN=4RX#h#xp*E;{~wVqn&%O?(bzTr(Entiba|V|3Yi%`=k%Kn?>o80yHm|TKIyl~ zmHFpB_4}{nFkZx!Y$Kp@?iDBh>pvegM0dZQ-ghc^Md#w)pqsDk3jav#n))OysYW5<_Gu=$BMn0Tt3W1?6 zrZ_WllTpAEZ7)`PwL*rT`Q^J-b4J>Ttbfd~L*??*?iJbpj%!1Fo73^%_Uvg70H#i? A82|tP literal 0 HcmV?d00001 diff --git a/mods/MAPGEN/mcl_shipwrecks/schematics/shipwreck_half_back.mts b/mods/MAPGEN/mcl_shipwrecks/schematics/shipwreck_half_back.mts new file mode 100644 index 0000000000000000000000000000000000000000..f58376f3009eb49fb9bbb3e71668aee3205aa9ef GIT binary patch literal 1248 zcmeYb3HD`RVNhg{WZ$H!}{I@5+GeGy1i&snG z{Nq-$;|gomo|#y`PX50C=eK7CKJHpkc}1QfI!^p;`2CX5|C4vj-@HbAv(9Vqh(0fy zedjo1!{Rr8Be#CBw%oS!-X~kv?4y#}Y3=7%F&?lyyZY{FzWx2liT}SGF={Hlw(I2k z#|#HPKbXlZcU}e@;6UQR%dNSyEf1u+UodC96L`D$Vdzc1O>8G#$8kUSqc_R&#>5@3 zZiPi&i>iOakQllB?*5J|Jm0v38yN~8ZZr1UFJt#-^OX5o&z}8pl@NHPUbtcVog*{8 zo?@P3aG-alu#AFy^BvjH%Sy@*e+z`w?OwzyuxRz{@`FbTgCDUd*Yt*J+?2iJl2dcQ zdxb^RqX_MDQ!F0FhV(hUTlVOIz@u4So;rq2QzQ;=_`t`v{uINy!VdvSpBC}%d#Lk$ z*NUnK)s^AA_dBPF7n(@S zHZJ3IobQ~DJ%#Hg?mo$3Gh;<+?R;Ghe~Ej#g(n=|EXjPbxi;tMM*bHX;tp%dZ5Aw3 z|Kc_I>z*6yR}}U(FTdomQdM=X{D#|g6D)rCNg00J*LF8Gy}|h6=T{Y}C*$uhGcfG_ K!EU%o(E|2 literal 0 HcmV?d00001 diff --git a/mods/MAPGEN/mcl_shipwrecks/schematics/shipwreck_half_front.mts b/mods/MAPGEN/mcl_shipwrecks/schematics/shipwreck_half_front.mts new file mode 100644 index 0000000000000000000000000000000000000000..41efb386b3ca718e4788f051e050a0d8405208ac GIT binary patch literal 903 zcmeYb3HD`RVNhg{WZ2D<~CHD;!E-i7-Z000<#n>3-&ZjH`r$|X$A?n zGmA@#G7Ab)Q=pz;5Ch9(q!yPHTP1_2_~P8eoE(S_m|-BNz|5+c^Y-q=yju2Xqw+g2GQ23znQSx??-}bG3 zB|X!``gVI)PYlhjSa(!aSMefe^y%B8Tix7OE?ro7>32k#u*iptS9^WtTq=Cz^1DIq zQT80Z>;E3ATo8Wab2-&@+vZtHiww)917D|GKo+{V!Ku)zIE`{`iVV6VB`~^D|qVE6?k0*>bxf yNKaNv%F9Ql>`Bqfi{`wdyl2^WU%V7yYvmn(FkWx^j-O|gL6+S+nSU%V(*yuqfRd5` literal 0 HcmV?d00001