From b57f6be81d3a1ea1eac5a7208fb15f5217d5bd46 Mon Sep 17 00:00:00 2001 From: Eliy21 Date: Tue, 28 Nov 2023 01:37:45 +0000 Subject: [PATCH] Make showing advancement chat messages into a setting (#4032) Reviewed-on: https://git.minetest.land/MineClone2/MineClone2/pulls/4032 Reviewed-by: the-real-herowl Co-authored-by: Eliy21 Co-committed-by: Eliy21 --- mods/HUD/awards/api.lua | 4 +++- settingtypes.txt | 3 +++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/mods/HUD/awards/api.lua b/mods/HUD/awards/api.lua index 6333272bd..ca87a812c 100644 --- a/mods/HUD/awards/api.lua +++ b/mods/HUD/awards/api.lua @@ -217,7 +217,9 @@ function awards.unlock(name, award) -- Get award minetest.log("action", name.." has gotten award "..award) - minetest.chat_send_all(S("@1 has made the advancement @2", name, minetest.colorize(mcl_colors.GREEN, "[" .. (awdef.title or award) .. "]"))) + if minetest.settings:get_bool("mcl_showAdvancementMessages", true) then + minetest.chat_send_all(S("@1 has made the advancement @2", name, minetest.colorize(mcl_colors.GREEN, "[" .. (awdef.title or award) .. "]"))) + end data.unlocked[award] = award awards.save() diff --git a/settingtypes.txt b/settingtypes.txt index c2f97c817..a78b33e3b 100644 --- a/settingtypes.txt +++ b/settingtypes.txt @@ -73,6 +73,9 @@ mcl_elytra_rocket_speed (Elytra rocket speed cap) float 3.5 2.0 5.5 # If enabled, chat messages are shown to everyone when a player dies. mcl_showDeathMessages (Show death messages) bool true +# If enabled, chat messages are shown to everyone when a player makes an advancement. +mcl_showAdvancementMessages (Show advancement messages) bool true + # If enabled, the recipe book will progressively be filled with new recipes that can be crafted from all items you ever have had in your inventory. # Recommended for new players and for a spoiler-free gameplay experience. # If disabled, all recipes will be shown.