From f8501192e2b11f7dac89928e0dc2eae9759fc4fe Mon Sep 17 00:00:00 2001 From: cora Date: Wed, 14 Sep 2022 17:46:51 +0200 Subject: [PATCH 1/5] Make nylium spread to netherrack using bonemeal --- mods/ITEMS/mcl_crimson/init.lua | 30 ++++++++++++++++++++++++++++++ mods/ITEMS/mcl_crimson/mod.conf | 3 +-- 2 files changed, 31 insertions(+), 2 deletions(-) diff --git a/mods/ITEMS/mcl_crimson/init.lua b/mods/ITEMS/mcl_crimson/init.lua index 45710c152..2a6dbe4d9 100644 --- a/mods/ITEMS/mcl_crimson/init.lua +++ b/mods/ITEMS/mcl_crimson/init.lua @@ -452,6 +452,36 @@ minetest.register_node("mcl_crimson:crimson_nylium", { _mcl_silk_touch_drop = true, }) +local function has_nylium_neighbor(pos) + local p = minetest.find_node_near(pos,1,{"mcl_crimson:warped_nylium","mcl_crimson:crimson_nylium"}) + if p then + return minetest.get_node(p) + end +end + +local function spread_nylium(pos) + local nn = minetest.find_nodes_in_area_under_air(vector.offset(pos,-5,-3,-5),vector.offset(pos,5,3,5),{"mcl_nether:netherrack"}) + table.insert(nn,pos) + table.sort(nn,function(a, b) + return vector.distance(pos, a) < vector.distance(pos, b) + end) + for i=1,math.random(1,math.min(#nn,15)) do + local n = has_nylium_neighbor(nn[i]) + if n then + minetest.set_node(nn[i],n) + mcl_dye.add_bone_meal_particle(vector.offset(nn[i],0,1,0)) + end + end +end + +mcl_dye.register_on_bone_meal_apply(function(pt,user) + if not pt.type == "node" then return end + if minetest.get_node(pt.under).name ~= "mcl_nether:netherrack" then return end + if has_nylium_neighbor(pt.under) then + spread_nylium(pt.under) + end +end) + minetest.register_craft({ output = "mcl_crimson:crimson_hyphae_wood 4", recipe = { diff --git a/mods/ITEMS/mcl_crimson/mod.conf b/mods/ITEMS/mcl_crimson/mod.conf index 4dbf770c3..2e5550775 100644 --- a/mods/ITEMS/mcl_crimson/mod.conf +++ b/mods/ITEMS/mcl_crimson/mod.conf @@ -1,4 +1,3 @@ name = mcl_crimson author = debiankaios -depends = mcl_stairs, mobs_mc, mcl_util - +depends = mcl_stairs, mobs_mc, mcl_util, mcl_dye From 3fc12ed946615cdb4bbf1b6850fc2ba089e210e8 Mon Sep 17 00:00:00 2001 From: cora Date: Thu, 15 Sep 2022 04:30:58 +0200 Subject: [PATCH 2/5] Add plants on bonemealed nylium --- mods/ITEMS/mcl_crimson/init.lua | 94 +++++++++++++++++++++++++++------ 1 file changed, 79 insertions(+), 15 deletions(-) diff --git a/mods/ITEMS/mcl_crimson/init.lua b/mods/ITEMS/mcl_crimson/init.lua index 2a6dbe4d9..741ed33d9 100644 --- a/mods/ITEMS/mcl_crimson/init.lua +++ b/mods/ITEMS/mcl_crimson/init.lua @@ -104,6 +104,52 @@ minetest.register_node("mcl_crimson:twisting_vines", { _mcl_blast_resistance = 0, }) +minetest.register_node("mcl_crimson:weeping_vines", { + description = S("Weeping Vines"), + drawtype = "plantlike", + tiles = { "mcl_crimson_weeping_vines.png" }, + inventory_image = "mcl_crimson_weeping_vines.png", + sunlight_propagates = true, + paramtype = "light", + walkable = false, + climbable = true, + buildable_to = true, + groups = {dig_immediate=3,vines=1,dig_by_water=1,destroy_by_lava_flow=1,dig_by_piston=1,deco_block=1, shearsy = 1}, + selection_box = { + type = "fixed", + fixed = { -3/16, -0.5, -3/16, 3/16, 0.5, 3/16 }, + }, + node_placement_prediction = "", + on_rightclick = function(pos, node, pointed_thing, itemstack) + if pointed_thing:get_wielded_item():get_name() == "mcl_crimson:weeping_vines" then + itemstack:take_item() + grow_vines(pos, 1, "mcl_crimson:weeping_vines", -1) + elseif pointed_thing:get_wielded_item():get_name() == "mcl_dye:white" then + itemstack:take_item() + grow_vines(pos, math.random(1, 3),"mcl_crimson:weeping_vines", -1) + end + end, + drop = { + max_items = 1, + items = { + {items = {"mcl_crimson:weeping_vines"}, rarity = 3}, + }, + }, + _mcl_shears_drop = true, + _mcl_silk_touch_drop = true, + _mcl_fortune_drop = { + items = { + {items = {"mcl_crimson:weeping_vines"}, rarity = 3}, + }, + items = { + {items = {"mcl_crimson:weeping_vines"}, rarity = 1.8181818181818181}, + }, + "mcl_crimson:weeping_vines", + "mcl_crimson:weeping_vines", + }, + _mcl_blast_resistance = 0, +}) + minetest.register_node("mcl_crimson:nether_sprouts", { description = S("Nether Sprouts"), drawtype = "plantlike", @@ -282,21 +328,6 @@ minetest.register_craft({ }, }) -minetest.register_abm({ - label = "mcl_crimson:warped_fungus", - nodenames = {"mcl_crimson:warped_fungus"}, - interval = 11, - chance = 128, - action = function(pos) - local nodepos = minetest.get_node(vector.offset(pos, 0, -1, 0)) - if nodepos.name == "mcl_crimson:warped_nylium" or nodepos.name == "mcl_nether:netherrack" then - if pos.y < -28400 then - generate_warped_tree(pos) - end - end - end -}) - minetest.register_node("mcl_crimson:crimson_fungus", { description = S("Crimson Fungus Mushroom"), drawtype = "plantlike", @@ -459,6 +490,21 @@ local function has_nylium_neighbor(pos) end end +local nether_plants = { + ["mcl_crimson:crimson_nylium"] = { + "mcl_crimson:crimson_roots", + "mcl_crimson:crimson_fungus", + "mcl_crimson:weeping_vines", + "mcl_crimson:warped_fungus", + }, + ["mcl_crimson:warped_nylium"] = { + "mcl_crimson:warped_roots", + "mcl_crimson:warped_fungus", + "mcl_crimson:twisting_vines", + "mcl_crimson:nether_sprouts", + }, +} + local function spread_nylium(pos) local nn = minetest.find_nodes_in_area_under_air(vector.offset(pos,-5,-3,-5),vector.offset(pos,5,3,5),{"mcl_nether:netherrack"}) table.insert(nn,pos) @@ -469,6 +515,9 @@ local function spread_nylium(pos) local n = has_nylium_neighbor(nn[i]) if n then minetest.set_node(nn[i],n) + if math.random(5) == 1 then + minetest.set_node(vector.offset(nn[i],0,1,0),{name=nether_plants[n.name][math.random(#nether_plants[n.name])]}) + end mcl_dye.add_bone_meal_particle(vector.offset(nn[i],0,1,0)) end end @@ -513,3 +562,18 @@ minetest.register_abm({ end end }) + +minetest.register_abm({ + label = "mcl_crimson:warped_fungus", + nodenames = {"mcl_crimson:warped_fungus"}, + interval = 11, + chance = 128, + action = function(pos) + local nodepos = minetest.get_node(vector.offset(pos, 0, -1, 0)) + if nodepos.name == "mcl_crimson:warped_nylium" or nodepos.name == "mcl_nether:netherrack" then + if pos.y < -28400 then + generate_warped_tree(pos) + end + end + end +}) From 70294d9e34cc44a5e7050c1ec3c3c7aa397f7aec Mon Sep 17 00:00:00 2001 From: cora Date: Thu, 15 Sep 2022 04:31:35 +0200 Subject: [PATCH 3/5] Add weeping vines --- mods/ITEMS/mcl_crimson/init.lua | 28 ++++++++++++++-------------- mods/ITEMS/mcl_crimson/mod.conf | 2 +- mods/MAPGEN/mcl_biomes/init.lua | 14 +++++++++++++- 3 files changed, 28 insertions(+), 16 deletions(-) diff --git a/mods/ITEMS/mcl_crimson/init.lua b/mods/ITEMS/mcl_crimson/init.lua index 741ed33d9..4262e41bb 100644 --- a/mods/ITEMS/mcl_crimson/init.lua +++ b/mods/ITEMS/mcl_crimson/init.lua @@ -13,19 +13,19 @@ function generate_crimson_tree(pos) minetest.place_schematic(pos,modpath.."/schematics/crimson_fungus_1.mts","random",nil,false,"place_center_x,place_center_z") end -function grow_twisting_vines(pos, moreontop) - local y = pos.y + 1 - while not (moreontop == 0) do - if minetest.get_node({x = pos.x, y = y, z = pos.z}).name == "air" then - minetest.set_node({x = pos.x, y = y, z = pos.z}, {name="mcl_crimson:twisting_vines"}) - moreontop = moreontop - 1 - y = y + 1 - elseif minetest.get_node({x = pos.x, y = y, z = pos.z}).name == "mcl_crimson:twisting_vines" then - y = y + 1 - else - moreontop = 0 +function grow_vines(pos, moreontop ,vine, dir) + if dir == nil then dir = 1 end + local n + repeat + pos = vector.offset(pos,0,dir,0) + n = minetest.get_node(pos) + if n.name == "air" then + for i=0,math.max(moreontop,1) do + minetest.set_node(vector.offset(pos,0,i*dir,0),{name=vine}) end - end + break + end + until n.name ~= "air" and n.name ~= vine end minetest.register_node("mcl_crimson:warped_fungus", { @@ -77,10 +77,10 @@ minetest.register_node("mcl_crimson:twisting_vines", { on_rightclick = function(pos, node, pointed_thing, itemstack) if pointed_thing:get_wielded_item():get_name() == "mcl_crimson:twisting_vines" then itemstack:take_item() - grow_twisting_vines(pos, 1) + grow_vines(pos, 1, "mcl_crimson:twisting_vines") elseif pointed_thing:get_wielded_item():get_name() == "mcl_dye:white" then itemstack:take_item() - grow_twisting_vines(pos, math.random(1, 3)) + grow_vines(pos, math.random(1, 3),"mcl_crimson:twisting_vines") end end, drop = { diff --git a/mods/ITEMS/mcl_crimson/mod.conf b/mods/ITEMS/mcl_crimson/mod.conf index 2e5550775..84dc7d8f6 100644 --- a/mods/ITEMS/mcl_crimson/mod.conf +++ b/mods/ITEMS/mcl_crimson/mod.conf @@ -1,3 +1,3 @@ name = mcl_crimson author = debiankaios -depends = mcl_stairs, mobs_mc, mcl_util, mcl_dye +depends = mcl_core, mcl_stairs, mobs_mc, mcl_util, mcl_dye diff --git a/mods/MAPGEN/mcl_biomes/init.lua b/mods/MAPGEN/mcl_biomes/init.lua index 4aa843053..38003535a 100644 --- a/mods/MAPGEN/mcl_biomes/init.lua +++ b/mods/MAPGEN/mcl_biomes/init.lua @@ -4794,7 +4794,7 @@ local function register_dimension_decorations() deco_type = "simple", place_on = {"mcl_crimson:warped_nylium","mcl_crimson:twisting_vines"}, sidelen = 16, - fill_ratio = 0.012, + fill_ratio = 0.032, biomes = {"WarpedForest"}, y_min = mcl_vars.mg_lava_nether_max + 1, flags = "all_floors", @@ -4877,6 +4877,18 @@ local function register_dimension_decorations() size = {x = 7, y = 13, z = 7}, rotation = "random", }) + minetest.register_decoration({ + deco_type = "simple", + place_on = {"mcl_crimson:warped_nylium","mcl_crimson:weeping_vines","mcl_nether:netherrack"}, + sidelen = 16, + fill_ratio = 0.063, + biomes = {"CrimsonForest"}, + y_min = mcl_vars.mg_lava_nether_max + 1, + flags = "all_ceilings", + height = 2, + height_max = 8, + decoration = "mcl_crimson:weeping_vines", + }) minetest.register_decoration({ deco_type = "simple", place_on = {"mcl_crimson:crimson_nylium"}, From f9372b02f6beb236ab73799d4b91b19d7a596cbc Mon Sep 17 00:00:00 2001 From: cora Date: Thu, 15 Sep 2022 05:02:48 +0200 Subject: [PATCH 4/5] Better bone mealing behavior --- mods/ITEMS/mcl_crimson/init.lua | 93 +++++++++--------- .../textures/mcl_crimson_weeping_vines.png | Bin 0 -> 6361 bytes 2 files changed, 45 insertions(+), 48 deletions(-) create mode 100644 mods/ITEMS/mcl_crimson/textures/mcl_crimson_weeping_vines.png diff --git a/mods/ITEMS/mcl_crimson/init.lua b/mods/ITEMS/mcl_crimson/init.lua index 4262e41bb..b0ba09d33 100644 --- a/mods/ITEMS/mcl_crimson/init.lua +++ b/mods/ITEMS/mcl_crimson/init.lua @@ -28,6 +28,38 @@ function grow_vines(pos, moreontop ,vine, dir) until n.name ~= "air" and n.name ~= vine end +local nether_plants = { + ["mcl_crimson:crimson_nylium"] = { + "mcl_crimson:crimson_roots", + "mcl_crimson:crimson_fungus", + "mcl_crimson:warped_fungus", + }, + ["mcl_crimson:warped_nylium"] = { + "mcl_crimson:warped_roots", + "mcl_crimson:warped_fungus", + "mcl_crimson:twisting_vines", + "mcl_crimson:nether_sprouts", + }, +} + +local function has_nylium_neighbor(pos) + local p = minetest.find_node_near(pos,1,{"mcl_crimson:warped_nylium","mcl_crimson:crimson_nylium"}) + if p then + return minetest.get_node(p) + end +end + +local function spread_nether_plants(pos,node) + local n = node.name + local nn = minetest.find_nodes_in_area_under_air(vector.offset(pos,-5,-3,-5),vector.offset(pos,5,3,5),{n}) + table.shuffle(nn) + nn[1] = pos + for i=1,math.random(1,math.min(#nn,12)) do + minetest.set_node(vector.offset(nn[i],0,1,0),{name=nether_plants[n][math.random(#nether_plants[n])]}) + mcl_dye.add_bone_meal_particle(vector.offset(nn[i],0,1,0)) + end +end + minetest.register_node("mcl_crimson:warped_fungus", { description = S("Warped Fungus Mushroom"), drawtype = "plantlike", @@ -483,54 +515,6 @@ minetest.register_node("mcl_crimson:crimson_nylium", { _mcl_silk_touch_drop = true, }) -local function has_nylium_neighbor(pos) - local p = minetest.find_node_near(pos,1,{"mcl_crimson:warped_nylium","mcl_crimson:crimson_nylium"}) - if p then - return minetest.get_node(p) - end -end - -local nether_plants = { - ["mcl_crimson:crimson_nylium"] = { - "mcl_crimson:crimson_roots", - "mcl_crimson:crimson_fungus", - "mcl_crimson:weeping_vines", - "mcl_crimson:warped_fungus", - }, - ["mcl_crimson:warped_nylium"] = { - "mcl_crimson:warped_roots", - "mcl_crimson:warped_fungus", - "mcl_crimson:twisting_vines", - "mcl_crimson:nether_sprouts", - }, -} - -local function spread_nylium(pos) - local nn = minetest.find_nodes_in_area_under_air(vector.offset(pos,-5,-3,-5),vector.offset(pos,5,3,5),{"mcl_nether:netherrack"}) - table.insert(nn,pos) - table.sort(nn,function(a, b) - return vector.distance(pos, a) < vector.distance(pos, b) - end) - for i=1,math.random(1,math.min(#nn,15)) do - local n = has_nylium_neighbor(nn[i]) - if n then - minetest.set_node(nn[i],n) - if math.random(5) == 1 then - minetest.set_node(vector.offset(nn[i],0,1,0),{name=nether_plants[n.name][math.random(#nether_plants[n.name])]}) - end - mcl_dye.add_bone_meal_particle(vector.offset(nn[i],0,1,0)) - end - end -end - -mcl_dye.register_on_bone_meal_apply(function(pt,user) - if not pt.type == "node" then return end - if minetest.get_node(pt.under).name ~= "mcl_nether:netherrack" then return end - if has_nylium_neighbor(pt.under) then - spread_nylium(pt.under) - end -end) - minetest.register_craft({ output = "mcl_crimson:crimson_hyphae_wood 4", recipe = { @@ -548,6 +532,19 @@ minetest.register_craft({ mcl_stairs.register_stair_and_slab_simple("crimson_hyphae_wood", "mcl_crimson:crimson_hyphae_wood", S("Crimson Stair"), S("Crimson Slab"), S("Double Crimson Slab")) +mcl_dye.register_on_bone_meal_apply(function(pt,user) + if not pt.type == "node" then return end + local node = minetest.get_node(pt.under) + if node.name == "mcl_nether:netherrack" then + local n = has_nylium_neighbor(pt.under) + if n then + minetest.set_node(pt.under,n) + end + elseif node.name == "mcl_crimson:warped_nylium" or node.name == "mcl_crimson:crimson_nylium" then + spread_nether_plants(pt.under,node) + end +end) + minetest.register_abm({ label = "mcl_crimson:crimson_fungus", nodenames = {"mcl_crimson:crimson_fungus"}, diff --git a/mods/ITEMS/mcl_crimson/textures/mcl_crimson_weeping_vines.png b/mods/ITEMS/mcl_crimson/textures/mcl_crimson_weeping_vines.png new file mode 100644 index 0000000000000000000000000000000000000000..efe1cb5538fa6550c001ff607d7dbecf07ac705f GIT binary patch literal 6361 zcmeHLdpwkB`=6X6izKAYG)a^>8s-p{!(h@Nhp0%;%sev<=3r(Rl(v;3N(x&!DV(q<|9lJlV`Qlhe}gX(=|sPw-3?)&TW`Mv+eXU5$3{k^`|b${>cy6$-#aC31~ zS6!qEgTd6PPWJB5Urp&tMG1O0eE9)@!4!`~c>0Ll0SR0nnh{l zLlDEu`}!0L4`l_`4JR)*F|(-^Mg6pg*w`5~{;W0Hlf5<6d1@+uw>E)kX#4C=XU)zV z+ue?zO$@5IIPSUbrYp5h;eJ9}@df|Lx(6s*XKmu(udZG3n?@3DH=iL45ZvmTg7^J+ z)_k;iO+r$5=#@pN-5r}>6r19Id9ZI%3dR+AayH~GwKm(Mt4zNH+> zP%wQkhow{%wQ-I3bTMDA3w+UDp}7fXqZhI=Z}(e+wyidWA-A=;@5gl}9=O=%H6M8* zIVT5i30;zUzyDq359IT53XOt`F+T=7d)VVHRb(rruD%13C;meDkGNPE z?Zk2{lOy^qL1p*EwH3CB?B;aX9R2HxTS^ud!|FwS24loUfgR(E9h&4cm4HDQEm7qh ze!ju0flJCUnObKKVeb(KXqe`>)_XpI8Kb|V$-$la>CPtH9m!oxbS#N@mCgXt-bwyH;@Ymc#x>96GlX2J65^vI=Plc1sNt3dQ2hJwN z?usb|=W{wo3W`qOR4TCGRHm{{1YX&dB4mN0m$Zl%0M)krrgDuRst z-W+~2ZBNA$l|6U6v0YZ2#sa%GY?s`!mGkVJ|50Pwq9q?yIsb%%a_9=7Zg=v%A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_7oPYP`RZ*V^K)WU038a_hEoM%RbCxla0; zeLb5HNN~Hluln20Rmww;UqAGI%6HM`5K<=jW48G{Hr=BKAHE)lxPH=aUcd6X3%$45 T_fpP5=LMruT Date: Mon, 19 Sep 2022 14:19:49 +0200 Subject: [PATCH 5/5] Fix bonemealing of large fungi --- mods/ITEMS/mcl_crimson/init.lua | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/mods/ITEMS/mcl_crimson/init.lua b/mods/ITEMS/mcl_crimson/init.lua index b0ba09d33..6f2e48a05 100644 --- a/mods/ITEMS/mcl_crimson/init.lua +++ b/mods/ITEMS/mcl_crimson/init.lua @@ -55,8 +55,11 @@ local function spread_nether_plants(pos,node) table.shuffle(nn) nn[1] = pos for i=1,math.random(1,math.min(#nn,12)) do - minetest.set_node(vector.offset(nn[i],0,1,0),{name=nether_plants[n][math.random(#nether_plants[n])]}) - mcl_dye.add_bone_meal_particle(vector.offset(nn[i],0,1,0)) + local p = vector.offset(nn[i],0,1,0) + if minetest.get_node(p).name == "air" then + minetest.set_node(p,{name=nether_plants[n][math.random(#nether_plants[n])]}) + mcl_dye.add_bone_meal_particle(vector.offset(nn[i],0,1,0)) + end end end @@ -82,6 +85,7 @@ minetest.register_node("mcl_crimson:warped_fungus", { if nodepos.name == "mcl_crimson:warped_nylium" or nodepos.name == "mcl_nether:netherrack" then local random = math.random(1, 5) if random == 1 then + minetest.remove_node(pos) generate_warped_tree(pos) end end @@ -382,6 +386,7 @@ minetest.register_node("mcl_crimson:crimson_fungus", { if nodepos.name == "mcl_crimson:crimson_nylium" or nodepos.name == "mcl_nether:netherrack" then local random = math.random(1, 5) if random == 1 then + minetest.remove_node(pos) generate_crimson_tree(pos) end end