gchat logging config boolean

This commit is contained in:
speedxx 2020-07-29 17:49:19 -04:00
parent 27859eddac
commit b8403f0bf9
3 changed files with 15 additions and 1 deletions

View file

@ -21,4 +21,9 @@ public enum ConfigEntry
{
return ChatColor.valueOf(config.getString(path).toUpperCase());
}
public static boolean isLoggingGuildChat()
{
return config.getBoolean("server.guild_chat_logging.enabled");
}
}

View file

@ -4,6 +4,7 @@ import lombok.Getter;
import lombok.Setter;
import me.totalfreedom.tfguilds.TFGuilds;
import me.totalfreedom.tfguilds.Common;
import me.totalfreedom.tfguilds.config.ConfigEntry;
import me.totalfreedom.tfguilds.util.GLog;
import me.totalfreedom.tfguilds.util.GUtil;
import org.apache.commons.lang.StringUtils;
@ -288,7 +289,11 @@ public class Guild
public void chat(String as, String msg)
{
broadcast(Common.tl("%s%[%p%Guild Chat %s%| %p%" + GUtil.colorize(name) + "%s%] %p%" + as + ChatColor.WHITE + ": %p%" + msg));
GLog.info(Common.tl("%s%[%p%Guild Chat %s%| %p%" + GUtil.colorize(name) + "%s%] %p%" + as + ChatColor.WHITE + ": %p%" + msg));
if (ConfigEntry.isLoggingGuildChat())
{
GLog.info(Common.tl("%s%[%p%Guild Chat %s%| %p%" + GUtil.colorize(name) + "%s%] %p%" + as + ChatColor.WHITE + ": %p%" + msg));
}
for (Player player : Bukkit.getOnlinePlayers())
{

View file

@ -2,6 +2,10 @@
# TFGuilds - Configuration
#
server:
guild_chat_logging:
enabled: true
scheme:
primary: GREEN
secondary: DARK_GREEN