From 7f2ecb6ed0d1c0140a222411022c9c45375fede6 Mon Sep 17 00:00:00 2001 From: PrairieWind Date: Thu, 13 Oct 2022 21:06:58 -0600 Subject: [PATCH 1/4] Add brewing stand and furnace to igloo schematics --- mods/MAPGEN/mcl_structures/igloo.lua | 12 +++++------- .../mcl_structures_igloo_basement.mts | Bin 537 -> 595 bytes .../schematics/mcl_structures_igloo_top.mts | Bin 329 -> 340 bytes 3 files changed, 5 insertions(+), 7 deletions(-) diff --git a/mods/MAPGEN/mcl_structures/igloo.lua b/mods/MAPGEN/mcl_structures/igloo.lua index 49e3c879a..10d1fe35a 100644 --- a/mods/MAPGEN/mcl_structures/igloo.lua +++ b/mods/MAPGEN/mcl_structures/igloo.lua @@ -3,8 +3,7 @@ local S = minetest.get_translator(modname) local modpath = minetest.get_modpath(modname) function mcl_structures.generate_igloo_top(pos, pr) - -- FIXME: This spawns bookshelf instead of furnace. Fix this! - -- Furnace does ot work atm because apparently meta is not set. :-( + -- Furnace does ot work atm because apparently meta is not set. Need a bit of help with fixing this for furnaces, bookshelves, and brewing stands. local newpos = {x=pos.x,y=pos.y-2,z=pos.z} local path = modpath.."/schematics/mcl_structures_igloo_top.mts" local rotation = tostring(pr:next(0,3)*90) @@ -12,7 +11,6 @@ function mcl_structures.generate_igloo_top(pos, pr) end function mcl_structures.generate_igloo_basement(pos, orientation, loot, pr) - -- TODO: Add brewing stand -- TODO: Add monster eggs local path = modpath.."/schematics/mcl_structures_igloo_basement.mts" mcl_structures.place_schematic(pos, path, orientation, nil, true, nil, function() @@ -58,19 +56,19 @@ function mcl_structures.generate_igloo(pos, def, pr) if rotation == "0" then dir = {x=-1, y=0, z=0} tdir = {x=1, y=0, z=0} - tpos = {x=pos.x+7, y=pos.y-1, z=pos.z+3} + tpos = {x=pos.x+7, y=pos.y-2, z=pos.z+3} elseif rotation == "90" then dir = {x=0, y=0, z=-1} tdir = {x=0, y=0, z=-1} - tpos = {x=pos.x+3, y=pos.y-1, z=pos.z+1} + tpos = {x=pos.x+3, y=pos.y-2, z=pos.z+1} elseif rotation == "180" then dir = {x=1, y=0, z=0} tdir = {x=-1, y=0, z=0} - tpos = {x=pos.x+1, y=pos.y-1, z=pos.z+3} + tpos = {x=pos.x+1, y=pos.y-2, z=pos.z+3} elseif rotation == "270" then dir = {x=0, y=0, z=1} tdir = {x=0, y=0, z=1} - tpos = {x=pos.x+3, y=pos.y-1, z=pos.z+7} + tpos = {x=pos.x+3, y=pos.y-2, z=pos.z+7} else return success end diff --git a/mods/MAPGEN/mcl_structures/schematics/mcl_structures_igloo_basement.mts b/mods/MAPGEN/mcl_structures/schematics/mcl_structures_igloo_basement.mts index c2a774e78276a64af756aa0cd43a0e33cc16b413..2bc92ae5d0746a54fee08ca04e07bc6209f24070 100644 GIT binary patch delta 302 zcmbQqa+yWgHze4XfrWvSft7*19t0Q!Ckj{aC*|j77h8eJjMSX8iLC}=qPfXA@kvFg z<(YZuR>dWWc`5M*1_l$i^w*1lWRf#di%W{Fz*Ky3ZemUjgD^6jswg!jJ~^?d zAho1o&fVaPe9a0xI;nZV&%dO8EdKsFyV0@x>V_lBW1AOF&$iTN(y(xdl9HGgmzff0 za-8RS!BtkP9fx#Z+pM)-``%LGhQuxJ`Lb7H-t<^XG$$MjFiy=eS?bPjw&T6>b)S>Q zTE}uF?pCiVs+{)aans?#@47kXe|aByY4Cl?j6_eVd7qsEmuWp;v(dae>N(5f)?>@h u%nUuUNBF_?v-cNgN~s_CW!itibc^%Uo6^0%ZbenB<%Xn2JQLk=SIv?<3oyK6u=i5s_F2{s2Z!_FTeLmnmx$Bx++E{AYtr~RuNq~l zcFu^SS=2fSW4pBGWm*1Ih2NQ88 diff --git a/mods/MAPGEN/mcl_structures/schematics/mcl_structures_igloo_top.mts b/mods/MAPGEN/mcl_structures/schematics/mcl_structures_igloo_top.mts index e3705236e497348663f2acc0202607ae49b09e41..5a2a96deae946c28850ebc7e88b920e67a1a4926 100644 GIT binary patch delta 212 zcmX@fbcM;;Hze4XfrWvSfsKK^9t;>b8JH6@ix`A*lXK#e^NUigiu3ZzlXCKtvl&D{ zVrivCd5OuX#a2+pM5h=LVUR>petveb6`0IO%}JX$*RbGh$XhN3MUKnwKCi9)+I-;L z6pPJ#xBgv;(9>o*alof@#wT8p6xD-l)l2upt*yAc@!(dWG;_oSbF z<^6nP(IM9FPkv`r{;OyAcjPoSv48Lzv?OYTq3%bNXOqx#~0DSL-w@O@c1bKW5lRR@~rS~Lcl loa#{I9#vAesI;vb?Y#EYdxoEZVOHgTfvq2D8&2|9XPg)jOm6@H From 7fee2cd55a7f10b59a3b6d24e5fbf7fa85fe5f38 Mon Sep 17 00:00:00 2001 From: cora Date: Sat, 15 Oct 2022 03:39:27 +0200 Subject: [PATCH 2/4] struct-api: export construct_nodes function --- mods/MAPGEN/mcl_structures/api.lua | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/mods/MAPGEN/mcl_structures/api.lua b/mods/MAPGEN/mcl_structures/api.lua index 6b157717e..f542dddba 100644 --- a/mods/MAPGEN/mcl_structures/api.lua +++ b/mods/MAPGEN/mcl_structures/api.lua @@ -30,13 +30,17 @@ local function generate_loot(pos, def, pr) if def.loot then mcl_structures.fill_chests(p1,p2,def.loot,pr) end end -local function construct_nodes(pos,def,pr) - local nn = minetest.find_nodes_in_area(vector.offset(pos,-def.sidelen/2,0,-def.sidelen/2),vector.offset(pos,def.sidelen/2,def.sidelen,def.sidelen/2),def.construct_nodes) +function mcl_structures.construct_nodes(p1,p2,nodes) + local nn=minetest.find_nodes_in_area(p1,p2,nodes) for _,p in pairs(nn) do mcl_structures.init_node_construct(p) end end +local function construct_nodes(pos,def,pr) + return mcl_structures.construct_nodes(vector.offset(pos,-def.sidelen/2,0,-def.sidelen/2),vector.offset(pos,def.sidelen/2,def.sidelen,def.sidelen/2)) +end + function mcl_structures.find_lowest_y(pp) local y = 31000 From dd163f48500c4b048076ae2afd8bbec107517fc9 Mon Sep 17 00:00:00 2001 From: cora Date: Sat, 15 Oct 2022 03:39:45 +0200 Subject: [PATCH 3/4] initialize special nodes on igloo placement --- mods/MAPGEN/mcl_structures/igloo.lua | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/mods/MAPGEN/mcl_structures/igloo.lua b/mods/MAPGEN/mcl_structures/igloo.lua index 10d1fe35a..22df0ad5f 100644 --- a/mods/MAPGEN/mcl_structures/igloo.lua +++ b/mods/MAPGEN/mcl_structures/igloo.lua @@ -7,7 +7,11 @@ function mcl_structures.generate_igloo_top(pos, pr) local newpos = {x=pos.x,y=pos.y-2,z=pos.z} local path = modpath.."/schematics/mcl_structures_igloo_top.mts" local rotation = tostring(pr:next(0,3)*90) - return mcl_structures.place_schematic(newpos, path, rotation, nil, true), rotation + return mcl_structures.place_schematic(newpos, path, rotation, nil, true, nil, function() + local p1 = vector.offset(pos,-5,-5,-5) + local p2 = vector.offset(pos,5,5,5) + mcl_structures.construct_nodes(p1,p2,{"mcl_furnaces:furnace","mcl_books:bookshelf"}) + end), rotation end function mcl_structures.generate_igloo_basement(pos, orientation, loot, pr) @@ -17,6 +21,7 @@ function mcl_structures.generate_igloo_basement(pos, orientation, loot, pr) local p1 = vector.offset(pos,-5,-5,-5) local p2 = vector.offset(pos,5,5,5) mcl_structures.fill_chests(p1,p2,loot,pr) + mcl_structures.construct_nodes(p1,p2,{"mcl_brewing:stand_000","mcl_books:bookshelf"}) local mc = minetest.find_nodes_in_area_under_air(p1,p2,{"mcl_core:stonebrickmossy"}) if #mc == 2 then table.shuffle(mc) From 4a9a7b8fefc4b51b61170f03daa3a53336c1b28f Mon Sep 17 00:00:00 2001 From: cora Date: Sat, 15 Oct 2022 04:03:36 +0200 Subject: [PATCH 4/4] Fix igloo chest loot --- mods/MAPGEN/mcl_structures/igloo.lua | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/mods/MAPGEN/mcl_structures/igloo.lua b/mods/MAPGEN/mcl_structures/igloo.lua index 22df0ad5f..64b4206c0 100644 --- a/mods/MAPGEN/mcl_structures/igloo.lua +++ b/mods/MAPGEN/mcl_structures/igloo.lua @@ -142,7 +142,7 @@ mcl_structures.register_structure("igloo",{ biomes = { "ColdTaiga", "IcePlainsSpikes", "IcePlains" }, place_func = mcl_structures.generate_igloo, loot = { - ["mcl_chests:chest"] = {{ + ["mcl_chests:chest_small"] = {{ stacks_min = 1, stacks_max = 1, items = { @@ -160,6 +160,7 @@ mcl_structures.register_structure("igloo",{ { itemstring = "mcl_mobitems:rotten_flesh", weight = 10 }, { itemstring = "mcl_tools:axe_stone", weight = 2 }, { itemstring = "mcl_core:emerald", weight = 1 }, + { itemstring = "mcl_core:apple_gold", weight = 1 }, } }}, }