add "itemframes.allow_rotate" setting to allow itemframe item rotation in protected areas.
This commit is contained in:
parent
9f17f744d7
commit
5cced5cb21
7
init.lua
7
init.lua
@ -4,6 +4,7 @@ screwdriver = screwdriver or {}
|
||||
local tmp = {}
|
||||
local should_return_item = minetest.settings:get_bool("itemframes.return_item", false)
|
||||
local log_actions = minetest.settings:get_bool("itemframes.log_actions", false)
|
||||
local allow_rotate = minetest.settings:get_bool("itemframes.allow_rotate", false)
|
||||
|
||||
-- item entity
|
||||
|
||||
@ -383,7 +384,8 @@ minetest.register_node("itemframes:frame",{
|
||||
on_punch = function(pos, node, puncher)
|
||||
|
||||
-- rotate item inside frame when holding sneak and punching
|
||||
if puncher and puncher:get_player_control().sneak then
|
||||
if puncher and puncher:get_player_control().sneak
|
||||
and (allow_rotate or not minetest.is_protected(pos, puncher:get_player_name())) then
|
||||
|
||||
local p2 = node.param2
|
||||
local nx = facedir[p2].nx
|
||||
@ -497,7 +499,8 @@ minetest.register_node("itemframes:frame_invis",{
|
||||
on_punch = function(pos, node, puncher)
|
||||
|
||||
-- rotate item inside frame when holding sneak and punching
|
||||
if puncher and puncher:get_player_control().sneak then
|
||||
if puncher and puncher:get_player_control().sneak
|
||||
and (allow_rotate or not minetest.is_protected(pos, puncher:get_player_name())) then
|
||||
|
||||
local p2 = node.param2
|
||||
local nx = facedir[p2].nx
|
||||
|
@ -16,6 +16,8 @@ Change 'itemframes.return_item' setting to true if you want items to drop back i
|
||||
|
||||
Change 'itemframes.log_actions' setting to true if you want to log player actions when inserting or removing items from a frame or pedestal.
|
||||
|
||||
Itemframe items can be rotated by holding sneak and punching frame, but in a protected area this is limited to the owner unless "itemframes.allow_rotate" setting is true.
|
||||
|
||||
|
||||
Texture Override
|
||||
----------------
|
||||
|
@ -3,3 +3,5 @@ itemframes.return_item (return placed item to the player's inventory on right-cl
|
||||
|
||||
# if false, inserting and removing items from frames and pedestals will not be logged
|
||||
itemframes.log_actions (log player actions when using itemframes and pedestals) bool false
|
||||
|
||||
itemframes.allow_rotate (Allow item rotation in protected areas) bool false
|
||||
|
Loading…
x
Reference in New Issue
Block a user