Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
E
ethereal
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
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
ethereal
Commits
28985b46
Commit
28985b46
authored
8 years ago
by
TenPlus1
Browse files
Options
Downloads
Patches
Plain Diff
Updated bonemeal and sapling growth with height check
parent
5ad18943
No related branches found
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
README.md
+6
-0
6 additions, 0 deletions
README.md
bonemeal.lua
+46
-16
46 additions, 16 deletions
bonemeal.lua
sapling.lua
+22
-11
22 additions, 11 deletions
sapling.lua
with
74 additions
and
27 deletions
README.md
+
6
−
0
View file @
28985b46
...
...
@@ -7,6 +7,12 @@ Ethereal v7 Mapgen mod for Minetest
## Changelog
### 1.21
-
Saplings need clear space above to grow (depending on height of tree)
-
Bonemeal changes to suit new sapling growth
-
Fixed and tweaks
### 1.20
-
Tweaked Ethereal to work with new features and nodes in Minetest 0.4.14
...
...
This diff is collapsed.
Click to expand it.
bonemeal.lua
+
46
−
16
View file @
28985b46
...
...
@@ -69,6 +69,20 @@ local crops = {
{
"farming:barley_"
,
7
},
}
-- check if sapling has enough height room to grow
local
function
enough_height
(
pos
,
height
)
local
nod
=
minetest
.
line_of_sight
(
{
x
=
pos
.
x
,
y
=
pos
.
y
+
1
,
z
=
pos
.
z
},
{
x
=
pos
.
x
,
y
=
pos
.
y
+
height
,
z
=
pos
.
z
})
if
not
nod
then
return
false
-- obstructed
else
return
true
-- can grow
end
end
-- growing routine
local
function
growth
(
pointed_thing
)
...
...
@@ -121,47 +135,61 @@ local function growth(pointed_thing)
end
-- grow ethereal tree
if
node
.
name
==
"ethereal:palm_sapling"
then
if
node
.
name
==
"ethereal:palm_sapling"
and
enough_height
(
pos
,
9
)
then
ethereal
.
grow_palm_tree
(
pos
)
elseif
node
.
name
==
"ethereal:yellow_tree_sapling"
then
elseif
node
.
name
==
"ethereal:yellow_tree_sapling"
and
enough_height
(
pos
,
19
)
then
ethereal
.
grow_yellow_tree
(
pos
)
elseif
node
.
name
==
"ethereal:big_tree_sapling"
then
elseif
node
.
name
==
"ethereal:big_tree_sapling"
and
enough_height
(
pos
,
7
)
then
ethereal
.
grow_big_tree
(
pos
)
elseif
node
.
name
==
"ethereal:banana_tree_sapling"
then
elseif
node
.
name
==
"ethereal:banana_tree_sapling"
and
enough_height
(
pos
,
8
)
then
ethereal
.
grow_banana_tree
(
pos
)
elseif
node
.
name
==
"ethereal:frost_tree_sapling"
then
elseif
node
.
name
==
"ethereal:frost_tree_sapling"
and
enough_height
(
pos
,
19
)
then
ethereal
.
grow_frost_tree
(
pos
)
elseif
node
.
name
==
"ethereal:mushroom_sapling"
then
elseif
node
.
name
==
"ethereal:mushroom_sapling"
and
enough_height
(
pos
,
11
)
then
ethereal
.
grow_mushroom_tree
(
pos
)
elseif
node
.
name
==
"ethereal:willow_sapling"
then
elseif
node
.
name
==
"ethereal:willow_sapling"
and
enough_height
(
pos
,
14
)
then
ethereal
.
grow_willow_tree
(
pos
)
elseif
node
.
name
==
"ethereal:redwood_sapling"
then
elseif
node
.
name
==
"ethereal:redwood_sapling"
and
enough_height
(
pos
,
31
)
then
ethereal
.
grow_redwood_tree
(
pos
)
elseif
node
.
name
==
"ethereal:orange_tree_sapling"
then
elseif
node
.
name
==
"ethereal:orange_tree_sapling"
and
enough_height
(
pos
,
6
)
then
ethereal
.
grow_orange_tree
(
pos
)
elseif
node
.
name
==
"ethereal:bamboo_sprout"
then
elseif
node
.
name
==
"ethereal:bamboo_sprout"
and
enough_height
(
pos
,
18
)
then
ethereal
.
grow_bamboo_tree
(
pos
)
elseif
node
.
name
==
"ethereal:birch_sapling"
then
elseif
node
.
name
==
"ethereal:birch_sapling"
and
enough_height
(
pos
,
7
)
then
ethereal
.
grow_birch_tree
(
pos
)
-- grow default tree
elseif
node
.
name
==
"default:sapling"
then
elseif
node
.
name
==
"default:sapling"
and
enough_height
(
pos
,
7
)
then
default
.
grow_new_apple_tree
(
pos
)
elseif
node
.
name
==
"default:junglesapling"
then
elseif
node
.
name
==
"default:junglesapling"
and
enough_height
(
pos
,
15
)
then
default
.
grow_new_jungle_tree
(
pos
)
elseif
node
.
name
==
"default:pine_sapling"
then
elseif
node
.
name
==
"default:pine_sapling"
and
enough_height
(
pos
,
11
)
then
if
#
minetest
.
find_nodes_in_area
(
{
x
=
pos
.
x
-
1
,
y
=
pos
.
y
-
1
,
z
=
pos
.
z
-
1
},
...
...
@@ -173,10 +201,12 @@ local function growth(pointed_thing)
default
.
grow_new_pine_tree
(
pos
)
end
elseif
node
.
name
==
"default:acacia_sapling"
then
elseif
node
.
name
==
"default:acacia_sapling"
and
enough_height
(
pos
,
7
)
then
default
.
grow_new_acacia_tree
(
pos
)
elseif
node
.
name
==
"default:aspen_sapling"
then
elseif
node
.
name
==
"default:aspen_sapling"
and
enough_height
(
pos
,
11
)
then
default
.
grow_new_aspen_tree
(
pos
)
end
...
...
This diff is collapsed.
Click to expand it.
sapling.lua
+
22
−
11
View file @
28985b46
...
...
@@ -134,47 +134,58 @@ ethereal.grow_sapling = function (pos, node)
-- Check if Ethereal Sapling is growing on correct substrate
if
node
.
name
==
"ethereal:yellow_tree_sapling"
and
under
==
"default:dirt_with_snow"
then
and
under
==
"default:dirt_with_snow"
and
enough_height
(
pos
,
19
)
then
ethereal
.
grow_yellow_tree
(
pos
)
elseif
node
.
name
==
"ethereal:big_tree_sapling"
and
under
==
"ethereal:green_dirt"
then
and
under
==
"ethereal:green_dirt"
and
enough_height
(
pos
,
7
)
then
ethereal
.
grow_big_tree
(
pos
)
elseif
node
.
name
==
"ethereal:banana_tree_sapling"
and
under
==
"ethereal:grove_dirt"
then
and
under
==
"ethereal:grove_dirt"
and
enough_height
(
pos
,
8
)
then
ethereal
.
grow_banana_tree
(
pos
)
elseif
node
.
name
==
"ethereal:frost_tree_sapling"
and
under
==
"ethereal:crystal_dirt"
then
and
under
==
"ethereal:crystal_dirt"
and
enough_height
(
pos
,
19
)
then
ethereal
.
grow_frost_tree
(
pos
)
elseif
node
.
name
==
"ethereal:mushroom_sapling"
and
under
==
"ethereal:mushroom_dirt"
then
and
under
==
"ethereal:mushroom_dirt"
and
enough_height
(
pos
,
11
)
then
ethereal
.
grow_mushroom_tree
(
pos
)
elseif
node
.
name
==
"ethereal:palm_sapling"
and
under
==
"default:sand"
then
and
under
==
"default:sand"
and
enough_height
(
pos
,
9
)
then
ethereal
.
grow_palm_tree
(
pos
)
elseif
node
.
name
==
"ethereal:willow_sapling"
and
under
==
"ethereal:gray_dirt"
then
and
under
==
"ethereal:gray_dirt"
and
enough_height
(
pos
,
14
)
then
ethereal
.
grow_willow_tree
(
pos
)
elseif
node
.
name
==
"ethereal:redwood_sapling"
and
under
==
"bakedclay:red"
then
and
under
==
"bakedclay:red"
and
enough_height
(
pos
,
31
)
then
ethereal
.
grow_redwood_tree
(
pos
)
elseif
node
.
name
==
"ethereal:orange_tree_sapling"
and
under
==
"ethereal:prairie_dirt"
then
and
under
==
"ethereal:prairie_dirt"
and
enough_height
(
pos
,
6
)
then
ethereal
.
grow_orange_tree
(
pos
)
elseif
node
.
name
==
"ethereal:bamboo_sprout"
and
under
==
"ethereal:bamboo_dirt"
then
and
under
==
"ethereal:bamboo_dirt"
and
enough_height
(
pos
,
18
)
then
ethereal
.
grow_bamboo_tree
(
pos
)
elseif
node
.
name
==
"ethereal:birch_sapling"
and
under
==
"ethereal:green_dirt"
then
and
under
==
"ethereal:green_dirt"
and
enough_height
(
pos
,
7
)
then
ethereal
.
grow_birch_tree
(
pos
)
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