fix: gradient messages now properly process colors through ChatFormatter
This commit is contained in:
parent
3fddf48cb3
commit
76f3c480ad
1 changed files with 5 additions and 3 deletions
|
|
@ -1,5 +1,6 @@
|
|||
package com.loki.lochat.gradient.config;
|
||||
|
||||
import com.loki.lochat.utils.ChatFormatter;
|
||||
import org.bukkit.configuration.file.FileConfiguration;
|
||||
import org.bukkit.configuration.file.YamlConfiguration;
|
||||
import org.bukkit.plugin.java.JavaPlugin;
|
||||
|
|
@ -43,16 +44,17 @@ public class GradientMessages {
|
|||
}
|
||||
|
||||
public String get(String key) {
|
||||
return messages.getString(key, "§cСообщение не найдено: " + key);
|
||||
String message = messages.getString(key, "&#FF0000Сообщение не найдено: " + key);
|
||||
return ChatFormatter.convertAllColors(message);
|
||||
}
|
||||
|
||||
public String get(String key, String... replacements) {
|
||||
String message = get(key);
|
||||
String message = messages.getString(key, "&#FF0000Сообщение не найдено: " + key);
|
||||
for (int i = 0; i < replacements.length; i += 2) {
|
||||
if (i + 1 < replacements.length) {
|
||||
message = message.replace("{" + replacements[i] + "}", replacements[i + 1]);
|
||||
}
|
||||
}
|
||||
return message;
|
||||
return ChatFormatter.convertAllColors(message);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue