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
54bb0afe
Commit
54bb0afe
authored
5 years ago
by
t0ny2
Committed by
Paramat
5 years ago
Browse files
Options
Downloads
Patches
Plain Diff
Make waterlily wave when placed on waving water
parent
0f771a27
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
mods/flowers/init.lua
+14
-4
14 additions, 4 deletions
mods/flowers/init.lua
mods/flowers/mapgen.lua
+2
-2
2 additions, 2 deletions
mods/flowers/mapgen.lua
with
16 additions
and
6 deletions
mods/flowers/init.lua
+
14
−
4
View file @
54bb0afe
...
...
@@ -266,7 +266,7 @@ minetest.register_alias("mushroom:red_natural", "flowers:mushroom_red")
-- Waterlily
--
minetest
.
register_node
(
"flowers:
waterlily
"
,
{
local
waterlily
_def
=
{
description
=
"Waterlily"
,
drawtype
=
"nodebox"
,
paramtype
=
"light"
,
...
...
@@ -294,7 +294,6 @@ minetest.register_node("flowers:waterlily", {
local
pos
=
pointed_thing
.
above
local
node
=
minetest
.
get_node
(
pointed_thing
.
under
)
local
def
=
minetest
.
registered_nodes
[
node
.
name
]
local
player_name
=
placer
and
placer
:
get_player_name
()
or
""
if
def
and
def
.
on_rightclick
then
return
def
.
on_rightclick
(
pointed_thing
.
under
,
node
,
placer
,
itemstack
,
...
...
@@ -303,8 +302,10 @@ minetest.register_node("flowers:waterlily", {
if
def
and
def
.
liquidtype
==
"source"
and
minetest
.
get_item_group
(
node
.
name
,
"water"
)
>
0
then
local
player_name
=
placer
and
placer
:
get_player_name
()
or
""
if
not
minetest
.
is_protected
(
pos
,
player_name
)
then
minetest
.
set_node
(
pos
,
{
name
=
"flowers:waterlily"
,
minetest
.
set_node
(
pos
,
{
name
=
"flowers:waterlily"
..
(
def
.
waving
==
3
and
"_waving"
or
""
),
param2
=
math.random
(
0
,
3
)})
if
not
(
creative
and
creative
.
is_enabled_for
and
creative
.
is_enabled_for
(
player_name
))
then
...
...
@@ -318,4 +319,13 @@ minetest.register_node("flowers:waterlily", {
return
itemstack
end
})
}
local
waterlily_waving_def
=
table
.
copy
(
waterlily_def
)
waterlily_waving_def
.
waving
=
3
waterlily_waving_def
.
drop
=
"flowers:waterlily"
waterlily_waving_def
.
groups
.
not_in_creative_inventory
=
1
minetest
.
register_node
(
"flowers:waterlily"
,
waterlily_def
)
minetest
.
register_node
(
"flowers:waterlily_waving"
,
waterlily_waving_def
)
This diff is collapsed.
Click to expand it.
mods/flowers/mapgen.lua
+
2
−
2
View file @
54bb0afe
...
...
@@ -60,7 +60,7 @@ local function register_mgv6_waterlily()
},
y_max
=
0
,
y_min
=
0
,
decoration
=
"flowers:waterlily"
,
decoration
=
"flowers:waterlily
_waving
"
,
param2
=
0
,
param2_max
=
3
,
place_offset_y
=
1
,
...
...
@@ -146,7 +146,7 @@ local function register_waterlily()
biomes
=
{
"rainforest_swamp"
,
"savanna_shore"
,
"deciduous_forest_shore"
},
y_max
=
0
,
y_min
=
0
,
decoration
=
"flowers:waterlily"
,
decoration
=
"flowers:waterlily
_waving
"
,
param2
=
0
,
param2_max
=
3
,
place_offset_y
=
1
,
...
...
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