Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
I
illuna-minetest
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
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
illuna-minetest
Commits
d1681872
Commit
d1681872
authored
10 years ago
by
paramat
Browse files
Options
Downloads
Patches
Plain Diff
lua_api/l_mapgen: generate_ores/decorations: make p1, p2 optional
parent
4fbcfac6
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
doc/lua_api.txt
+6
-4
6 additions, 4 deletions
doc/lua_api.txt
src/script/lua_api/l_mapgen.cpp
+12
-6
12 additions, 6 deletions
src/script/lua_api/l_mapgen.cpp
with
18 additions
and
10 deletions
doc/lua_api.txt
+
6
−
4
View file @
d1681872
...
...
@@ -1903,10 +1903,12 @@ and `minetest.auth_reload` call the authetification handler.
* Sets the noiseparams setting of `name` to the noiseparams table specified in `noiseparams`.
* `set_default` is an optional boolean (default: `true`) that specifies whether the setting
should be applied to the default config or current active config
* `minetest.generate_ores(vm, p1, p2)`
* Generate all registered ores within the VoxelManip `vm` and in the area from p1 to p2.
* `minetest.generate_decorations(vm, p1, p2)`
* Generate all registered decorations within the VoxelManip `vm` and in the area from p1 to p2.
* `minetest.generate_ores(vm, pos1, pos2)`
* Generate all registered ores within the VoxelManip `vm` and in the area from `pos1` to `pos2`.
* `pos1` and `pos2` are optional and default to mapchunk minp and maxp.
* `minetest.generate_decorations(vm, pos1, pos2)`
* Generate all registered decorations within the VoxelManip `vm` and in the area from `pos1` to `pos2`.
* `pos1` and `pos2` are optional and default to mapchunk minp and maxp.
* `minetest.clear_objects()`
* clear all objects in the environments
* `minetest.delete_area(pos1, pos2)`
...
...
This diff is collapsed.
Click to expand it.
src/script/lua_api/l_mapgen.cpp
+
12
−
6
View file @
d1681872
...
...
@@ -801,10 +801,13 @@ int ModApiMapgen::l_generate_ores(lua_State *L)
mg
.
vm
=
LuaVoxelManip
::
checkobject
(
L
,
1
)
->
vm
;
mg
.
ndef
=
getServer
(
L
)
->
getNodeDefManager
();
u32
blockseed
=
Mapgen
::
getBlockSeed
(
mg
.
vm
->
m_area
.
MinEdge
,
mg
.
seed
);
v3s16
pmin
=
lua_istable
(
L
,
2
)
?
read_v3s16
(
L
,
2
)
:
mg
.
vm
->
m_area
.
MinEdge
+
v3s16
(
1
,
1
,
1
)
*
MAP_BLOCKSIZE
;
v3s16
pmax
=
lua_istable
(
L
,
3
)
?
read_v3s16
(
L
,
3
)
:
mg
.
vm
->
m_area
.
MaxEdge
-
v3s16
(
1
,
1
,
1
)
*
MAP_BLOCKSIZE
;
sortBoxVerticies
(
pmin
,
pmax
);
v3s16
pmin
=
read_v3s16
(
L
,
2
);
v3s16
pmax
=
read_v3s16
(
L
,
3
);
u32
blockseed
=
Mapgen
::
getBlockSeed
(
pmin
,
mg
.
seed
);
emerge
->
oremgr
->
placeAllOres
(
&
mg
,
blockseed
,
pmin
,
pmax
);
...
...
@@ -821,10 +824,13 @@ int ModApiMapgen::l_generate_decorations(lua_State *L)
mg
.
vm
=
LuaVoxelManip
::
checkobject
(
L
,
1
)
->
vm
;
mg
.
ndef
=
getServer
(
L
)
->
getNodeDefManager
();
u32
blockseed
=
Mapgen
::
getBlockSeed
(
mg
.
vm
->
m_area
.
MinEdge
,
mg
.
seed
);
v3s16
pmin
=
lua_istable
(
L
,
2
)
?
read_v3s16
(
L
,
2
)
:
mg
.
vm
->
m_area
.
MinEdge
+
v3s16
(
1
,
1
,
1
)
*
MAP_BLOCKSIZE
;
v3s16
pmax
=
lua_istable
(
L
,
3
)
?
read_v3s16
(
L
,
3
)
:
mg
.
vm
->
m_area
.
MaxEdge
-
v3s16
(
1
,
1
,
1
)
*
MAP_BLOCKSIZE
;
sortBoxVerticies
(
pmin
,
pmax
);
v3s16
pmin
=
read_v3s16
(
L
,
2
);
v3s16
pmax
=
read_v3s16
(
L
,
3
);
u32
blockseed
=
Mapgen
::
getBlockSeed
(
pmin
,
mg
.
seed
);
emerge
->
decomgr
->
placeAllDecos
(
&
mg
,
blockseed
,
pmin
,
pmax
);
...
...
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