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
48a718e7
Commit
48a718e7
authored
9 years ago
by
paramat
Browse files
Options
Downloads
Patches
Plain Diff
Decoration API: Allow force_placement of simple decorations
parent
1100a5d6
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
+3
-2
3 additions, 2 deletions
doc/lua_api.txt
src/mg_decoration.cpp
+4
-1
4 additions, 1 deletion
src/mg_decoration.cpp
with
7 additions
and
3 deletions
doc/lua_api.txt
+
3
−
2
View file @
48a718e7
...
...
@@ -3698,11 +3698,12 @@ Definition tables
-- ^ Minimum and maximum `y` positions these decorations can be generated at.
-- ^ This parameter refers to the `y` position of the decoration base, so
-- the actual maximum height would be `height_max + size.Y`.
flags = "liquid_surface",
flags = "liquid_surface
, force_placement
",
-- ^ Flags for all decoration types.
-- ^ "liquid_surface": Instead of placement on the highest solid surface
-- ^ in a mapchunk column, placement is on the highest liquid surface.
-- ^ Placement is disabled if solid nodes are found above the liquid surface.
-- ^ "force_placement": Nodes other than "air" and "ignore" are replaced by the decoration.
----- Simple-type parameters
decoration = "default:grass",
...
...
@@ -3746,7 +3747,7 @@ Definition tables
},
-- ^ See 'Schematic specifier' for details.
replacements = {["oldname"] = "convert_to", ...},
flags = "place_center_x, place_center_y, place_center_z
, force_placement
",
flags = "place_center_x, place_center_y, place_center_z",
-- ^ Flags for schematic decorations. See 'Schematic attributes'.
rotation = "90" -- rotate schematic 90 degrees on placement
-- ^ Rotation can be "0", "90", "180", "270", or "random".
...
...
This diff is collapsed.
Click to expand it.
src/mg_decoration.cpp
+
4
−
1
View file @
48a718e7
...
...
@@ -304,13 +304,16 @@ size_t DecoSimple::generate(MMVManip *vm, PcgRandom *pr, v3s16 p)
s16
height
=
(
deco_height_max
>
0
)
?
pr
->
range
(
deco_height
,
deco_height_max
)
:
deco_height
;
bool
force_placement
=
(
flags
&
DECO_FORCE_PLACEMENT
);
v3s16
em
=
vm
->
m_area
.
getExtent
();
u32
vi
=
vm
->
m_area
.
index
(
p
);
for
(
int
i
=
0
;
i
<
height
;
i
++
)
{
vm
->
m_area
.
add_y
(
em
,
vi
,
1
);
content_t
c
=
vm
->
m_data
[
vi
].
getContent
();
if
(
c
!=
CONTENT_AIR
&&
c
!=
CONTENT_IGNORE
)
if
(
c
!=
CONTENT_AIR
&&
c
!=
CONTENT_IGNORE
&&
!
force_placement
)
break
;
vm
->
m_data
[
vi
]
=
MapNode
(
c_place
);
...
...
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