-
Notifications
You must be signed in to change notification settings - Fork 0
/
ConfigUtils.java
29 lines (24 loc) · 1 KB
/
ConfigUtils.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
package fi.natroutter.natlibs.config;
import fi.natroutter.natlibs.utilities.Colors;
import fi.natroutter.natlibs.utilities.Utilities;
import net.kyori.adventure.text.Component;
import org.bukkit.Bukkit;
import org.bukkit.command.CommandSender;
public class ConfigUtils {
protected static boolean isValidPrefix(CommandSender sender, ILang prefix) {
if (prefix != null) return true;
Component message = Colors.translate("<red>Error in language configuration : Prefix is missing or null!");
CommandSender console = Bukkit.getConsoleSender();
if (console != sender) {
console.sendMessage(message);
}
sender.sendMessage(message);
return false;
}
protected static boolean isValidPrefix(ILang prefix) {
if (prefix != null) return true;
Component message = Colors.translate("<red>Error in language configuration : Prefix is missing or null!");
Bukkit.getConsoleSender().sendMessage(message);
return false;
}
}