mirror of
https://github.com/minetest-mods/digilines.git
synced 2025-07-06 10:10:40 +02:00
Add protection support to channel fields (#33)
This commit is contained in:
@ -107,6 +107,11 @@ minetest.register_node("digilines_lcd:lcd", {
|
||||
end,
|
||||
|
||||
on_receive_fields = function(pos, formname, fields, sender)
|
||||
local name = sender:get_player_name()
|
||||
if minetest.is_protected(pos, name) and not minetest.check_player_privs(name, {protection_bypass=true}) then
|
||||
minetest.record_protection_violation(pos, name)
|
||||
return
|
||||
end
|
||||
if (fields.channel) then
|
||||
minetest.get_meta(pos):set_string("channel", fields.channel)
|
||||
end
|
||||
|
Reference in New Issue
Block a user