summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthew I <matttpt@gmail.com>2012-07-21 21:41:27 -0400
committerPerttu Ahola <celeron55@gmail.com>2012-07-22 13:36:10 +0300
commitc62a121cca1df697604aaea0e7e6cf7ddcf8d08c (patch)
treedcaa663485151504908e6e267dc1be07363c9cff
parent136eb323893b8a03bce2cd8b20b09f2f4ade4394 (diff)
downloadminetest-c62a121cca1df697604aaea0e7e6cf7ddcf8d08c.tar.gz
minetest-c62a121cca1df697604aaea0e7e6cf7ddcf8d08c.tar.bz2
minetest-c62a121cca1df697604aaea0e7e6cf7ddcf8d08c.zip
Add "/mods" command to list mods to client
-rw-r--r--builtin/chatcommands.lua17
1 files changed, 17 insertions, 0 deletions
diff --git a/builtin/chatcommands.lua b/builtin/chatcommands.lua
index a60d3028f..f9715d92c 100644
--- a/builtin/chatcommands.lua
+++ b/builtin/chatcommands.lua
@@ -371,3 +371,20 @@ minetest.register_chatcommand("set", {
end,
})
+minetest.register_chatcommand("mods", {
+ params = "",
+ description = "lists mods installed on the server",
+ privs = {},
+ func = function(name, param)
+ local response = ""
+ local modnames = minetest.get_modnames()
+ for i, mod in ipairs(modnames) do
+ response = response .. mod
+ -- Add space if not at the end
+ if i ~= #modnames then
+ response = response .. " "
+ end
+ end
+ minetest.chat_send_player(name, response)
+ end,
+}) \ No newline at end of file