Add mushrooms
authorjeanpatrick.guerrero@gmail.com <jeanpatrick.guerrero@gmail.com>
Sun, 12 Jul 2015 10:47:04 +0000 (12:47 +0200)
committerNovatux <nathanael.courant@laposte.net>
Fri, 17 Jul 2015 08:12:00 +0000 (10:12 +0200)
mods/flowers/README.txt
mods/flowers/init.lua
mods/flowers/textures/flowers_mushroom_brown.png [new file with mode: 0644]
mods/flowers/textures/flowers_mushroom_red.png [new file with mode: 0644]

index 04f96d9918ff8349567e022546a6947866df6242..df3c5f41e1349ff89fa4f4d440c56e2d80b3f280 100644 (file)
@@ -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
index 672f8b56caa3bfa8842c2d2720d90f756f8ca05b..2a3e064ab44de1e897b17bf19a73006412b726ae 100644 (file)
@@ -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 (file)
index 0000000..33ffcd4
Binary files /dev/null and b/mods/flowers/textures/flowers_mushroom_brown.png differ
diff --git a/mods/flowers/textures/flowers_mushroom_red.png b/mods/flowers/textures/flowers_mushroom_red.png
new file mode 100644 (file)
index 0000000..a68f5d5
Binary files /dev/null and b/mods/flowers/textures/flowers_mushroom_red.png differ