Flowers: update Waterlily

This commit is contained in:
Maksim 2020-06-21 13:22:54 +02:00
parent 420c804995
commit 3ffec700c6
4 changed files with 43 additions and 1 deletions

View File

@ -13,7 +13,7 @@ MultiCraft Development Team
Graphics in this mod is NOT free and can be used only as part of the official MultiCraft build.
Allowed to be used in non-official builds ONLY for personal use.
Exceptions: flowers_waterlily.png, flowers_mushroom_*.png
Exceptions: flowers_mushroom_*.png
-------------------

View File

@ -466,3 +466,45 @@ minetest.register_node("flowers:waterlily", {
return itemstack
end
})
minetest.register_node("flowers:waterlily_flower", {
drawtype = "nodebox",
paramtype = "light",
paramtype2 = "facedir",
tiles = {"flowers_waterlily.png^flowers_waterlily_flower.png", "flowers_waterlily.png"},
walkable = false,
floodable = true,
groups = {snappy = 3, flammable = 1, not_in_creative_inventory = 1},
sounds = default.node_sound_leaves_defaults(),
drop = "flowers:waterlily",
node_box = {
type = "fixed",
fixed = {-0.5, -0.5, -0.5, 0.5, -15/32, 0.5}
},
selection_box = {
type = "fixed",
fixed = {-7/16, -0.5, -7/16, 7/16, -15/32, 7/16}
}
})
minetest.register_abm({
label = "Waterlily Flower",
nodenames = {
"flowers:waterlily",
"flowers:waterlily_flower"
},
interval = 20,
chance = 3,
catch_up = false,
action = function(pos, node)
local light = minetest.get_node_light(pos)
if light >= 10 and node.name == "flowers:waterlily" then
node.name = "flowers:waterlily_flower"
minetest.swap_node(pos, node)
elseif light < 10 and node.name == "flowers:waterlily_flower" then
node.name = "flowers:waterlily"
minetest.swap_node(pos, node)
end
end
})

Binary file not shown.

Before

Width:  |  Height:  |  Size: 260 B

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 461 B