use of com.github.sirblobman.api.language.LanguageManager in project CombatLogX by SirBlobman.
the class CustomScoreboard method updateScoreboard.
public void updateScoreboard() {
List<String> lineList = getLines();
int lineListSize = lineList.size();
for (int line = 16; line > 0; line--) {
int index = (16 - line);
if (index >= lineListSize) {
removeLine(line);
continue;
}
String value = lineList.get(index);
setLine(line, value);
}
Player player = getPlayer();
LanguageManager languageManager = getLanguageManager();
String title = languageManager.getMessage(player, "expansion.scoreboard.title", null, true);
String titleReplaced = replacePlaceholders(title);
this.objective.setDisplayName(titleReplaced);
}
use of com.github.sirblobman.api.language.LanguageManager in project CombatLogX by SirBlobman.
the class CombatPlugin method broadcastDisableMessage.
private void broadcastDisableMessage() {
ConfigurationManager configurationManager = getConfigurationManager();
YamlConfiguration configuration = configurationManager.get("config.yml");
if (!configuration.getBoolean("broadcast.on-disable")) {
return;
}
LanguageManager languageManager = getLanguageManager();
languageManager.broadcastMessage("broadcast.on-disable", null, true);
}
use of com.github.sirblobman.api.language.LanguageManager in project CombatLogX by SirBlobman.
the class CombatPlugin method getMessageWithPrefix.
@Override
public String getMessageWithPrefix(CommandSender sender, String key, Replacer replacer, boolean color) {
LanguageManager languageManager = getLanguageManager();
String message = languageManager.getMessage(sender, key, replacer, color);
if (message.isEmpty()) {
return "";
}
String prefix = languageManager.getMessage(sender, "prefix", null, true);
if (prefix.isEmpty()) {
return message;
}
if (!color)
ChatColor.stripColor(prefix);
return String.format(Locale.US, "%s %s", prefix, message);
}
use of com.github.sirblobman.api.language.LanguageManager in project CombatLogX by SirBlobman.
the class CombatPlugin method onReload.
@Override
public void onReload() {
ConfigurationManager configurationManager = getConfigurationManager();
List<String> fileNameList = Arrays.asList("commands.yml", "config.yml", "punish.yml");
for (String fileName : fileNameList) {
configurationManager.reload(fileName);
}
LanguageManager languageManager = getLanguageManager();
languageManager.reloadLanguages();
IPunishManager punishManager = getPunishManager();
punishManager.loadPunishments();
ExpansionManager expansionManager = getExpansionManager();
expansionManager.reloadConfigs();
}
use of com.github.sirblobman.api.language.LanguageManager in project CombatLogX by SirBlobman.
the class CombatPlugin method broadcastLoadMessage.
private void broadcastLoadMessage() {
ConfigurationManager configurationManager = getConfigurationManager();
YamlConfiguration configuration = configurationManager.get("config.yml");
if (!configuration.getBoolean("broadcast.on-load")) {
return;
}
LanguageManager languageManager = getLanguageManager();
languageManager.broadcastMessage("broadcast.on-load", null, true);
}
Aggregations