mirror of
https://github.com/minetest/minetest.git
synced 2024-11-23 16:13:46 +01:00
Add wrapper for minetest.rotate_and_place.
This commit is contained in:
parent
3d63492f50
commit
1d856b734b
@ -282,6 +282,20 @@ if minetest then
|
|||||||
minetest.registered_nodes[node.name].on_rightclick(pointed_thing.under, node, placer, itemstack)
|
minetest.registered_nodes[node.name].on_rightclick(pointed_thing.under, node, placer, itemstack)
|
||||||
end
|
end
|
||||||
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
|
end
|
||||||
|
|
||||||
--------------------------------------------------------------------------------
|
--------------------------------------------------------------------------------
|
||||||
|
@ -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
|
force_facedir: if true, forcably reset the facedir to north when placing on
|
||||||
the floor or ceiling
|
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:
|
Global objects:
|
||||||
minetest.env - EnvRef of the server environment and world.
|
minetest.env - EnvRef of the server environment and world.
|
||||||
^ Any function in the minetest namespace can be called using the syntax
|
^ Any function in the minetest namespace can be called using the syntax
|
||||||
|
Loading…
Reference in New Issue
Block a user