aboutsummaryrefslogtreecommitdiff
path: root/builtin/misc_helpers.lua
diff options
context:
space:
mode:
author4Evergreen4 <eljohnson@frontier.com>2013-11-07 16:20:04 -0500
committerkwolekr <kwolekr@minetest.net>2013-11-07 20:14:26 -0500
commit1d856b734b735129da209bc25f45abb2852328a0 (patch)
tree4a059d05f81f4c9596d1575e3e1f2ec415c38f53 /builtin/misc_helpers.lua
parent3d63492f50ecc547197df1818417d339906091f6 (diff)
downloadminetest-1d856b734b735129da209bc25f45abb2852328a0.tar.gz
minetest-1d856b734b735129da209bc25f45abb2852328a0.tar.bz2
minetest-1d856b734b735129da209bc25f45abb2852328a0.zip
Add wrapper for minetest.rotate_and_place.
Diffstat (limited to 'builtin/misc_helpers.lua')
-rw-r--r--builtin/misc_helpers.lua14
1 files changed, 14 insertions, 0 deletions
diff --git a/builtin/misc_helpers.lua b/builtin/misc_helpers.lua
index c9bc59c3a..38909ec1d 100644
--- a/builtin/misc_helpers.lua
+++ b/builtin/misc_helpers.lua
@@ -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
--------------------------------------------------------------------------------