add chatcommands

This commit is contained in:
tour 2024-01-03 16:16:13 +01:00
parent 448a8acf6a
commit 2d193d092a
2 changed files with 18 additions and 5 deletions

17
chatcommands.lua Normal file
View File

@ -0,0 +1,17 @@
minetest.register_chatcommand("chat_formspec", {
params = "",
description = "send a player who refuses communication attemps via public chat a formspec to chat",
privs = {},
func = function(name, _)
chat_formspec.show_select_predefined(name)
end
})
minetest.register_chatcommand("chat_formspec_custom", {
params = "",
description = "send a player who refuses communication attemps via public chat a formspec to chat",
privs = {},
func = function(name, _)
chat_formspec.show_create_new(name)
end
})

View File

@ -5,9 +5,5 @@ local modpath = minetest.get_modpath(minetest.get_current_modname())
dofile(modpath .. "/predefined_formspecs.lua")
dofile(modpath .. "/specs.lua")
dofile(modpath .. "/show-receive.lua")
minetest.register_on_player_receive_fields(function(player, formname, fields)
print(dump(fields))
end)
dofile(modpath .. "/chatcommands.lua")