From b1ab79b857a4d83eae2752c01518c73f99dadca2 Mon Sep 17 00:00:00 2001 From: AFCMS Date: Fri, 5 Mar 2021 10:22:52 +0100 Subject: [PATCH] fix last command --- mods/MISC/mcl_commands/init.lua | 21 ++------------------- mods/MISC/mcl_commands/list.lua | 14 ++++++++++++++ 2 files changed, 16 insertions(+), 19 deletions(-) create mode 100644 mods/MISC/mcl_commands/list.lua diff --git a/mods/MISC/mcl_commands/init.lua b/mods/MISC/mcl_commands/init.lua index 354d555941..c078e5872e 100644 --- a/mods/MISC/mcl_commands/init.lua +++ b/mods/MISC/mcl_commands/init.lua @@ -9,23 +9,6 @@ dofile(modpath.."/setblock.lua") dofile(modpath.."/seed.lua") dofile(modpath.."/summon.lua") dofile(modpath.."/say.lua") +dofile(modpath.."/list.lua") -dofile(modpath.."/alias.lua") - - -minetest.register_chatcommand("list", { - description = S("Show who is logged on"), - params = "", - privs = {}, - func = function(name) - local players = "" - for _, player in ipairs(minetest.get_connected_players()) do - players = players..player:get_player_name().."\n" - end - minetest.chat_send_player(name, players) - end -}) - - - - +dofile(modpath.."/alias.lua") \ No newline at end of file diff --git a/mods/MISC/mcl_commands/list.lua b/mods/MISC/mcl_commands/list.lua new file mode 100644 index 0000000000..0257e2837c --- /dev/null +++ b/mods/MISC/mcl_commands/list.lua @@ -0,0 +1,14 @@ +local S = minetest.get_translator("mcl_commands") + +minetest.register_chatcommand("list", { + description = S("Show who is logged on"), + params = "", + privs = {}, + func = function(name) + local players = "" + for _, player in ipairs(minetest.get_connected_players()) do + players = players..player:get_player_name().."\n" + end + minetest.chat_send_player(name, players) + end +}) \ No newline at end of file