Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
M
minetest_game
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Illuna-Minetest
minetest_game
Commits
638add60
Commit
638add60
authored
9 years ago
by
Ombridride
Committed by
Novatux
9 years ago
Browse files
Options
Downloads
Patches
Plain Diff
Simplified flowers' registration - Created a new local function to register flowers
parent
750f9575
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
mods/flowers/init.lua
+27
-108
27 additions, 108 deletions
mods/flowers/init.lua
with
27 additions
and
108 deletions
mods/flowers/init.lua
+
27
−
108
View file @
638add60
-- Minetest 0.4 mod: default
-- Minetest 0.4 mod: default
-- See README.txt for licensing and other information.
-- See README.txt for licensing and other information.
-- Namespace for functions
flowers
=
{}
-- Map Generation
-- Map Generation
dofile
(
minetest
.
get_modpath
(
"flowers"
)
..
"/mapgen.lua"
)
dofile
(
minetest
.
get_modpath
(
"flowers"
)
..
"/mapgen.lua"
)
...
@@ -15,113 +12,35 @@ minetest.register_alias("flowers:flower_rose", "flowers:rose")
...
@@ -15,113 +12,35 @@ minetest.register_alias("flowers:flower_rose", "flowers:rose")
minetest
.
register_alias
(
"flowers:flower_tulip"
,
"flowers:tulip"
)
minetest
.
register_alias
(
"flowers:flower_tulip"
,
"flowers:tulip"
)
minetest
.
register_alias
(
"flowers:flower_viola"
,
"flowers:viola"
)
minetest
.
register_alias
(
"flowers:flower_viola"
,
"flowers:viola"
)
minetest
.
register_node
(
"flowers:dandelion_white"
,
{
-- Flower registration function
description
=
"White Dandelion"
,
local
function
add_simple_flower
(
name
,
desc
,
image
,
f_groups
)
drawtype
=
"plantlike"
,
minetest
.
register_node
(
"flowers:"
..
name
..
""
,
{
tiles
=
{
"flowers_dandelion_white.png"
},
description
=
desc
,
inventory_image
=
"flowers_dandelion_white.png"
,
drawtype
=
"plantlike"
,
wield_image
=
"flowers_dandelion_white.png"
,
tiles
=
{
image
..
".png"
},
sunlight_propagates
=
true
,
inventory_image
=
image
..
".png"
,
paramtype
=
"light"
,
wield_image
=
image
..
".png"
,
walkable
=
false
,
sunlight_propagates
=
true
,
buildable_to
=
true
,
paramtype
=
"light"
,
groups
=
{
snappy
=
3
,
flammable
=
2
,
flower
=
1
,
flora
=
1
,
attached_node
=
1
,
color_white
=
1
},
walkable
=
false
,
sounds
=
default
.
node_sound_leaves_defaults
(),
stack_max
=
99
,
selection_box
=
{
groups
=
f_groups
,
type
=
"fixed"
,
sounds
=
default
.
node_sound_leaves_defaults
(),
fixed
=
{
-
0
.
5
,
-
0
.
5
,
-
0
.
5
,
0
.
5
,
-
0
.
2
,
0
.
5
},
selection_box
=
{
},
type
=
"fixed"
,
})
fixed
=
{
-
0
.
15
,
-
0
.
5
,
-
0
.
15
,
0
.
15
,
0
.
2
,
0
.
15
},
},
minetest
.
register_node
(
"flowers:dandelion_yellow"
,
{
})
description
=
"Yellow Dandelion"
,
end
drawtype
=
"plantlike"
,
tiles
=
{
"flowers_dandelion_yellow.png"
},
inventory_image
=
"flowers_dandelion_yellow.png"
,
wield_image
=
"flowers_dandelion_yellow.png"
,
sunlight_propagates
=
true
,
paramtype
=
"light"
,
walkable
=
false
,
buildable_to
=
true
,
groups
=
{
snappy
=
3
,
flammable
=
2
,
flower
=
1
,
flora
=
1
,
attached_node
=
1
,
color_yellow
=
1
},
sounds
=
default
.
node_sound_leaves_defaults
(),
selection_box
=
{
type
=
"fixed"
,
fixed
=
{
-
0
.
15
,
-
0
.
5
,
-
0
.
15
,
0
.
15
,
0
.
2
,
0
.
15
},
},
})
minetest
.
register_node
(
"flowers:geranium"
,
{
description
=
"Blue Geranium"
,
drawtype
=
"plantlike"
,
tiles
=
{
"flowers_geranium.png"
},
inventory_image
=
"flowers_geranium.png"
,
wield_image
=
"flowers_geranium.png"
,
sunlight_propagates
=
true
,
paramtype
=
"light"
,
walkable
=
false
,
buildable_to
=
true
,
groups
=
{
snappy
=
3
,
flammable
=
2
,
flower
=
1
,
flora
=
1
,
attached_node
=
1
,
color_blue
=
1
},
sounds
=
default
.
node_sound_leaves_defaults
(),
selection_box
=
{
type
=
"fixed"
,
fixed
=
{
-
0
.
15
,
-
0
.
5
,
-
0
.
15
,
0
.
15
,
0
.
2
,
0
.
15
},
},
})
minetest
.
register_node
(
"flowers:rose"
,
{
-- Registrations using the function above
description
=
"Rose"
,
add_simple_flower
(
"dandelion_yellow"
,
"Yellow Dandelion"
,
"flowers_dandelion_yellow"
,
{
snappy
=
3
,
flammable
=
2
,
flower
=
1
,
flora
=
1
,
attached_node
=
1
,
dig_by_water
=
1
,
color_yellow
=
1
})
drawtype
=
"plantlike"
,
add_simple_flower
(
"geranium"
,
"Blue Geranium"
,
"flowers_geranium"
,
{
snappy
=
3
,
flammable
=
2
,
flower
=
1
,
flora
=
1
,
attached_node
=
1
,
dig_by_water
=
1
,
color_blue
=
1
})
tiles
=
{
"flowers_rose.png"
},
add_simple_flower
(
"rose"
,
"Rose"
,
"flowers_rose"
,
{
snappy
=
3
,
flammable
=
2
,
flower
=
1
,
flora
=
1
,
attached_node
=
1
,
dig_by_water
=
1
,
color_red
=
1
})
inventory_image
=
"flowers_rose.png"
,
add_simple_flower
(
"tulip"
,
"Orange Tulip"
,
"flowers_tulip"
,
{
snappy
=
3
,
flammable
=
2
,
flower
=
1
,
flora
=
1
,
attached_node
=
1
,
dig_by_water
=
1
,
color_orange
=
1
})
wield_image
=
"flowers_rose.png"
,
add_simple_flower
(
"dandelion_white"
,
"White dandelion"
,
"flowers_dandelion_white"
,{
snappy
=
3
,
flammable
=
2
,
flower
=
1
,
flora
=
1
,
attached_node
=
1
,
color_white
=
1
})
sunlight_propagates
=
true
,
add_simple_flower
(
"viola"
,
"Viola"
,
"flowers_viola"
,
{
snappy
=
3
,
flammable
=
2
,
flower
=
1
,
flora
=
1
,
attached_node
=
1
,
color_violet
=
1
})
paramtype
=
"light"
,
walkable
=
false
,
buildable_to
=
true
,
groups
=
{
snappy
=
3
,
flammable
=
2
,
flower
=
1
,
flora
=
1
,
attached_node
=
1
,
color_red
=
1
},
sounds
=
default
.
node_sound_leaves_defaults
(),
selection_box
=
{
type
=
"fixed"
,
fixed
=
{
-
0
.
15
,
-
0
.
5
,
-
0
.
15
,
0
.
15
,
0
.
3
,
0
.
15
},
},
})
minetest
.
register_node
(
"flowers:tulip"
,
{
description
=
"Tulip"
,
drawtype
=
"plantlike"
,
tiles
=
{
"flowers_tulip.png"
},
inventory_image
=
"flowers_tulip.png"
,
wield_image
=
"flowers_tulip.png"
,
sunlight_propagates
=
true
,
paramtype
=
"light"
,
walkable
=
false
,
buildable_to
=
true
,
groups
=
{
snappy
=
3
,
flammable
=
2
,
flower
=
1
,
flora
=
1
,
attached_node
=
1
,
color_orange
=
1
},
sounds
=
default
.
node_sound_leaves_defaults
(),
selection_box
=
{
type
=
"fixed"
,
fixed
=
{
-
0
.
15
,
-
0
.
5
,
-
0
.
15
,
0
.
15
,
0
.
2
,
0
.
15
},
},
})
minetest
.
register_node
(
"flowers:viola"
,
{
description
=
"Viola"
,
drawtype
=
"plantlike"
,
tiles
=
{
"flowers_viola.png"
},
inventory_image
=
"flowers_viola.png"
,
wield_image
=
"flowers_viola.png"
,
sunlight_propagates
=
true
,
paramtype
=
"light"
,
walkable
=
false
,
buildable_to
=
true
,
groups
=
{
snappy
=
3
,
flammable
=
2
,
flower
=
1
,
flora
=
1
,
attached_node
=
1
,
color_violet
=
1
},
sounds
=
default
.
node_sound_leaves_defaults
(),
selection_box
=
{
type
=
"fixed"
,
fixed
=
{
-
0
.
5
,
-
0
.
5
,
-
0
.
5
,
0
.
5
,
-
0
.
2
,
0
.
5
},
},
})
minetest
.
register_abm
({
minetest
.
register_abm
({
nodenames
=
{
"group:flora"
},
nodenames
=
{
"group:flora"
},
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment