From 369c2a92d8b617a8255591f04b2b0a06773ab879 Mon Sep 17 00:00:00 2001 From: MoNTE48 Date: Mon, 16 Mar 2020 18:48:33 +0100 Subject: [PATCH] Flowers: add new flowers --- files/flowers/init.lua | 63 ++++++++++++------ files/flowers/mapgen.lua | 10 ++- files/flowers/textures/flowers_houstonia.png | Bin 0 -> 217 bytes files/flowers/textures/flowers_tulip_pink.png | Bin 0 -> 260 bytes files/flowers/textures/flowers_tulip_red.png | Bin 0 -> 246 bytes .../flowers/textures/flowers_tulip_white.png | Bin 0 -> 258 bytes 6 files changed, 51 insertions(+), 22 deletions(-) create mode 100644 files/flowers/textures/flowers_houstonia.png create mode 100644 files/flowers/textures/flowers_tulip_pink.png create mode 100644 files/flowers/textures/flowers_tulip_red.png create mode 100644 files/flowers/textures/flowers_tulip_white.png diff --git a/files/flowers/init.lua b/files/flowers/init.lua index 41d1ee9..33ba37e 100644 --- a/files/flowers/init.lua +++ b/files/flowers/init.lua @@ -10,16 +10,6 @@ dofile(minetest.get_modpath("flowers") .. "/mapgen.lua") -- Flowers -- --- Aliases for original flowers mod - -minetest.register_alias("flowers:flower_rose", "flowers:rose") -minetest.register_alias("flowers:flower_tulip", "flowers:tulip") -minetest.register_alias("flowers:flower_dandelion_yellow", "flowers:dandelion_yellow") -minetest.register_alias("flowers:flower_orchid", "flowers:orchid") -minetest.register_alias("flowers:flower_allium", "flowers:allium") -minetest.register_alias("flowers:flower_dandelion_white", "flowers:oxeye_daisy") -minetest.register_alias("flowers:dandelion_white", "flowers:oxeye_daisy") - -- Flower registration local function add_simple_flower(name, desc, box, f_groups) @@ -53,37 +43,61 @@ flowers.datas = { { "rose", "Red Rose", - {-2 / 16, -0.5, -2 / 16, 2 / 16, 5 / 16, 2 / 16}, + {-1 / 8, -0.5, -1 / 8, 1 / 8, 3 / 16, 1 / 8}, {color_red = 1, flammable = 1} }, { "tulip", "Orange Tulip", - {-2 / 16, -0.5, -2 / 16, 2 / 16, 3 / 16, 2 / 16}, + {-1 / 8, -0.5, -1 / 8, 1 / 8, 5 / 16, 1 / 8}, {color_orange = 1, flammable = 1} }, + { + "tulip_pink", + "Pink Tulip", + {-1 / 8, -0.5, -1 / 8, 1 / 8, 5 / 16, 1 / 8}, + {color_pink = 1, flammable = 1} + }, + { + "tulip_red", + "Red Tulip", + {-1 / 8, -0.5, -1 / 8, 1 / 8, 5 / 16, 1 / 8}, + {color_red = 1, flammable = 1} + }, + { + "tulip_white", + "White Tulip", + {-1 / 8, -0.5, -1 / 8, 1 / 8, 5 / 16, 1 / 8}, + {color_white = 1, flammable = 1} + }, { "dandelion_yellow", "Yellow Dandelion", - {-2 / 16, -0.5, -2 / 16, 2 / 16, 4 / 16, 2 / 16}, + {-1 / 8, -0.5, -1 / 8, 1 / 8, 0, 1 / 8}, {color_yellow = 1, flammable = 1} }, + { + "houstonia", + "Houstonia", + {-1 / 5, -0.5, -1 / 5, 1 / 5, 1 / 10, 1 / 5}, + {color_white = 1, flammable = 1} + }, { "orchid", "Blue Orchid", - {-2 / 16, -0.5, -2 / 16, 2 / 16, 2 / 16, 2 / 16}, + {-1 / 4, -0.5, -1 / 4, 1 / 4, 1 / 3, 1 / 4}, {color_blue = 1, flammable = 1} }, { "allium", "Allium", - {-5 / 16, -0.5, -5 / 16, 5 / 16, -1 / 16, 5 / 16}, + {-3 / 16, -0.5, -3 / 16, 3 / 16, 6 / 16, 3 / 16}, {color_violet = 1, flammable = 1} }, { "oxeye_daisy", "White Oxeye", - {-5 / 16, -0.5, -5 / 16, 5 / 16, -2 / 16, 5 / 16}, + {-3 / 16, -0.5, -3 / 16, 3 / 16, 2 / 6, 3 / 16}, {color_white = 1, flammable = 1} } } @@ -114,7 +128,7 @@ function flowers.flower_spread(pos, node) end local light = minetest.get_node_light(pos) - if not light or light < 13 then + if not light or light < 12 then return end @@ -138,12 +152,19 @@ function flowers.flower_spread(pos, node) local soil_name = minetest.get_node(soil).name local soil_above = {x = soil.x, y = soil.y + 1, z = soil.z} light = minetest.get_node_light(soil_above) - if light and light >= 13 and + if light and light >= 12 and -- Only spread to same surface node soil_name == under.name and -- Desert sand is in the soil group - soil_name ~= "default:desert_sand" then - minetest.set_node(soil_above, {name = node.name}) + soil_name ~= "default:redsand" then + -- Spread also other flowers. + local flower = node.name + if math.random(3) == 1 then + local fdata = flowers.datas + flower = "flowers:" .. fdata[math.random(#fdata)][1] + end + + minetest.set_node(soil_above, {name = flower}) end end end @@ -195,7 +216,7 @@ minetest.register_node("flowers:mushroom_brown", { buildable_to = true, groups = {food_mushroom = 1, snappy = 3, attached_node = 1, flammable = 1, food = 1, flora = 1}, sounds = default.node_sound_leaves_defaults(), - on_use = minetest.item_eat(1), + on_use = minetest.item_eat(3), selection_box = { type = "fixed", fixed = {-0.3, -0.5, -0.3, 0.3, 0, 0.3} diff --git a/files/flowers/mapgen.lua b/files/flowers/mapgen.lua index 00922ed..1916821 100644 --- a/files/flowers/mapgen.lua +++ b/files/flowers/mapgen.lua @@ -67,7 +67,11 @@ end function flowers.register_mgv6_decorations() register_mgv6_flower("rose") register_mgv6_flower("tulip") + register_mgv6_flower("tulip_pink") + register_mgv6_flower("tulip_red") + register_mgv6_flower("tulip_white") register_mgv6_flower("dandelion_yellow") + register_mgv6_flower("houstonia") register_mgv6_flower("orchid") register_mgv6_flower("allium") register_mgv6_flower("oxeye_daisy") @@ -149,7 +153,11 @@ end function flowers.register_decorations() register_flower(436, "rose") register_flower(19822, "tulip") - register_flower(1220999, "dandelion_yellow") + register_flower(24539, "tulip_pink") + register_flower(37519, "tulip_red") + register_flower(40573, "tulip_white") + register_flower(122099, "dandelion_yellow") + register_flower(107982, "houstonia") register_flower(36662, "orchid") register_flower(1133, "allium") register_flower(73133, "oxeye_daisy") diff --git a/files/flowers/textures/flowers_houstonia.png b/files/flowers/textures/flowers_houstonia.png new file mode 100644 index 0000000000000000000000000000000000000000..d36d98786a528fa6bd432e674c26377f01cebfef GIT binary patch literal 217 zcmeAS@N?(olHy`uVBq!ia0vp^3LwnE3?yBabR7dyq5(c3uK)l4zj5!`lUJWUeVP+G z*~qg+!@gX;@D-K*u;E#p5&%d$btYpSC6GSZhm@(X5gcy=QV z$Z7I)aSW+oOqK{Zz|kUbfMqEwOF*arC)YwQ18ptg3x^Ui8q^N-$~fjg%sGrQ!PpwUa$)kFn`;}_QgYPL-=zRruI@cWr>u? zf_*<4ir6HTyBSLK17#SCj$IB+@^fdp&QP<+yN*?V*+ZuCHR}2{K!-4Ry85}Sb4q9e E0M*}LB>(^b literal 0 HcmV?d00001