Skip to content
Browse files
Add wrapper for minetest.rotate_and_place.
  • Loading branch information
4Evergreen4 authored and kwolekr committed Nov 8, 2013
1 parent 3d63492 commit 1d856b734b735129da209bc25f45abb2852328a0
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 0 deletions.
@@ -282,6 +282,20 @@ if minetest then
minetest.registered_nodes[].on_rightclick(pointed_thing.under, node, placer, itemstack)

--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,
{invert_wall = placer:get_player_control().sneak})
return itemstack

@@ -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

Global objects:
minetest.env - EnvRef of the server environment and world.
^ Any function in the minetest namespace can be called using the syntax

0 comments on commit 1d856b7

Please sign in to comment.