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
d1e715eb
Commit
d1e715eb
authored
10 years ago
by
PilzAdam
Committed by
Novatux
10 years ago
Browse files
Options
Downloads
Patches
Plain Diff
Add tree growing functions to game_api.txt
parent
c654c9fd
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
game_api.txt
+17
-6
17 additions, 6 deletions
game_api.txt
mods/default/trees.lua
+5
-5
5 additions, 5 deletions
mods/default/trees.lua
with
22 additions
and
11 deletions
game_api.txt
+
17
−
6
View file @
d1e715eb
...
...
@@ -23,7 +23,7 @@ The bucket API allows registering new types of buckets for non-default liquids.
"bucket_lava.png", -- Bucket texture (for wielditem and inventory_image)
"Lava Bucket" -- Bucket description
)
Doors API
---------
The doors mod allows modders to register custom doors.
...
...
@@ -31,7 +31,7 @@ The doors mod allows modders to register custom doors.
doors.register_door(name, def)
^ name: "Door name"
^ def: See [#Door definition]
#Door definition
----------------
{
...
...
@@ -58,7 +58,7 @@ The farming API allows you to easily register plants and hoes.
farming.register_hoe(name, hoe definition)
-> Register a new hoe, see [#hoe definition]
farming.register_plant(name, Plant definition)
-> Register a new growing plant, see [#Plant definition]
...
...
@@ -99,7 +99,7 @@ stairs.register_stair(subname, recipeitem, groups, images, description, sounds)
-> images: see [Tile definition]
-> description: used for the description field in the stair's definition
-> sounds: see [#Default sounds]
stairs.register_slab(subname, recipeitem, groups, images, description, sounds)
-> Registers a slabs
-> subname: Basically the material name (e.g. cobble) used for the stair name. Nodename pattern: "stairs:stair_subname"
...
...
@@ -108,13 +108,13 @@ stairs.register_slab(subname, recipeitem, groups, images, description, sounds)
-> images: see [Tile definition]
-> description: used for the description field in the stair's definition
-> sounds: see [#Default sounds]
stairs.register_stair_and_slab(subname, recipeitem, groups, images, desc_stair, desc_slab, sounds)
-> A wrapper for stairs.register_stair and stairs.register_slab
-> Uses almost the same arguments as stairs.register_stair
-> desc_stair: Description for stair node
-> desc_slab: Description for slab node
Xpanes API
----------
Creates panes that automatically connect to each other
...
...
@@ -280,3 +280,14 @@ dye.basecolors
dye.excolors
^ Array containing the names of the available extended colors
Trees
-----
default.grow_tree(pos, is_apple_tree)
^ Grows a tree or apple tree at pos
default.grow_jungle_tree(pos)
^ Grows a jungletree at pos
default.grow_pine_tree(pos)
^ Grows a pinetree at pos
This diff is collapsed.
Click to expand it.
mods/default/trees.lua
+
5
−
5
View file @
d1e715eb
...
...
@@ -45,7 +45,7 @@ minetest.register_abm({
minetest
.
log
(
"action"
,
"A jungle sapling grows into a tree at "
..
minetest
.
pos_to_string
(
pos
))
default
.
grow_jungletree
(
pos
)
default
.
grow_jungle
_
tree
(
pos
)
end
})
...
...
@@ -60,7 +60,7 @@ minetest.register_abm({
minetest
.
log
(
"action"
,
"A pine sapling grows into a tree at "
..
minetest
.
pos_to_string
(
pos
))
default
.
grow_pinetree
(
pos
)
default
.
grow_pine
_
tree
(
pos
)
end
})
...
...
@@ -157,14 +157,14 @@ end
-- Jungletree
function
default
.
grow_jungletree
(
pos
,
bad
)
function
default
.
grow_jungle
_
tree
(
pos
,
bad
)
--[[
NOTE: Jungletree-placing code is currently duplicated in the engine
and in games that have saplings; both are deprecated but not
replaced yet
--]]
if
bad
then
error
(
"Deprecated use of default.grow_jungletree"
)
error
(
"Deprecated use of default.grow_jungle
_
tree"
)
end
local
x
,
y
,
z
=
pos
.
x
,
pos
.
y
,
pos
.
z
...
...
@@ -220,7 +220,7 @@ local function add_snow(data, vi, c_air, c_ignore, c_snow)
end
end
function
default
.
grow_pinetree
(
pos
)
function
default
.
grow_pine
_
tree
(
pos
)
local
x
,
y
,
z
=
pos
.
x
,
pos
.
y
,
pos
.
z
local
maxy
=
y
+
random
(
9
,
13
)
-- Trunk top
...
...
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