From 658028e90a2b4e2ba2c4c8f30c7db5e92d99478a Mon Sep 17 00:00:00 2001 From: AFCMS Date: Thu, 24 Jun 2021 23:39:15 +0200 Subject: [PATCH] fixes --- mods/CORE/mcl_commands/api.lua | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/mods/CORE/mcl_commands/api.lua b/mods/CORE/mcl_commands/api.lua index 22de799f9..e4b7f6d32 100644 --- a/mods/CORE/mcl_commands/api.lua +++ b/mods/CORE/mcl_commands/api.lua @@ -90,6 +90,12 @@ mcl_commands.types = { }, } +function mcl_commands.match_param(string, type, params) + +end + +mcl_commands.registered_commands = {} + function mcl_commands.register_complex_command() end @@ -97,8 +103,10 @@ end function mcl_commands.register_basic_command(name, def) local func if def.params then + local funcparams = return else + mcl_commands.registered_commands[name] = {type = "basic", description = def.desc, privs = def.privs} func = function(name, param) if param == "" then local out, msg = def.func(name) @@ -128,6 +136,17 @@ mcl_commands.register_basic_command("test", { }) ]] +mcl_commands.register_basic_command("testb", { + description = S("testing command"), + params = { + {type="bool"}, + {type="int", params={min=1, max=10}} + }, + func = function(name, bool, int) + return true, "test: "..int + end, +}) + function mcl_commands.alias_command(alias, original_name, bypass_setting) if minetest.settings:get_bool("mcl_builtin_commands_overide", true) or bypass_setting then local def = minetest.registered_chatcommands[original_name]