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
1d856b73
Commit
1d856b73
authored
11 years ago
by
4Evergreen4
Committed by
kwolekr
11 years ago
Browse files
Options
Downloads
Patches
Plain Diff
Add wrapper for minetest.rotate_and_place.
parent
3d63492f
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
builtin/misc_helpers.lua
+14
-0
14 additions, 0 deletions
builtin/misc_helpers.lua
doc/lua_api.txt
+5
-0
5 additions, 0 deletions
doc/lua_api.txt
with
19 additions
and
0 deletions
builtin/misc_helpers.lua
+
14
−
0
View file @
1d856b73
...
...
@@ -282,6 +282,20 @@ if minetest then
minetest
.
registered_nodes
[
node
.
name
].
on_rightclick
(
pointed_thing
.
under
,
node
,
placer
,
itemstack
)
end
end
--------------------------------------------------------------------------------
--Wrapper for rotate_and_place() to check for sneak and assume Creative mode
--implies infinite stacks when performing a 6d rotation.
--------------------------------------------------------------------------------
minetest
.
rotate_node
=
function
(
itemstack
,
placer
,
pointed_thing
)
minetest
.
rotate_and_place
(
itemstack
,
placer
,
pointed_thing
,
minetest
.
setting_getbool
(
"creative_mode"
),
{
invert_wall
=
placer
:
get_player_control
().
sneak
})
return
itemstack
end
end
--------------------------------------------------------------------------------
...
...
This diff is collapsed.
Click to expand it.
doc/lua_api.txt
+
5
−
0
View file @
1d856b73
...
...
@@ -1561,6 +1561,11 @@ minetest.rotate_and_place(itemstack, placer, pointed_thing, infinitestacks, orie
force_facedir: if true, forcably reset the facedir to north when placing on
the floor or ceiling
minetest.rotate_node(itemstack, placer, pointed_thing)
^ calls rotate_and_place() with infinitestacks set according to the state of
the creative mode setting, and checks for "sneak" to set the invert_wall
parameter.
Global objects:
minetest.env - EnvRef of the server environment and world.
^ Any function in the minetest namespace can be called using the syntax
...
...
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