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
6919d43d
Commit
6919d43d
authored
9 years ago
by
Calinou
Committed by
paramat
9 years ago
Browse files
Options
Downloads
Patches
Plain Diff
Remove deprecated ore generation code
parent
01ad0903
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
mods/default/mapgen.lua
+0
-50
0 additions, 50 deletions
mods/default/mapgen.lua
with
0 additions
and
50 deletions
mods/default/mapgen.lua
+
0
−
50
View file @
6919d43d
...
...
@@ -709,53 +709,3 @@ end
minetest
.
register_on_generated
(
default
.
generate_nyancats
)
--
-- Deprecated ore generation code
--
function
default
.
generate_ore
(
name
,
wherein
,
minp
,
maxp
,
seed
,
chunks_per_volume
,
chunk_size
,
ore_per_chunk
,
height_min
,
height_max
)
minetest
.
log
(
'action'
,
"WARNING: default.generate_ore is deprecated"
)
if
maxp
.
y
<
height_min
or
minp
.
y
>
height_max
then
return
end
local
y_min
=
math.max
(
minp
.
y
,
height_min
)
local
y_max
=
math.min
(
maxp
.
y
,
height_max
)
if
chunk_size
>=
y_max
-
y_min
+
1
then
return
end
local
volume
=
(
maxp
.
x
-
minp
.
x
+
1
)
*
(
y_max
-
y_min
+
1
)
*
(
maxp
.
z
-
minp
.
z
+
1
)
local
pr
=
PseudoRandom
(
seed
)
local
num_chunks
=
math.floor
(
chunks_per_volume
*
volume
)
local
inverse_chance
=
math.floor
(
chunk_size
*
chunk_size
*
chunk_size
/
ore_per_chunk
)
--print("generate_ore num_chunks: "..dump(num_chunks))
for
i
=
1
,
num_chunks
do
local
y0
=
pr
:
next
(
y_min
,
y_max
-
chunk_size
+
1
)
if
y0
>=
height_min
and
y0
<=
height_max
then
local
x0
=
pr
:
next
(
minp
.
x
,
maxp
.
x
-
chunk_size
+
1
)
local
z0
=
pr
:
next
(
minp
.
z
,
maxp
.
z
-
chunk_size
+
1
)
local
p0
=
{
x
=
x0
,
y
=
y0
,
z
=
z0
}
for
x1
=
0
,
chunk_size
-
1
do
for
y1
=
0
,
chunk_size
-
1
do
for
z1
=
0
,
chunk_size
-
1
do
if
pr
:
next
(
1
,
inverse_chance
)
==
1
then
local
x2
=
x0
+
x1
local
y2
=
y0
+
y1
local
z2
=
z0
+
z1
local
p2
=
{
x
=
x2
,
y
=
y2
,
z
=
z2
}
if
minetest
.
get_node
(
p2
).
name
==
wherein
then
minetest
.
set_node
(
p2
,
{
name
=
name
})
end
end
end
end
end
end
end
--print("generate_ore done")
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