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:
cheapie
2019-06-15 12:09:51 -05:00
parent 0fda965aa4
commit da9556bd3a
4 changed files with 249 additions and 39 deletions

View File

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