mirror of
https://github.com/minetest-mods/MoreMesecons.git
synced 2025-01-09 17:30:24 +01:00
commandblock: don't allow sending colored text if server forbids it (#28)
This commit is contained in:
parent
93384188d5
commit
e72790f0eb
@ -1,3 +1,5 @@
|
|||||||
|
local strip_color_codes = minetest.settings:get_bool("strip_color_codes", false)
|
||||||
|
|
||||||
local function initialize_data(meta)
|
local function initialize_data(meta)
|
||||||
local NEAREST_MAX_DISTANCE = moremesecons.setting("commandblock", "nearest_max_distance", 8, 1)
|
local NEAREST_MAX_DISTANCE = moremesecons.setting("commandblock", "nearest_max_distance", 8, 1)
|
||||||
|
|
||||||
@ -46,7 +48,11 @@ local function receive_fields(pos, _, fields, player)
|
|||||||
and player:get_player_name() ~= owner then
|
and player:get_player_name() ~= owner then
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
meta:set_string("commands", fields.commands)
|
if strip_color_codes then
|
||||||
|
meta:set_string("commands", minetest.strip_colors(fields.commands))
|
||||||
|
else
|
||||||
|
meta:set_string("commands", fields.commands)
|
||||||
|
end
|
||||||
|
|
||||||
initialize_data(meta)
|
initialize_data(meta)
|
||||||
end
|
end
|
||||||
|
Loading…
Reference in New Issue
Block a user