I have this code to display when a user issues "/settings". It shows the settings the user can control and their current status (true/false), which I want to color accordingly. It works, but I want to ask for ideas to improve it's performance.
String BlockBreakingColor = "§7";
Boolean BlockBreakValue = plugin.getConfig().getBoolean("settings.block-break");
if(BlockBreakValue) {
BlockBreakingColor = "§a";
} else {
BlockBreakingColor = "§c";
}
p.sendMessage("§8» §7block-breaking §8- " + BlockBreakingColor + BlockBreakValue.toString());
My question would be if there is a better, more dynamic way of assigning the color because I would have to set this code up for every single setting and this way my code would end up having a lot of lines and be harder to read/understand.