Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
C
caverealms
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
caverealms
Commits
9dfaba68
Commit
9dfaba68
authored
10 years ago
by
HeroOfTheWinds
Browse files
Options
Downloads
Plain Diff
Merge pull request #2 from Zeno-/master
Approx. 300% speed increase
parents
765d8f2f
c85a4295
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
init.lua
+8
-6
8 additions, 6 deletions
init.lua
with
8 additions
and
6 deletions
init.lua
+
8
−
6
View file @
9dfaba68
...
...
@@ -278,7 +278,7 @@ function caverealms:crystal_stalagmite(x,y,z, area, data, biome)
local
c_crystore
=
minetest
.
get_content_id
(
"caverealms:glow_ore"
)
local
c_emerald
=
minetest
.
get_content_id
(
"caverealms:glow_emerald"
)
local
c_emore
=
minetest
.
get_content_id
(
"caverealms:glow_emerald_ore"
)
local
top
=
math.random
(
5
,
H_CRY
)
--grab a random height for the stalagmite
for
j
=
0
,
top
do
--y
...
...
@@ -406,6 +406,8 @@ minetest.register_on_generated(function(minp, maxp, seed)
--grab content IDs
local
c_air
=
minetest
.
get_content_id
(
"air"
)
local
c_water
=
minetest
.
get_content_id
(
"default:water_source"
)
local
c_lava
=
minetest
.
get_content_id
(
"defalt:lava_source"
)
local
c_crystal
=
minetest
.
get_content_id
(
"caverealms:glow_crystal"
)
local
c_gem
=
minetest
.
get_content_id
(
"caverealms:glow_gem"
)
local
c_moss
=
minetest
.
get_content_id
(
"caverealms:stone_with_moss"
)
...
...
@@ -441,10 +443,10 @@ minetest.register_on_generated(function(minp, maxp, seed)
local
si
=
x
-
x0
+
1
--stability index
dirt
[
si
]
=
0
--no dirt here... yet
roof
[
si
]
=
0
local
node
name
=
minetest
.
get_node
({
x
=
x
,
y
=
y0
-
1
,
z
=
z
}).
name
--grab the
name
of the node just below
if
node
name
==
"
air
"
or
node
name
==
"default:water_source"
or
node
name
==
"default:lava_source"
then
--if a cave or any kind of lake
local
node
id
=
area
:
index
(
x
,
y0
-
1
,
z
)
--grab the
ID
of the node just below
if
node
id
==
c_
air
or
node
id
==
c_water
or
node
id
==
c_lava
then
--if a cave or any kind of lake
stable
[
si
]
=
0
--this is not stable for plants or falling nodes above
stable2
[
si
]
=
0
else
-- all else including ignore in ungenerated chunks
...
...
@@ -466,7 +468,7 @@ minetest.register_on_generated(function(minp, maxp, seed)
end
local
density
=
nvals_cave
[
nixyz
]
-
grad
--how dense is the emptiness?
if
density
<
0
and
density
>
-
0
.
7
then
-- if cavern "shell"
local
nodename
=
minetest
.
get_node
({
x
=
x
,
y
=
y
,
z
=
z
}).
name
--grab the name of the node
--
local nodename = minetest.get_node({x=x,y=y,z=z}).name --grab the name of the node
data
[
vi
]
=
c_air
--make emptiness
if
density
<
STOTHR
and
stable
[
si
]
<=
STABLE
then
dirt
[
si
]
=
dirt
[
si
]
+
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