From c572c27326456eaf45fb9ef38d60bd9918b456d4 Mon Sep 17 00:00:00 2001 From: chmodsayshello Date: Mon, 31 Oct 2022 21:40:38 +0000 Subject: [PATCH] implement suggestions by cora (https://is.gd/jJRf3y) --- mods/HUD/awards/chat_commands.lua | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/mods/HUD/awards/chat_commands.lua b/mods/HUD/awards/chat_commands.lua index 88af4962b..b15668822 100644 --- a/mods/HUD/awards/chat_commands.lua +++ b/mods/HUD/awards/chat_commands.lua @@ -20,6 +20,11 @@ minetest.register_chatcommand("awards", { params = S("[c|clear|disable|enable]"), description = S("Show, clear, disable or enable your advancements."), func = function(name, param) + if param == "enable" then + awards.enable(name) + minetest.chat_send_player(name, S("You have enabled your advancements.")) + end + if awards.player(name).disabled then minetest.chat_send_player(name, S("Awards are disabled, enable them first by using /awards enable!")) return @@ -32,13 +37,8 @@ minetest.register_chatcommand("awards", { elseif param == "disable" then awards.disable(name) minetest.chat_send_player(name, S("You have disabled your advancements.")) - elseif param == "enable" then - awards.enable(name) - minetest.chat_send_player(name, S("You have enabled your advancements.")) - elseif param == "c" then + else param == "c" then awards.show_to(name, name, nil, true) - else - awards.show_to(name, name, nil, false) end end })