From 22a1b0a5d23579913adf3dfa4d8473883047ca57 Mon Sep 17 00:00:00 2001 From: Wuzzy Date: Fri, 8 Sep 2017 04:30:47 +0200 Subject: [PATCH] Convert desert temple structure to schematic file --- mods/MAPGEN/mcl_structures/init.lua | 11 +++++++++-- .../schematics/mcl_structures_desert_temple.mts | Bin 0 -> 1338 bytes .../schematics/mcl_structures_desert_temple.we | 1 - 3 files changed, 9 insertions(+), 3 deletions(-) create mode 100644 mods/MAPGEN/mcl_structures/schematics/mcl_structures_desert_temple.mts delete mode 100644 mods/MAPGEN/mcl_structures/schematics/mcl_structures_desert_temple.we diff --git a/mods/MAPGEN/mcl_structures/init.lua b/mods/MAPGEN/mcl_structures/init.lua index 2bb3cd7c9..03b33cd5a 100644 --- a/mods/MAPGEN/mcl_structures/init.lua +++ b/mods/MAPGEN/mcl_structures/init.lua @@ -238,12 +238,18 @@ end mcl_structures.generate_desert_temple = function(pos) -- No Generating for the temple ... Why using it ? No Change - local temple = mcl_structures.get_struct("mcl_structures_desert_temple.we") + local path = minetest.get_modpath("mcl_structures").."/schematics/mcl_structures_desert_temple.mts" local newpos = {x=pos.x,y=pos.y-12,z=pos.z} + local size = {x=22, y=24, z=22} if newpos == nil then return end - local count, chests = mcl_structures.deserialise_WE(newpos, temple) + minetest.place_schematic(newpos, path, "random", nil, true) + + -- Find chests. + -- FIXME: Searching this large area just for the chets is not efficient. Need a better way to find the chests; + -- probably let's just infer it from newpos because the schematic always the same. + local chests = minetest.find_nodes_in_area({x=newpos.x-size.x, y=newpos.y, z=newpos.z-size.z}, vector.add(newpos, size), "mcl_chests:chest") -- Add desert temple loot into chests for c=1, #chests do @@ -287,6 +293,7 @@ mcl_structures.generate_desert_temple = function(pos) local meta = minetest.get_meta(chests[c]) local inv = meta:get_inventory() + inv:set_size("main", 9*3) for i=1, #lootitems do inv:add_item("main", lootitems[i]) end diff --git a/mods/MAPGEN/mcl_structures/schematics/mcl_structures_desert_temple.mts b/mods/MAPGEN/mcl_structures/schematics/mcl_structures_desert_temple.mts new file mode 100644 index 0000000000000000000000000000000000000000..6530822a73451c070c0b4cbbfe2226c62a58e586 GIT binary patch literal 1338 zcmeYb3HD`RVGv`GWDu*z1sHf4gmRN};*;}>Qmu*;^HPdS^7B#|cu~X{m=iOL7$i`{ z!0L)~^YcqG7*rrKIr&9NIr+)i#a0=KMJcIysVVWvIf<3=`9+C&>8aTCCnpw_rKT`Q zf%F%b04*uD0#oq_mq;SZE{NeO_h%}6aSDYi-mQ4HK5k&?U;Dok0PK`mGCP`$|+5)nDcf{ z_qN#z0xKB$9o9 z&)9Z8_v}~0x6%2(dEQz@e6@P9eSPDp^(VYGeP)@Pv8tW(zDd zxBH%uebu{q@7XD{H}QR5J8`q=OucVkWminz6IT@c#Omu7End^bcQWrz(ptZGvGTOr zT}z8%gp0gCOxpL=s(;5y-<@#Wfpxm^euV3`nFuXJJ$-~Jt=iRcWyer|H7GTma$2@liz1B zmTtP|9kubApYZb!Lb=aMYOl$cyY~cbd}jA*`MJyUr_b-)5N~oS&hv!#E~{Ps;@5t^ zE4{2yy!^51!aENozJA~Hb>DIK&jt4;UiaQIGbsAJVD`_yJ!>~Ud%iKxUd#OD`p+-# zs4Tsz`rNDT;`6L()nN0Nzf@-#GTs+_H1p$~4bxlxtmw91KkIQ^lI!zH|K;bc{s?r# z1ufsSn;WOu#1)yJz3lt0>&}*KOSbHKa>q38(%rK^zyDodxVGxT0s3NElN5|q=w7ZpM`4QtaV>>>j%5P&-a(X zkuRs4UCR_S|L{C*dU@NblDTqm!df?FTfOeJu6VMBL;8k?mf=3HxT7nc@aTM-RK9S* zir$b#`o4K)DjR1i{Bf#3SF+!aML?@}^NybjlEkNWw60hZ;}z5y(c#6Vki0)d8zk~% zc1m#P$5oPC=0PWS1l){>I5B-M%hV9gIHtlE(;Z~a6)O07Y9;Pj5+YIEYH@3IE%#F8 z_vfxIUGZdh&YkMJG5jl*u!ya8x#zm#$pnp%MVFgny1e)t@9pjM>TBG;_jSu!W`+RP z%=4CP^B!Nfzc-)t`}5ZA-{XbiUh*$*Rj*CtsbXMYc=5nokm1^6zmw&1dO$81G~9jg VPsl