2021-12-29 02:28:50 +00:00
|
|
|
// This claas was created by JaTiTV
|
|
|
|
|
|
|
|
|
|
|
|
package de.jatitv.opsecurity.config.languages;
|
2022-01-05 00:49:27 +00:00
|
|
|
|
2022-01-06 01:08:20 +00:00
|
|
|
import de.jatitv.opsecurity.Util;
|
2021-12-29 02:28:50 +00:00
|
|
|
import de.jatitv.opsecurity.config.config.SelectConfig;
|
|
|
|
import de.jatitv.opsecurity.system.Main;
|
2022-01-06 01:08:20 +00:00
|
|
|
import net.t2code.lib.Spigot.Lib.messages.send;
|
|
|
|
import net.t2code.lib.Spigot.Lib.replace.Replace;
|
2021-12-29 02:28:50 +00:00
|
|
|
import org.bukkit.configuration.file.YamlConfiguration;
|
|
|
|
|
|
|
|
import java.io.File;
|
|
|
|
|
|
|
|
public class SelectMessages {
|
|
|
|
|
|
|
|
public static String selectMSG;
|
|
|
|
|
|
|
|
public static String SoundNotFound;
|
|
|
|
|
|
|
|
public static String NoPermission;
|
|
|
|
public static String PlayerMustBeOnlineToOp;
|
|
|
|
public static String ReloadStart;
|
|
|
|
public static String ReloadEnd;
|
|
|
|
|
2022-01-05 00:49:27 +00:00
|
|
|
public static String OP_opCommand;
|
|
|
|
public static String OP_consoleOnJoin;
|
2021-12-29 02:28:50 +00:00
|
|
|
public static String OP_deop;
|
2022-01-05 00:49:27 +00:00
|
|
|
public static String OP_consoleDeop;
|
2021-12-29 02:28:50 +00:00
|
|
|
public static String OP_kick;
|
2022-01-05 00:49:27 +00:00
|
|
|
public static String OP_consoleKick;
|
|
|
|
public static String ExactReason;
|
2021-12-29 02:28:50 +00:00
|
|
|
|
2022-01-05 00:49:27 +00:00
|
|
|
public static String Perm_consoleOnJoin;
|
2021-12-29 02:28:50 +00:00
|
|
|
public static String Perm_kick;
|
|
|
|
public static String Perm_consoleKick;
|
|
|
|
|
|
|
|
public static String LuckPerms;
|
|
|
|
|
|
|
|
public static void selectCreate(String Prefix) {
|
|
|
|
|
|
|
|
send.debug(Main.plugin, "§4Select language...");
|
|
|
|
Long long_ = Long.valueOf(System.currentTimeMillis());
|
|
|
|
|
|
|
|
File msg;
|
|
|
|
|
|
|
|
msg = new File(Main.getPath(), "languages/" + SelectConfig.language + "_messages.yml");
|
|
|
|
if (!msg.isFile()) {
|
|
|
|
send.console(Prefix);
|
|
|
|
send.console(Prefix + " §4!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!");
|
|
|
|
send.console(Prefix + " §4The selected §c" + SelectConfig.language + " §4language file was not found.");
|
|
|
|
send.console(Prefix + " §6The default language §eEnglish §6is used!");
|
|
|
|
send.console(Prefix + " §4!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!");
|
|
|
|
send.console(Prefix);
|
|
|
|
msg = new File(Main.getPath(), "languages/" + "english_messages.yml");
|
|
|
|
selectMSG = "english";
|
|
|
|
} else selectMSG = SelectConfig.language;
|
|
|
|
YamlConfiguration yamlConfiguration = YamlConfiguration.loadConfiguration(msg);
|
|
|
|
|
|
|
|
SoundNotFound = select("Plugin.SoundNotFound", yamlConfiguration);
|
|
|
|
NoPermission = select("Plugin.NoPermission", yamlConfiguration);
|
|
|
|
ReloadStart = select("Plugin.Reload.Start", yamlConfiguration);
|
|
|
|
ReloadEnd = select("Plugin.Reload.End", yamlConfiguration);
|
|
|
|
PlayerMustBeOnlineToOp = select("Plugin.PlayerMustBeOnlineToOp", yamlConfiguration);
|
|
|
|
|
|
|
|
OP_opCommand = select("OP_Whitelist.opCommand", yamlConfiguration);
|
|
|
|
OP_deop = select("OP_Whitelist.deop", yamlConfiguration);
|
|
|
|
OP_consoleDeop = select("OP_Whitelist.consoleDeop", yamlConfiguration);
|
|
|
|
OP_consoleOnJoin = select("OP_Whitelist.consoleOnJoin", yamlConfiguration);
|
|
|
|
OP_kick = select("OP_Whitelist.kick", yamlConfiguration);
|
|
|
|
OP_consoleKick = select("OP_Whitelist.consoleKick", yamlConfiguration);
|
|
|
|
|
2022-01-05 00:49:27 +00:00
|
|
|
|
2021-12-29 02:28:50 +00:00
|
|
|
Perm_consoleOnJoin = select("Permission_Whitelist.consoleOnJoin", yamlConfiguration);
|
|
|
|
Perm_kick = select("Permission_Whitelist.kick", yamlConfiguration);
|
|
|
|
Perm_consoleKick = select("Permission_Whitelist.consoleKick", yamlConfiguration);
|
2022-01-05 00:49:27 +00:00
|
|
|
ExactReason = select("Console.ExactKickReason", yamlConfiguration);
|
2021-12-29 02:28:50 +00:00
|
|
|
|
2022-01-05 00:49:27 +00:00
|
|
|
send.console(Prefix + " §2Language successfully selected to: §6" + selectMSG + " §7- §e" + (System.currentTimeMillis() - long_.longValue()) + "ms");
|
2021-12-29 02:28:50 +00:00
|
|
|
}
|
2022-01-05 00:49:27 +00:00
|
|
|
|
|
|
|
private static String select(String path, YamlConfiguration yamlConfiguration) {
|
2022-01-06 01:08:20 +00:00
|
|
|
return Replace.replace(Util.getPrefix(),yamlConfiguration.getString(path));
|
2021-12-29 02:28:50 +00:00
|
|
|
}
|
|
|
|
}
|