Changed flowers seed to 326, Renamed all flowers nodes, added
backward-compat aliases, in preparation for a subset of these flowers being added to "common".
245
flowers/init.lua
|
@ -1,75 +1,42 @@
|
|||
-- This file supplies flowers for the plantlife modpack
|
||||
-- Last revision: 2013-01-24
|
||||
-- This file supplies a few additional flowers and some related crafts
|
||||
-- for the plantlife modpack. Last revision: 2013-04-24
|
||||
|
||||
local SPAWN_DELAY = 1000
|
||||
local SPAWN_CHANCE = 200
|
||||
local flowers_seed_diff = 349
|
||||
local flowers_seed_diff = 329
|
||||
|
||||
local flowers_list = {
|
||||
{ "Rose", "rose"},
|
||||
{ "Tulip", "tulip"},
|
||||
{ "Yellow Dandelion", "dandelion_yellow"},
|
||||
{ "White Dandelion", "dandelion_white"},
|
||||
{ "Blue Geranium", "geranium"},
|
||||
{ "Viola", "viola"},
|
||||
{ "Cotton Plant", "cotton"},
|
||||
}
|
||||
-- register cotton plant
|
||||
|
||||
for i in ipairs(flowers_list) do
|
||||
local flowerdesc = flowers_list[i][1]
|
||||
local flower = flowers_list[i][2]
|
||||
minetest.register_node("flowers:cotton_plant", {
|
||||
description = flowerdesc,
|
||||
drawtype = "plantlike",
|
||||
tiles = { "flowers_cotton_plant.png" },
|
||||
inventory_image = "flowers_cotton_plant.png",
|
||||
wield_image = "flowers_cotton_plant.png",
|
||||
sunlight_propagates = true,
|
||||
paramtype = "light",
|
||||
walkable = false,
|
||||
buildable_to = true,
|
||||
groups = { snappy = 3,flammable=2, flower=1, attached_node=1 },
|
||||
sounds = default.node_sound_leaves_defaults(),
|
||||
selection_box = {
|
||||
type = "fixed",
|
||||
fixed = { -0.15, -0.5, -0.15, 0.15, 0.2, 0.15 },
|
||||
},
|
||||
buildable_to = true,
|
||||
})
|
||||
|
||||
minetest.register_node("flowers:flower_"..flower, {
|
||||
description = flowerdesc,
|
||||
drawtype = "plantlike",
|
||||
tiles = { "flower_"..flower..".png" },
|
||||
inventory_image = "flower_"..flower..".png",
|
||||
wield_image = "flower_"..flower..".png",
|
||||
sunlight_propagates = true,
|
||||
paramtype = "light",
|
||||
walkable = false,
|
||||
groups = { snappy = 3,flammable=2, flower=1, attached_node=1 },
|
||||
sounds = default.node_sound_leaves_defaults(),
|
||||
selection_box = {
|
||||
type = "fixed",
|
||||
fixed = { -0.15, -0.5, -0.15, 0.15, 0.2, 0.15 },
|
||||
},
|
||||
buildable_to = true,
|
||||
})
|
||||
minetest.register_alias("flowers:flower_cotton", "flowers:cotton_plant")
|
||||
minetest.register_alias("flowers:flower_cotton_pot", "flowers:potted_cotton_plant")
|
||||
|
||||
minetest.register_node("flowers:flower_"..flower.."_pot", {
|
||||
description = flowerdesc.." in a pot",
|
||||
drawtype = "plantlike",
|
||||
tiles = { "flower_"..flower.."_pot.png" },
|
||||
inventory_image = "flower_"..flower.."_pot.png",
|
||||
wield_image = "flower_"..flower.."_pot.png",
|
||||
sunlight_propagates = true,
|
||||
paramtype = "light",
|
||||
walkable = false,
|
||||
groups = { snappy = 3,flammable=2 },
|
||||
sounds = default.node_sound_leaves_defaults(),
|
||||
selection_box = {
|
||||
type = "fixed",
|
||||
fixed = { -0.25, -0.5, -0.25, 0.25, 0.5, 0.25 },
|
||||
},
|
||||
})
|
||||
-- register the various rotations of waterlilies
|
||||
|
||||
minetest.register_craft( {
|
||||
type = "shapeless",
|
||||
output = "flowers:flower_"..flower.."_pot",
|
||||
recipe = {
|
||||
"flowers:flower_pot",
|
||||
"flowers:flower_"..flower
|
||||
}
|
||||
})
|
||||
end
|
||||
|
||||
minetest.register_node("flowers:flower_waterlily", {
|
||||
minetest.register_node("flowers:waterlily", {
|
||||
description = "Waterlily",
|
||||
drawtype = "nodebox",
|
||||
tiles = { "flower_waterlily.png" },
|
||||
inventory_image = "flower_waterlily.png",
|
||||
wield_image = "flower_waterlily.png",
|
||||
tiles = { "flowers_waterlily.png" },
|
||||
inventory_image = "flowers_waterlily.png",
|
||||
wield_image = "flowers_waterlily.png",
|
||||
sunlight_propagates = true,
|
||||
paramtype = "light",
|
||||
paramtype2 = "facedir",
|
||||
|
@ -87,12 +54,10 @@ minetest.register_node("flowers:flower_waterlily", {
|
|||
buildable_to = true,
|
||||
})
|
||||
|
||||
minetest.register_node("flowers:flower_waterlily_225", {
|
||||
minetest.register_node("flowers:waterlily_225", {
|
||||
description = "Waterlily",
|
||||
drawtype = "nodebox",
|
||||
tiles = { "flower_waterlily_22.5.png" },
|
||||
inventory_image = "flower_waterlily.png",
|
||||
wield_image = "flower_waterlily.png",
|
||||
tiles = { "flowers_waterlily_22.5.png" },
|
||||
sunlight_propagates = true,
|
||||
paramtype = "light",
|
||||
paramtype2 = "facedir",
|
||||
|
@ -107,16 +72,14 @@ minetest.register_node("flowers:flower_waterlily_225", {
|
|||
type = "fixed",
|
||||
fixed = { -0.5, -0.49, -0.5, 0.5, -0.49, 0.5 },
|
||||
},
|
||||
drop = "flowers:flower_waterlily",
|
||||
drop = "flowers:waterlily",
|
||||
buildable_to = true,
|
||||
})
|
||||
|
||||
minetest.register_node("flowers:flower_waterlily_45", {
|
||||
minetest.register_node("flowers:waterlily_45", {
|
||||
description = "Waterlily",
|
||||
drawtype = "raillike",
|
||||
tiles = { "flower_waterlily_45.png" },
|
||||
inventory_image = "flower_waterlily.png",
|
||||
wield_image = "flower_waterlily.png",
|
||||
tiles = { "flowers_waterlily_45.png" },
|
||||
sunlight_propagates = true,
|
||||
paramtype = "light",
|
||||
paramtype2 = "facedir",
|
||||
|
@ -131,16 +94,14 @@ minetest.register_node("flowers:flower_waterlily_45", {
|
|||
type = "fixed",
|
||||
fixed = { -0.5, -0.49, -0.5, 0.5, -0.49, 0.5 },
|
||||
},
|
||||
drop = "flowers:flower_waterlily",
|
||||
drop = "flowers:waterlily",
|
||||
buildable_to = true,
|
||||
})
|
||||
|
||||
minetest.register_node("flowers:flower_waterlily_675", {
|
||||
minetest.register_node("flowers:waterlily_675", {
|
||||
description = "Waterlily",
|
||||
drawtype = "nodebox",
|
||||
tiles = { "flower_waterlily_67.5.png" },
|
||||
inventory_image = "flower_waterlily.png",
|
||||
wield_image = "flower_waterlily.png",
|
||||
tiles = { "flowers_waterlily_67.5.png" },
|
||||
sunlight_propagates = true,
|
||||
paramtype = "light",
|
||||
paramtype2 = "facedir",
|
||||
|
@ -155,16 +116,16 @@ minetest.register_node("flowers:flower_waterlily_675", {
|
|||
type = "fixed",
|
||||
fixed = { -0.5, -0.49, -0.5, 0.5, -0.49, 0.5 },
|
||||
},
|
||||
drop = "flowers:flower_waterlily",
|
||||
drop = "flowers:waterlily",
|
||||
buildable_to = true,
|
||||
})
|
||||
|
||||
minetest.register_node("flowers:flower_seaweed", {
|
||||
minetest.register_node("flowers:seaweed", {
|
||||
description = "Seaweed",
|
||||
drawtype = "signlike",
|
||||
tiles = { "flower_seaweed.png" },
|
||||
inventory_image = "flower_seaweed.png",
|
||||
wield_image = "flower_seaweed.png",
|
||||
tiles = { "flowers_seaweed.png" },
|
||||
inventory_image = "flowers_seaweed.png",
|
||||
wield_image = "flowers_seaweed.png",
|
||||
sunlight_propagates = true,
|
||||
paramtype = "light",
|
||||
paramtype2 = "wallmounted",
|
||||
|
@ -178,15 +139,93 @@ minetest.register_node("flowers:flower_seaweed", {
|
|||
buildable_to = true,
|
||||
})
|
||||
|
||||
-- register all potted plant nodes, crafts, and most backward-compat aliases
|
||||
|
||||
local flowers_list = {
|
||||
{ "Rose", "rose"},
|
||||
{ "Tulip", "tulip"},
|
||||
{ "Yellow Dandelion", "dandelion_yellow"},
|
||||
{ "White Dandelion", "dandelion_white"},
|
||||
{ "Blue Geranium", "geranium"},
|
||||
{ "Viola", "viola"},
|
||||
{ "Cotton Plant", "cotton_plant"},
|
||||
}
|
||||
|
||||
for i in ipairs(flowers_list) do
|
||||
local flowerdesc = flowers_list[i][1]
|
||||
local flower = flowers_list[i][2]
|
||||
|
||||
minetest.register_node("flowers:potted_"..flower, {
|
||||
description = "Potted "..flowerdesc,
|
||||
drawtype = "plantlike",
|
||||
tiles = { "flowers_potted_"..flower..".png" },
|
||||
inventory_image = "flowers_potted_"..flower..".png",
|
||||
wield_image = "flowers_potted_"..flower..".png",
|
||||
sunlight_propagates = true,
|
||||
paramtype = "light",
|
||||
walkable = false,
|
||||
groups = { snappy = 3,flammable=2 },
|
||||
sounds = default.node_sound_leaves_defaults(),
|
||||
selection_box = {
|
||||
type = "fixed",
|
||||
fixed = { -0.25, -0.5, -0.25, 0.25, 0.5, 0.25 },
|
||||
},
|
||||
})
|
||||
|
||||
minetest.register_craft( {
|
||||
type = "shapeless",
|
||||
output = "flowers:potted_"..flower,
|
||||
recipe = {
|
||||
"flowers:flower_pot",
|
||||
"flowers:flower_"..flower
|
||||
}
|
||||
})
|
||||
|
||||
minetest.register_alias("flowers:flower_"..flower.."_pot", "flowers:potted_"..flower)
|
||||
|
||||
minetest.register_node("flowers:"..flower, {
|
||||
description = "Potted "..flowerdesc,
|
||||
drawtype = "plantlike",
|
||||
tiles = { "flowers_"..flower..".png" },
|
||||
inventory_image = "flowers_"..flower..".png",
|
||||
wield_image = "flowers_"..flower..".png",
|
||||
sunlight_propagates = true,
|
||||
paramtype = "light",
|
||||
walkable = false,
|
||||
groups = { snappy = 3,flammable=2 },
|
||||
sounds = default.node_sound_leaves_defaults(),
|
||||
selection_box = {
|
||||
type = "fixed",
|
||||
fixed = { -0.25, -0.5, -0.25, 0.25, 0.5, 0.25 },
|
||||
},
|
||||
})
|
||||
|
||||
minetest.register_alias("flowers:flower_"..flower, "flowers:"..flower)
|
||||
|
||||
end
|
||||
|
||||
local extra_aliases = {
|
||||
"waterlily",
|
||||
"waterlily_225",
|
||||
"waterlily_45",
|
||||
"waterlily_675",
|
||||
"seaweed"
|
||||
}
|
||||
|
||||
for i in ipairs(extra_aliases) do
|
||||
flower = extra_aliases[i]
|
||||
minetest.register_alias("flowers:flower_"..flower, "flowers:"..flower)
|
||||
end
|
||||
|
||||
-- spawn ABM registrations
|
||||
|
||||
plantslib:spawn_on_surfaces({
|
||||
spawn_delay = SPAWN_DELAY,
|
||||
spawn_plants = {
|
||||
"flowers:flower_rose",
|
||||
"flowers:flower_tulip",
|
||||
"flowers:flower_geranium",
|
||||
"flowers:flower_viola",
|
||||
"flowers:rose",
|
||||
"flowers:tulip",
|
||||
"flowers:geranium",
|
||||
"flowers:viola",
|
||||
},
|
||||
avoid_radius = 10,
|
||||
spawn_chance = SPAWN_CHANCE*2,
|
||||
|
@ -199,9 +238,9 @@ plantslib:spawn_on_surfaces({
|
|||
plantslib:spawn_on_surfaces({
|
||||
spawn_delay = SPAWN_DELAY,
|
||||
spawn_plants = {
|
||||
"flowers:flower_dandelion_yellow",
|
||||
"flowers:flower_dandelion_white",
|
||||
"flowers:flower_cotton",
|
||||
"flowers:dandelion_yellow",
|
||||
"flowers:dandelion_white",
|
||||
"flowers:cotton_plant",
|
||||
},
|
||||
avoid_radius = 7,
|
||||
spawn_chance = SPAWN_CHANCE,
|
||||
|
@ -214,10 +253,10 @@ plantslib:spawn_on_surfaces({
|
|||
plantslib:spawn_on_surfaces({
|
||||
spawn_delay = SPAWN_DELAY/2,
|
||||
spawn_plants = {
|
||||
"flowers:flower_waterlily",
|
||||
"flowers:flower_waterlily_225",
|
||||
"flowers:flower_waterlily_45",
|
||||
"flowers:flower_waterlily_675"
|
||||
"flowers:waterlily",
|
||||
"flowers:waterlily_225",
|
||||
"flowers:waterlily_45",
|
||||
"flowers:waterlily_675"
|
||||
},
|
||||
avoid_radius = 2.5,
|
||||
spawn_chance = SPAWN_CHANCE*4,
|
||||
|
@ -231,7 +270,7 @@ plantslib:spawn_on_surfaces({
|
|||
|
||||
plantslib:spawn_on_surfaces({
|
||||
spawn_delay = SPAWN_DELAY*2,
|
||||
spawn_plants = {"flowers:flower_seaweed"},
|
||||
spawn_plants = {"flowers:seaweed"},
|
||||
spawn_chance = SPAWN_CHANCE*2,
|
||||
spawn_surfaces = {"default:water_source"},
|
||||
avoid_nodes = {"group:flower"},
|
||||
|
@ -244,7 +283,7 @@ plantslib:spawn_on_surfaces({
|
|||
|
||||
plantslib:spawn_on_surfaces({
|
||||
spawn_delay = SPAWN_DELAY*2,
|
||||
spawn_plants = {"flowers:flower_seaweed"},
|
||||
spawn_plants = {"flowers:seaweed"},
|
||||
spawn_chance = SPAWN_CHANCE*2,
|
||||
spawn_surfaces = {"default:dirt_with_grass"},
|
||||
avoid_nodes = {"group:flower"},
|
||||
|
@ -258,7 +297,7 @@ plantslib:spawn_on_surfaces({
|
|||
|
||||
plantslib:spawn_on_surfaces({
|
||||
spawn_delay = SPAWN_DELAY*2,
|
||||
spawn_plants = {"flowers:flower_seaweed"},
|
||||
spawn_plants = {"flowers:seaweed"},
|
||||
spawn_chance = SPAWN_CHANCE*2,
|
||||
spawn_surfaces = {"default:stone"},
|
||||
avoid_nodes = {"group:flower"},
|
||||
|
@ -272,7 +311,7 @@ plantslib:spawn_on_surfaces({
|
|||
|
||||
-- crafting recipes!
|
||||
|
||||
minetest.register_craftitem(":flowers:flower_pot", {
|
||||
minetest.register_craftitem("flowers:flower_pot", {
|
||||
description = "Flower Pot",
|
||||
inventory_image = "flower_pot.png",
|
||||
})
|
||||
|
@ -285,23 +324,25 @@ minetest.register_craft( {
|
|||
},
|
||||
})
|
||||
|
||||
minetest.register_craftitem(":flowers:cotton", {
|
||||
description = "Cotton",
|
||||
minetest.register_alias("flowers:cotton", "flowers:cotton_wad")
|
||||
|
||||
minetest.register_craftitem("flowers:cotton_wad", {
|
||||
description = "Cotton wad",
|
||||
image = "cotton.png",
|
||||
})
|
||||
|
||||
minetest.register_craft({
|
||||
output = "flowers:cotton 3",
|
||||
output = "flowers:cotton_wad 3",
|
||||
recipe ={
|
||||
{"flowers:flower_cotton"},
|
||||
{"flowers:cotton_plant"},
|
||||
}
|
||||
})
|
||||
|
||||
minetest.register_craft({
|
||||
output = "wool:white 2",
|
||||
recipe = {
|
||||
{'flowers:cotton', 'flowers:cotton', ''},
|
||||
{'flowers:cotton', 'flowers:cotton', ''},
|
||||
{'flowers:cotton_wad', 'flowers:cotton_wad', ''},
|
||||
{'flowers:cotton_wad', 'flowers:cotton_wad', ''},
|
||||
}
|
||||
})
|
||||
|
||||
|
|
BIN
flowers/textures/flowers_cotton_plant.png
Normal file
After Width: | Height: | Size: 315 B |
BIN
flowers/textures/flowers_cotton_wad.png
Normal file
After Width: | Height: | Size: 680 B |
BIN
flowers/textures/flowers_dandelion_white.png
Normal file
After Width: | Height: | Size: 169 B |
BIN
flowers/textures/flowers_dandelion_yellow.png
Normal file
After Width: | Height: | Size: 166 B |
BIN
flowers/textures/flowers_geranium.png
Normal file
After Width: | Height: | Size: 361 B |
BIN
flowers/textures/flowers_pot.png
Normal file
After Width: | Height: | Size: 405 B |
BIN
flowers/textures/flowers_potted_cotton_plant.png
Normal file
After Width: | Height: | Size: 498 B |
BIN
flowers/textures/flowers_potted_dandelion_white.png
Normal file
After Width: | Height: | Size: 464 B |
BIN
flowers/textures/flowers_potted_dandelion_yellow.png
Normal file
After Width: | Height: | Size: 462 B |
BIN
flowers/textures/flowers_potted_geranium.png
Normal file
After Width: | Height: | Size: 520 B |
BIN
flowers/textures/flowers_potted_rose.png
Normal file
After Width: | Height: | Size: 479 B |
BIN
flowers/textures/flowers_potted_tulip.png
Normal file
After Width: | Height: | Size: 470 B |
BIN
flowers/textures/flowers_potted_viola.png
Normal file
After Width: | Height: | Size: 465 B |
BIN
flowers/textures/flowers_rose.png
Normal file
After Width: | Height: | Size: 171 B |
BIN
flowers/textures/flowers_seaweed.png
Normal file
After Width: | Height: | Size: 416 B |
BIN
flowers/textures/flowers_tulip.png
Normal file
After Width: | Height: | Size: 159 B |
BIN
flowers/textures/flowers_viola.png
Normal file
After Width: | Height: | Size: 140 B |
BIN
flowers/textures/flowers_waterlily.png
Normal file
After Width: | Height: | Size: 413 B |
BIN
flowers/textures/flowers_waterlily_22.5.png
Normal file
After Width: | Height: | Size: 491 B |
BIN
flowers/textures/flowers_waterlily_45.png
Normal file
After Width: | Height: | Size: 502 B |
BIN
flowers/textures/flowers_waterlily_67.5.png
Normal file
After Width: | Height: | Size: 471 B |