Various additions
* Added intermediate connections for vertical digilines * Added protection support to buttons and wall knobs (optional, defaults to off) * Added the ability to manually control the button light (optional, defaults to off)
This commit is contained in:
13
internal.lua
13
internal.lua
@@ -1,3 +1,5 @@
|
||||
digistuff.mesecons_installed = minetest.get_modpath("mesecons")
|
||||
|
||||
digistuff.rotate_rules = function(rulesin,dir)
|
||||
local rules = {}
|
||||
for k,v in ipairs(rulesin) do rules[k] = v end
|
||||
@@ -42,3 +44,14 @@ digistuff.rotate_rules = function(rulesin,dir)
|
||||
return {}
|
||||
end
|
||||
end
|
||||
|
||||
digistuff.check_protection = function(pos,player)
|
||||
assert(type(pos) == "table","Position must be a table")
|
||||
assert(type(player) == "string" or type(player) == "userdata","Invalid player specified")
|
||||
if type(player) == "userdata" then player = player:get_player_name() end
|
||||
if minetest.is_protected(pos,player) and not minetest.check_player_privs(player,{protection_bypass=true}) then
|
||||
minetest.record_protection_violation(pos,player)
|
||||
return false
|
||||
end
|
||||
return true
|
||||
end
|
||||
|
Reference in New Issue
Block a user