From 0cf4fd4c1800030a3555305c73fc2269c5b79a3d Mon Sep 17 00:00:00 2001 From: "jeanpatrick.guerrero@gmail.com" Date: Sun, 12 Jul 2015 12:47:04 +0200 Subject: [PATCH] Add mushrooms --- mods/flowers/README.txt | 3 ++ mods/flowers/init.lua | 27 ++++++++++++++++++ .../textures/flowers_mushroom_brown.png | Bin 0 -> 155 bytes .../flowers/textures/flowers_mushroom_red.png | Bin 0 -> 167 bytes 4 files changed, 30 insertions(+) create mode 100644 mods/flowers/textures/flowers_mushroom_brown.png create mode 100644 mods/flowers/textures/flowers_mushroom_red.png diff --git a/mods/flowers/README.txt b/mods/flowers/README.txt index 04f96d99..df3c5f41 100644 --- a/mods/flowers/README.txt +++ b/mods/flowers/README.txt @@ -14,3 +14,6 @@ http://sam.zoy.org/wtfpl/COPYING for more details. License of media (textures and sounds) -------------------------------------- WTFPL + +Gambit (WTFPL): + flowers_mushroom_*.png diff --git a/mods/flowers/init.lua b/mods/flowers/init.lua index 672f8b56..2a3e064a 100644 --- a/mods/flowers/init.lua +++ b/mods/flowers/init.lua @@ -57,6 +57,33 @@ for _,item in pairs(flowers.datas) do add_simple_flower(unpack(item)) end +local mushrooms_datas = { + {"brown", 2}, {"red", -6} +} + +for _, m in pairs(mushrooms_datas) do + local name, nut = m[1], m[2] + minetest.register_node("flowers:mushroom_"..name, { + description = string.sub(string.upper(name), 0, 1).. + string.sub(name, 2).." Mushroom", + tiles = {"flowers_mushroom_"..name..".png"}, + inventory_image = "flowers_mushroom_"..name..".png", + wield_image = "flowers_mushroom_"..name..".png", + drawtype = "plantlike", + paramtype = "light", + sunlight_propagates = true, + walkable = false, + buildable_to = true, + groups = {snappy=3,flammable=3,attached_node=1,not_in_creative_inventory=1}, + sounds = default.node_sound_leaves_defaults(), + on_use = minetest.item_eat(nut), + selection_box = { + type = "fixed", + fixed = {-0.3, -0.5, -0.3, 0.3, 0, 0.3} + } + }) +end + minetest.register_abm({ nodenames = {"group:flora"}, neighbors = {"default:dirt_with_grass", "default:desert_sand"}, diff --git a/mods/flowers/textures/flowers_mushroom_brown.png b/mods/flowers/textures/flowers_mushroom_brown.png new file mode 100644 index 0000000000000000000000000000000000000000..33ffcd474e0d5228f7c6dc843b5d5feee44f6757 GIT binary patch literal 155 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!73?$#)eFPFv4DbnY1=0ylR>9^5rO_cV_T~j) z0XYF4hqi5AIdj^AzK-tlLawm0AjOO&L4Lsu4$p3+0XZ6;E{-7_*OM2hCYYL;G8mt6 wVVQi8$KBE0-N2cXL!rw;%pr8MKZ6iMZVdDH!i{b3fqED`UHx3vIVCg!05N7O^#A|> literal 0 HcmV?d00001 diff --git a/mods/flowers/textures/flowers_mushroom_red.png b/mods/flowers/textures/flowers_mushroom_red.png new file mode 100644 index 0000000000000000000000000000000000000000..a68f5d50ad3f85a7dab7d3bc4ffd80452d536a9e GIT binary patch literal 167 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!73?$#)eFPFv3GfMV1=0r{93}|}d?+Y*wQt`l z4UJ#t&K=se`PSOCD`!qy(AUvjUg*z!vI(e;u_VYZn8D%MjWi&~(9^{+gyVYh0#*a# zwhPCani9mi7cA&lz&zogh?0iJDh8pTprEWKjYoGFt{&aT;K9I9+rm<`{NknGK+O!E Lu6{1-oD!M