From 2f9656f3591bcf8acddc269828ba0a56947c895b Mon Sep 17 00:00:00 2001 From: LeMagnesium Date: Thu, 2 Apr 2015 16:47:18 +0200 Subject: [PATCH] Updated plantlife : added sunflowers - Added sunflowers' models and textures --- mods/plantlife_modpack/LICENSE | 1 + .../bushes_classic/nodes.lua | 2 + mods/plantlife_modpack/flowers_plus/init.lua | 62 +++++++++++++++ .../flowers_plus/models/flowers_sunflower.obj | 73 ++++++++++++++++++ .../textures/flowers_sunflower.png | Bin 0 -> 811 bytes .../textures/flowers_sunflower_inv.png | Bin 0 -> 378 bytes mods/plantlife_modpack/mushroom/init.lua | 19 +++-- mods/plantlife_modpack/vines/recipes.lua | 1 + 8 files changed, 148 insertions(+), 10 deletions(-) create mode 100644 mods/plantlife_modpack/flowers_plus/models/flowers_sunflower.obj create mode 100644 mods/plantlife_modpack/flowers_plus/textures/flowers_sunflower.png create mode 100644 mods/plantlife_modpack/flowers_plus/textures/flowers_sunflower_inv.png diff --git a/mods/plantlife_modpack/LICENSE b/mods/plantlife_modpack/LICENSE index c578745a..594ea2ab 100755 --- a/mods/plantlife_modpack/LICENSE +++ b/mods/plantlife_modpack/LICENSE @@ -1,3 +1,4 @@ +Sunflower model and textures by kaeza (CC-BY-SA 3.0). For the code, Ironzorg's textures, and everything else: WTFPL diff --git a/mods/plantlife_modpack/bushes_classic/nodes.lua b/mods/plantlife_modpack/bushes_classic/nodes.lua index d6872fa7..0a0446ff 100755 --- a/mods/plantlife_modpack/bushes_classic/nodes.lua +++ b/mods/plantlife_modpack/bushes_classic/nodes.lua @@ -157,6 +157,7 @@ for i, bush_name in ipairs(bushes_classic.bushes) do "bushes_basket.png" }, paramtype = "light", + paramtype2 = "facedir", on_use = minetest.item_eat(18), groups = { dig_immediate = 3 }, }) @@ -206,6 +207,7 @@ minetest.register_node(":bushes:basket_empty", { mesh = "bushes_basket_empty.obj", tiles = { "bushes_basket.png" }, paramtype = "light", + paramtype2 = "facedir", groups = { dig_immediate = 3 }, }) diff --git a/mods/plantlife_modpack/flowers_plus/init.lua b/mods/plantlife_modpack/flowers_plus/init.lua index 788ba2d9..51edc223 100755 --- a/mods/plantlife_modpack/flowers_plus/init.lua +++ b/mods/plantlife_modpack/flowers_plus/init.lua @@ -12,6 +12,8 @@ local lilies_max_count = 320 local lilies_rarity = 33 local seaweed_max_count = 320 local seaweed_rarity = 33 +local sunflowers_max_count = 10 +local sunflowers_rarity = 25 -- register the various rotations of waterlilies @@ -267,6 +269,36 @@ for i in ipairs(flowers_list) do minetest.register_alias("flowers:flower_"..flower.."_pot", "flowers:potted_"..flower) end +local box = { + type="fixed", + fixed = { { -0.2, -0.5, -0.2, 0.2, 0.5, 0.2 } }, +} + +minetest.register_node(":flowers:sunflower", { + description = "Sunflower", + drawtype = "mesh", + paramtype = "light", + paramtype2 = "facedir", + inventory_image = "flowers_sunflower_inv.png", + mesh = "flowers_sunflower.obj", + tiles = { "flowers_sunflower.png" }, + walkable = false, + buildable_to = true, + is_ground_content = true, + groups = { dig_immediate=3, flora=1, flammable=3 }, + sounds = default.node_sound_leaves_defaults(), + selection_box = box, + collision_box = box, +}) + +minetest.override_item("flowers:sunflower", {drop = { + max_items = 1, + items = { + {items = {"farming:seed_wheat"}, rarity = 8}, + {items = {"flowers:sunflower"}}, + } +}}) + local extra_aliases = { "waterlily", "waterlily_225", @@ -381,6 +413,20 @@ plantslib:register_generate_plant({ }, flowers_plus.grow_seaweed ) + +plantslib:register_generate_plant({ + surface = {"default:dirt_with_grass"}, + avoid_nodes = { "flowers:sunflower" }, + max_count = sunflowers_max_count, + rarity = sunflowers_rarity, + min_elevation = 0, + plantlife_limit = -0.9, + temp_max = 0.53, + random_facedir = {0,3}, + }, + "flowers:sunflower" +) + -- spawn ABM registrations plantslib:spawn_on_surfaces({ @@ -446,6 +492,21 @@ plantslib:spawn_on_surfaces({ facedir = 1 }) +plantslib:spawn_on_surfaces({ + spawn_delay = SPAWN_DELAY*2, + spawn_plants = {"flowers:sunflower"}, + spawn_chance = SPAWN_CHANCE*2, + spawn_surfaces = {"default:dirt_with_grass"}, + avoid_nodes = {"group:flower"}, + seed_diff = flowers_seed_diff, + light_min = 11, + light_max = 14, + min_elevation = 0, + plantlife_limit = -0.9, + temp_max = 0.53, + random_facedir = {0,3} +}) + -- crafting recipes! minetest.register_craftitem(":flowers:flower_pot", { @@ -472,5 +533,6 @@ minetest.register_alias("flowers:flower_cotton_pot", "flowers:potted_dandelion_w minetest.register_alias("flowers:potted_cotton_plant", "flowers:potted_dandelion_white") minetest.register_alias("flowers:cotton", "farming:string") minetest.register_alias("flowers:cotton_wad", "farming:string") +minetest.register_alias("sunflower:sunflower", "flowers:sunflower") print(S("[Flowers] Loaded.")) diff --git a/mods/plantlife_modpack/flowers_plus/models/flowers_sunflower.obj b/mods/plantlife_modpack/flowers_plus/models/flowers_sunflower.obj new file mode 100644 index 00000000..35beb8db --- /dev/null +++ b/mods/plantlife_modpack/flowers_plus/models/flowers_sunflower.obj @@ -0,0 +1,73 @@ +# Blender v2.70 (sub 0) OBJ File: 'sunflower.blend' +# www.blender.org +mtllib sunflower_sunflower.mtl +o Cube +v -0.015625 -0.500000 0.028125 +v -0.015625 -0.500000 -0.028125 +v 0.028125 -0.500000 -0.028125 +v 0.028125 -0.500000 0.028125 +v -0.015625 0.790890 0.028125 +v -0.015625 0.689140 -0.028125 +v 0.028125 0.689140 -0.028125 +v 0.028125 0.790890 0.028125 +v 0.250000 0.533494 -0.125000 +v -0.250000 0.533494 -0.125000 +v 0.250000 0.966506 0.125000 +v -0.250000 0.966506 0.125000 +v 0.267063 0.373606 -0.088749 +v 0.044375 0.303464 -0.141576 +v 0.239202 0.473737 0.108253 +v -0.008452 0.378817 0.108253 +v 0.017721 0.016639 -0.112053 +v -0.231280 0.110242 -0.115181 +v -0.030356 -0.036246 0.146223 +v -0.252831 0.028885 0.088910 +v 0.062500 0.641747 -0.057917 +v -0.106953 0.097386 -0.113617 +v -0.006318 -0.053008 0.024707 +v 0.118968 0.360674 0.006909 +v 0.116101 0.452031 0.108253 +v 0.017962 0.298392 -0.019504 +v 0.145794 0.358736 -0.115163 +v 0.240237 0.375544 0.033323 +v -0.224509 0.021356 -0.032606 +v -0.131273 0.023638 0.117567 +v -0.102951 0.016109 -0.003950 +vt 0.750000 0.875000 +vt 0.625000 0.875000 +vt 0.625000 0.750000 +vt 0.750000 0.750000 +vt 0.750000 1.000000 +vt 0.625000 1.000000 +vt 0.625000 0.500000 +vt 0.500000 0.500000 +vt 0.500000 1.000000 +vt 0.000100 0.500100 +vt 0.499900 0.500100 +vt 0.499900 0.999900 +vt 0.000100 0.999900 +vt 0.250000 0.250000 +vt 0.500000 0.250000 +vt 0.250000 0.500000 +vt 0.000000 0.250000 +vt 0.000000 0.000000 +vt 0.250000 0.000000 +vt 0.000000 0.500000 +vt 0.500000 0.000000 +usemtl Sunflower +s off +f 1/1 2/2 3/3 4/4 +f 5/5 8/6 7/2 6/1 +f 1/7 5/8 6/9 2/6 +f 2/7 6/6 7/9 3/8 +f 3/7 7/8 8/9 4/6 +f 5/7 1/8 4/9 8/6 +f 9/10 10/11 12/12 11/13 +f 24/14 26/15 16/8 25/16 +f 31/14 29/17 20/18 30/19 +f 17/8 22/16 31/14 23/15 +f 22/16 18/20 29/17 31/14 +f 27/19 14/21 26/15 24/14 +f 13/18 27/19 24/14 28/17 +f 23/15 31/14 30/19 19/21 +f 28/17 24/14 25/16 15/20 diff --git a/mods/plantlife_modpack/flowers_plus/textures/flowers_sunflower.png b/mods/plantlife_modpack/flowers_plus/textures/flowers_sunflower.png new file mode 100644 index 0000000000000000000000000000000000000000..fb95cb4b524d8367c86ded7f18462aab14a21468 GIT binary patch literal 811 zcmV+`1JwM9P)4^V&zube$mt9;)Gzt1w%gQ^p~<;umORcp8t)#2XK#q z$WNkr?mg)JTuwhLRUqUcJF>I@W0$y4F6%1ryzwgV9(2?q(s6XjHX2}WZ(&)W)Z*4V z3DXC}g>qS6rVm`}eGw<)MngLw{o`+8I$^1VmCw&6bKSuDVlj9g@SBb91uF>vozQ;R*B`a4w1i~F2(lJBK~d6Et!LCd@RGi zSMHZ8v6Tb}c`~J&%UwN4uyqQVI!K5!`!)b?l0lx{{^%Jo>k=_m1qa!002ovPDHLkV1h+5c{l(7 literal 0 HcmV?d00001 diff --git a/mods/plantlife_modpack/flowers_plus/textures/flowers_sunflower_inv.png b/mods/plantlife_modpack/flowers_plus/textures/flowers_sunflower_inv.png new file mode 100644 index 0000000000000000000000000000000000000000..c36ed010334b16ee329287d8e42cabd7cabca4ba GIT binary patch literal 378 zcmV-=0fqjFP)=&c+84nXI|xJ$zUppN9)UeZU3lxkB9 z%PtAF(qyI8%-fyWdGoXIUn`E$NrE;yfWd!q)Ecdn=uKnK%wv;l%F*a$X?2&0=SH5* zL|-mtXPJFG%Ph`wSgoL{@a|0HJcq6mqs2mGat~nu?YYMZ9FJmWf{p0AH1!spKckye zq~6N;aNpPC*3jQc1!SlJ;7KKxTECZ#)pglu-lE{%SlGC`LNdjHhcO#A^r%{eqYEYKrRt`lpmu7I9 zR2-XhJWxv6fTKCs?_s_E-FJiQS~f^4tIE#Nz~U!OrKTfuX}R^7a=iK%Tqfo*gD*LL Y1NOTWIN$ya)&Kwi07*qoM6N<$f}ydlk^lez literal 0 HcmV?d00001 diff --git a/mods/plantlife_modpack/mushroom/init.lua b/mods/plantlife_modpack/mushroom/init.lua index 71e3ecbe..8c5b9eea 100755 --- a/mods/plantlife_modpack/mushroom/init.lua +++ b/mods/plantlife_modpack/mushroom/init.lua @@ -39,7 +39,7 @@ minetest.register_node("mushroom:red",{ type = "fixed", fixed = {-0.3, -0.5, -0.3, 0.3, 0, 0.3} }, - drop = "mushroom:red", + drop = "mushroom:red", }) minetest.register_node("mushroom:spore_brown",{ @@ -107,7 +107,7 @@ minetest.register_node("mushroom:red_natural",{ type = "fixed", fixed = {-0.3, -0.5, -0.3, 0.3, 0, 0.3} }, - drop = "mushroom:red", + drop = "mushroom:red", }) -- Spore Growing ABMs @@ -121,7 +121,7 @@ minetest.register_abm({ local soil = minetest.get_node({x=pos.x,y=pos.y-1,z=pos.z}) if (soil.name == "farming:soil_wet" or string.find(soil.name, "homedecor:flower_pot_")) and minetest.get_node_light(pos, nil) < 8 then - minetest.add_node({x=pos.x,y=pos.y,z=pos.z}, {name="mushroom:brown"}) + minetest.set_node({x=pos.x,y=pos.y,z=pos.z}, {name="mushroom:brown"}) end end }) @@ -135,7 +135,7 @@ minetest.register_abm({ local soil = minetest.get_node({x=pos.x,y=pos.y-1,z=pos.z}) if (soil.name == "farming:soil_wet" or string.find(soil.name, "homedecor:flower_pot_")) and minetest.get_node_light(pos, nil) < 8 then - minetest.add_node({x=pos.x,y=pos.y,z=pos.z}, {name="mushroom:red"}) + minetest.set_node({x=pos.x,y=pos.y,z=pos.z}, {name="mushroom:red"}) end end }) @@ -179,9 +179,9 @@ minetest.register_abm({ and minetest.find_node_near(pos, 1, trees_list) and minetest.find_node_near(pos, 3, "default:water_source") then if math.random(0, 1) == 0 then - minetest.add_node(top_pos, {name="mushroom:brown_natural"}) + minetest.set_node(top_pos, {name="mushroom:brown_natural"}) else - minetest.add_node(top_pos, {name="mushroom:red_natural"}) + minetest.set_node(top_pos, {name="mushroom:red_natural"}) end end end @@ -197,9 +197,9 @@ minetest.register_abm({ if minetest.get_node(top_pos).name == "air" and minetest.get_node_light(top_pos, nil) < 8 and minetest.find_node_near(pos, 1, {"default:water_source"}) then if math.random(0,1) == 0 then - minetest.add_node(top_pos, {name="mushroom:brown_natural"}) + minetest.set_node(top_pos, {name="mushroom:brown_natural"}) else - minetest.add_node(top_pos, {name="mushroom:red_natural"}) + minetest.set_node(top_pos, {name="mushroom:red_natural"}) end end end @@ -230,7 +230,7 @@ minetest.register_abm({ or newsoil.name == "default:dirt" or string.match(newsoil.name, woodsoil_str)) and minetest.find_node_near(newpos, 3, "default:water_source") then - minetest.add_node(newpos, {name=node.name}) + minetest.set_node(newpos, {name=node.name}) end end end @@ -259,4 +259,3 @@ dofile(minetest.get_modpath("mushroom").."/crafting.lua") dofile(minetest.get_modpath("mushroom").."/compat.lua") print("[Mushrooms] loaded.") - diff --git a/mods/plantlife_modpack/vines/recipes.lua b/mods/plantlife_modpack/vines/recipes.lua index 16c53113..900ec07a 100755 --- a/mods/plantlife_modpack/vines/recipes.lua +++ b/mods/plantlife_modpack/vines/recipes.lua @@ -8,5 +8,6 @@ vines.recipes['shears'] = { {'', 'default:steel_ingot', ''}, {'group:stick', 'group:wood', 'default:steel_ingot'}, {'', '', 'group:stick'} + -- MODIFICATION MADE FOR MFF ^ (Mg|2/4/15) }