Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
P
plantlife_modpack
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
plantlife_modpack
Commits
5adbd3f0
Commit
5adbd3f0
authored
10 years ago
by
Vanessa Ezekowitz
Browse files
Options
Downloads
Patches
Plain Diff
minetest.env:* is deprecated, use minetest.*
parent
9032385b
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
nature_classic/blossom.lua
+2
-2
2 additions, 2 deletions
nature_classic/blossom.lua
nature_classic/global_function.lua
+7
-7
7 additions, 7 deletions
nature_classic/global_function.lua
with
9 additions
and
9 deletions
nature_classic/blossom.lua
+
2
−
2
View file @
5adbd3f0
...
...
@@ -13,8 +13,8 @@ local function spawn_apple_under(pos)
y
=
pos
.
y
-
1
,
z
=
pos
.
z
,
}
if
minetest
.
env
:
get_node
(
below
).
name
==
"air"
then
minetest
.
env
:
add_node
(
below
,
{
name
=
"default:apple"
})
if
minetest
.
get_node
(
below
).
name
==
"air"
then
minetest
.
add_node
(
below
,
{
name
=
"default:apple"
})
end
end
...
...
This diff is collapsed.
Click to expand it.
nature_classic/global_function.lua
+
7
−
7
View file @
5adbd3f0
...
...
@@ -3,19 +3,19 @@ local NODE_YOUNG = "young"
nature
=
{}
local
function
set_young_node
(
pos
)
local
meta
=
minetest
.
env
:
get_meta
(
pos
)
local
meta
=
minetest
.
get_meta
(
pos
)
meta
:
set_string
(
NODE_YOUNG
,
"true"
)
minetest
.
after
(
5
,
function
(
pos
)
local
meta
=
minetest
.
env
:
get_meta
(
pos
)
local
meta
=
minetest
.
get_meta
(
pos
)
meta
:
set_string
(
NODE_YOUNG
,
"false"
)
end
,
pos
)
end
local
function
is_not_young
(
pos
)
local
meta
=
minetest
.
env
:
get_meta
(
pos
)
local
meta
=
minetest
.
get_meta
(
pos
)
local
young
=
meta
:
get_string
(
NODE_YOUNG
)
return
young
~=
"true"
...
...
@@ -23,12 +23,12 @@ end
function
nature
:
grow_node
(
pos
,
nodename
)
if
pos
~=
nil
then
local
light_enough
=
minetest
.
env
:
get_node_light
(
pos
,
nil
)
local
light_enough
=
minetest
.
get_node_light
(
pos
,
nil
)
>=
MINIMUM_GROWTH_LIGHT
if
is_not_young
(
pos
)
and
light_enough
then
minetest
.
env
:
remove_node
(
pos
)
minetest
.
env
:
add_node
(
pos
,
{
name
=
nodename
})
minetest
.
remove_node
(
pos
)
minetest
.
add_node
(
pos
,
{
name
=
nodename
})
set_young_node
(
pos
)
minetest
.
log
(
"info"
,
nodename
..
" has grown at "
..
pos
.
x
..
","
...
...
@@ -38,6 +38,6 @@ function nature:grow_node(pos, nodename)
end
function
nature
:
is_near_water
(
pos
)
return
minetest
.
env
:
find_node_near
(
pos
,
DISTANCE_FROM_WATER
,
return
minetest
.
find_node_near
(
pos
,
DISTANCE_FROM_WATER
,
{
"default:water_source"
})
~=
nil
or
DISTANCE_FROM_WATER
==
-
1
end
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