code changes

This commit is contained in:
2022-01-06 02:21:27 +01:00
parent 7afbdd695c
commit 8377667f55
25 changed files with 241 additions and 383 deletions

View File

@@ -0,0 +1,191 @@
package de.jatitv.commandguiv2.Spigot.config;
import de.jatitv.commandguiv2.Spigot.Main;
import net.t2code.lib.Spigot.Lib.messages.send;
import net.t2code.lib.Spigot.Lib.minecraftVersion.MCVersion;
import org.bukkit.configuration.file.YamlConfiguration;
import java.io.File;
import java.io.IOException;
import java.util.Arrays;
import java.util.List;
public class DefaultGUICreate {
private static Boolean GUI_Enable = true;
private static Integer GUI_Lines = 1;
private static String GUI_Name = "&5default &9GUI";
private static Boolean GUI_FillItem_Enable = true;
private static Integer GUI_FillItem_Item_1_8 = 15;
private static String GUI_FillItem_Item = "BLACK_STAINED_GLASS_PANE";
private static Boolean Command_Alias = true;
private static Boolean Command_Permission = true;
private static Integer slot = 5;
private static Boolean enable = true;
private static Boolean ItemEmty = false;
private static Integer ItemAmout = 1;
private static Boolean Playerhead_enable = true;
private static Boolean base64_Enable = true;
private static String base64value = "eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvNzg3M2MxMmJmZmI1MjUxYTBiODhkNWFlNzVjNzI0N2NiMzlhNzVmZjFhODFjYmU0YzhhMzliMzExZGRlZGEifX19";
private static Boolean PlayerWhoHasOpenedTheGUI = false;
private static String PlayerName = "";
private static String Item = "";
private static String Itemname = "&3Support Discord";
private static List ItemLore = Arrays.asList(
"&8-----------------",
"&bIf you need help setting up the plugin,",
"&bfeel free to contact me on the Suport Discord.",
"&8-----------------",
"&eIf you find any errors or bugs,",
"&eplease contact me so I can fix them.",
"&8-----------------",
"&5Discord: §7http://dc.t2code.net");
private static Boolean CustomSound = false;
private static Boolean CustomSound_NoSound = false;
private static String CustomSound_Sound = "";
private static Boolean Cost = false;
private static Double Cost_Price = 0.0;
private static Boolean Command = false;
private static Boolean BungeeCommand = false;
private static Boolean CommandAsConsole = false;
private static List Commands = Arrays.asList();
private static Boolean Server_Change = false;
private static String Server_Change_Server = "";
private static Boolean OpenGUI = false;
private static String OpenGUI_GUI = "";
private static Boolean Message = true;
private static List Messages = Arrays.asList("&6You can find more information on Discord: &ehttp://dc.t2code.net");
private static Boolean Permission = false;
private static Boolean SetConfig_Enable = false;
private static String SetConfig_FilePath = "";
private static String SetConfig_OptionPath = "";
private static String SetConfig_OptionPremat = "String";
private static String SetConfig_ValueLeftString = "";
private static Boolean SetConfig_ValueLeftBoolean = false;
private static Integer SetConfig_ValueLeftInteger = 0;
private static Double SetConfig_ValueLeftDouble = 0.0;
private static List SetConfig_ValueLeftList = Arrays.asList();
private static String SetConfig_ValueRightString = "";
private static Boolean SetConfig_ValueRightBoolean = false;
private static Integer SetConfig_ValueRightInteger = 0;
private static Double SetConfig_ValueRightDouble = 0.0;
private static List SetConfig_ValueRightList = Arrays.asList();
private static Boolean SetConfig_PluginReloadEnable = false;
private static String SetConfig_PluginReloadCommand = "";
public static void configCreate() {
Long long_ = Long.valueOf(System.currentTimeMillis());
send.console(Main.prefix + " §4Default GUI file (GUIs/default.yml) is loaded...");
File config = new File(Main.getPath(), "GUIs/default.yml");
YamlConfiguration yamlConfiguration = YamlConfiguration.loadConfiguration(config);
set("GUI.Enable", GUI_Enable, yamlConfiguration);
set("GUI.Lines", GUI_Lines, yamlConfiguration);
set("GUI.Name", GUI_Name, yamlConfiguration);
set("GUI.FillItem.Enable", GUI_FillItem_Enable, yamlConfiguration);
if (MCVersion.minecraft1_8 || MCVersion.minecraft1_9 || MCVersion.minecraft1_10 || MCVersion.minecraft1_11 || MCVersion.minecraft1_12) {
set("GUI.FillItem.GlassPaneCollor", GUI_FillItem_Item_1_8, yamlConfiguration);
} else set("GUI.FillItem.Item", GUI_FillItem_Item, yamlConfiguration);
set("Command.Alias", Command_Alias, yamlConfiguration);
set("Command.Permission.Required", Command_Permission, yamlConfiguration);
set("Slots.Example.Slot", slot, yamlConfiguration);
set("Slots.Example.Enable", enable, yamlConfiguration);
set("Slots.Example.Item.Empty", ItemEmty, yamlConfiguration);
set("Slots.Example.Item.Amount", ItemAmout, yamlConfiguration);
if (!(MCVersion.minecraft1_8 || MCVersion.minecraft1_9 || MCVersion.minecraft1_10 || MCVersion.minecraft1_11 || MCVersion.minecraft1_12)) {
set("Slots.Example.Item.PlayerHead.Enable", Playerhead_enable, yamlConfiguration);
set("Slots.Example.Item.PlayerHead.Base64.Enable", base64_Enable, yamlConfiguration);
set("Slots.Example.Item.PlayerHead.Base64.Base64Value", base64value, yamlConfiguration);
set("Slots.Example.Item.PlayerHead.PlayerWhoHasOpenedTheGUI", PlayerWhoHasOpenedTheGUI, yamlConfiguration);
set("Slots.Example.Item.PlayerHead.PlayerName", PlayerName, yamlConfiguration);
}
if (MCVersion.minecraft1_8 || MCVersion.minecraft1_9 || MCVersion.minecraft1_10 || MCVersion.minecraft1_11 || MCVersion.minecraft1_12) {
set("Slots.Example.Item.Material", "TNT", yamlConfiguration);
} else set("Slots.Example.Item.Material", Item, yamlConfiguration);
set("Slots.Example.Item.Name", Itemname, yamlConfiguration);
set("Slots.Example.Item.Lore", ItemLore, yamlConfiguration);
set("Slots.Example.CustomSound.Enable", CustomSound, yamlConfiguration);
set("Slots.Example.CustomSound.NoSound", CustomSound_NoSound, yamlConfiguration);
set("Slots.Example.CustomSound.Sound", CustomSound_Sound, yamlConfiguration);
set("Slots.Example.Cost.Enable", Cost, yamlConfiguration);
set("Slots.Example.Cost.Price", Cost_Price, yamlConfiguration);
set("Slots.Example.Command.Enable", Command, yamlConfiguration);
set("Slots.Example.Command.BungeeCommand", BungeeCommand, yamlConfiguration);
set("Slots.Example.Command.CommandAsConsole", CommandAsConsole, yamlConfiguration);
set("Slots.Example.Command.Command", Commands, yamlConfiguration);
set("Slots.Example.ServerChange.Enable", Server_Change, yamlConfiguration);
set("Slots.Example.ServerChange.Server", Server_Change_Server, yamlConfiguration);
set("Slots.Example.OpenGUI.Enable", OpenGUI, yamlConfiguration);
set("Slots.Example.OpenGUI.GUI", OpenGUI_GUI, yamlConfiguration);
set("Slots.Example.Message.Enable", Message, yamlConfiguration);
set("Slots.Example.Message.Message", Messages, yamlConfiguration);
set("Slots.Example.Permission.Required", Permission, yamlConfiguration);
set("Slots.Example.SetConfig.Enable", SetConfig_Enable, yamlConfiguration);
set("Slots.Example.SetConfig.File.Path", SetConfig_FilePath, yamlConfiguration);
set("Slots.Example.SetConfig.Option.Path", SetConfig_OptionPath, yamlConfiguration);
set("Slots.Example.SetConfig.Option.Premat", SetConfig_OptionPremat, yamlConfiguration);
set("Slots.Example.SetConfig.Value.LeftClick.String", SetConfig_ValueLeftString, yamlConfiguration);
set("Slots.Example.SetConfig.Value.LeftClick.Boolean", SetConfig_ValueLeftBoolean, yamlConfiguration);
set("Slots.Example.SetConfig.Value.LeftClick.Integer", SetConfig_ValueLeftInteger, yamlConfiguration);
set("Slots.Example.SetConfig.Value.LeftClick.Double", SetConfig_ValueLeftDouble, yamlConfiguration);
set("Slots.Example.SetConfig.Value.LeftClick.List", SetConfig_ValueLeftList, yamlConfiguration);
set("Slots.Example.SetConfig.Value.RightClick.String", SetConfig_ValueRightString, yamlConfiguration);
set("Slots.Example.SetConfig.Value.RightClick.Boolean", SetConfig_ValueRightBoolean, yamlConfiguration);
set("Slots.Example.SetConfig.Value.RightClick.Integer", SetConfig_ValueRightInteger, yamlConfiguration);
set("Slots.Example.SetConfig.Value.RightClick.Double", SetConfig_ValueRightDouble, yamlConfiguration);
set("Slots.Example.SetConfig.Value.RightClick.List", SetConfig_ValueRightList, yamlConfiguration);
set("Slots.Example.SetConfig.PluginReload.Enable", SetConfig_PluginReloadEnable, yamlConfiguration);
set("Slots.Example.SetConfig.PluginReload.Command", SetConfig_PluginReloadCommand, yamlConfiguration);
try {
yamlConfiguration.save(config);
} catch (IOException e) {
e.printStackTrace();
}
send.console(Main.prefix + " §2Default GUI file (GUIs/default.yml) was loaded." + " §7- §e" + (System.currentTimeMillis() - long_.longValue()) + "ms");
}
private static void set(String path, String value, YamlConfiguration config) {
if (!config.contains(path)) {
config.set(path, value);
}
}
private static void set(String path, Integer value, YamlConfiguration config) {
if (!config.contains(path)) {
config.set(path, value);
}
}
private static void set(String path, Boolean value, YamlConfiguration config) {
if (!config.contains(path)) {
config.set(path, value);
}
}
private static void set(String path, List value, YamlConfiguration config) {
if (!config.contains(path)) {
config.set(path, value);
}
}
private static void set(String path, Double value, YamlConfiguration config) {
if (!config.contains(path)) {
config.set(path, value);
}
}
}

View File

@@ -0,0 +1,152 @@
package de.jatitv.commandguiv2.Spigot.config.config;
import de.jatitv.commandguiv2.Spigot.Main;
import de.jatitv.commandguiv2.Util;
import net.t2code.lib.Spigot.Lib.messages.send;
import net.t2code.lib.Spigot.Lib.minecraftVersion.MCVersion;
import net.t2code.lib.Spigot.Lib.yamlConfiguration.Config;
import org.bukkit.configuration.file.YamlConfiguration;
import java.io.File;
import java.io.IOException;
import java.util.Arrays;
public class ConfigCreate {
public static Integer ConfigVersion = 3;
public static void configCreate() {
Long long_ = Long.valueOf(System.currentTimeMillis());
if (new File(Main.getPath(), "config.yml").exists()) {
if (Main.plugin.getConfig().getBoolean("Plugin.Debug")) send.console(Main.prefix + " §5DEBUG: §6" + " §4config.yml are created / updated...");
} else send.console(Main.prefix + " §4config.yml are created...");
File config = new File(Main.getPath(), "config.yml");
YamlConfiguration yamlConfiguration = YamlConfiguration.loadConfiguration(config);
if (yamlConfiguration.getInt("ConfigVersion") < ConfigVersion) {
send.console(Util.getPrefix() +" §4----------------------");
send.console(Util.getPrefix() +" ");
send.console(Util.getPrefix() +" §6New features have been added to CommandGUI. The Config is adapted!");
send.console(Util.getPrefix() +" ");
send.console(Util.getPrefix() +" §4----------------------");
}
yamlConfiguration.set("ConfigVersion", ConfigVersion);
Config.set("Plugin.UpdateCheckOnJoin", true, yamlConfiguration);
Config.set("Plugin.Debug", false, yamlConfiguration);
Config.set("Plugin.HelpAlias", true, yamlConfiguration);
Config.set("Plugin.language", "english", yamlConfiguration);
Config.set("Plugin.Currency", "$", yamlConfiguration);
Config.set("Plugin.DefaultGUI", "default", yamlConfiguration);
Config.set("Storage.Type", "YML", yamlConfiguration);
Config.set("Storage.MySQL.IP", "localhost", yamlConfiguration);
Config.set("Storage.MySQL.Port", 3306, yamlConfiguration);
Config.set("Storage.MySQL.Database", "database", yamlConfiguration);
Config.set("Storage.MySQL.User", "root", yamlConfiguration);
Config.set("Storage.MySQL.Password", "password", yamlConfiguration);
Config.set("Storage.MySQL.SSL", false, yamlConfiguration);
Config.set("BungeeCord.Enable", false, yamlConfiguration);
Config.set("BungeeCord.ThisServer", "server", yamlConfiguration);
Config.set("UseItem.Enable", true, yamlConfiguration);
Config.set("UseItem.AllowToggle", true, yamlConfiguration);
Config.set("UseItem.AllowSetSlot", true, yamlConfiguration);
Config.set("UseItem.BlockMoveAndDrop", true, yamlConfiguration);
Config.set("UseItem.OpenGUI", "default", yamlConfiguration);
Config.set("UseItem.Permission.NeededToUse", true, yamlConfiguration);
Config.set("UseItem.KeepAtCommandClear", true, yamlConfiguration);
Config.set("UseItem.InventorySlot.Slot", 1, yamlConfiguration);
Config.set("UseItem.InventorySlot.SlotEnforce", false, yamlConfiguration);
Config.set("UseItem.InventorySlot.FreeSlot", false, yamlConfiguration);
Config.set("UseItem.Item.Material", "paper", yamlConfiguration);
if (!(MCVersion.minecraft1_8 || MCVersion.minecraft1_9 || MCVersion.minecraft1_10 || MCVersion.minecraft1_11 || MCVersion.minecraft1_12)) {
Config.set("UseItem.Item.PlayerHead.Enable", false, yamlConfiguration);
Config.set("UseItem.Item.PlayerHead.Base64.Enable", false, yamlConfiguration);
Config.set("UseItem.Item.PlayerHead.Base64.Base64Value", "", yamlConfiguration);
Config.set("UseItem.Item.PlayerHead.PlayerWhoHasOpenedTheGUI", false, yamlConfiguration);
Config.set("UseItem.Item.PlayerHead.Playername", "", yamlConfiguration);
}
Config.set("UseItem.Item.Name", "&bDefault &6GUI", yamlConfiguration);
Config.set("UseItem.Item.Lore", Arrays.asList("&eThis is an example GUI"), yamlConfiguration);
Config.set("UseItem.Join.GiveOnEveryJoin", true, yamlConfiguration);
Config.set("UseItem.Join.GiveOnlyOnFirstJoin", false, yamlConfiguration);
//convert
if (yamlConfiguration.contains("UseItem.Join.Cursor.ToGUIItem.OnEveryLogin")) {
Config.set("UseItem.Join.Cursor.ToGUIItem.OnEveryLogin", yamlConfiguration);
Config.set("UseItem.Join.Cursor.ToGUIItem.OnLogin.Enable", yamlConfiguration.getBoolean("UseItem.Join.Cursor.ToGUIItem.OnEveryLogin"), yamlConfiguration);
}
if (yamlConfiguration.contains("UseItem.Join.Cursor.ToGUIItem.OnOnlyFirstLogin")) {
Config.set("UseItem.Join.Cursor.ToGUIItem.OnOnlyFirstLogin", yamlConfiguration);
Config.set("UseItem.Join.Cursor.ToGUIItem.Spigot.OnOnlyFirstLogin", yamlConfiguration.getBoolean("UseItem.Join.Cursor.ToGUIItem.OnOnlyFirstLogin"), yamlConfiguration);
}
if (yamlConfiguration.contains("UseItem.Join.Cursor.ToGUIItem.EXPERIMENTELL_ServerChange")) {
Config.set("UseItem.Join.Cursor.ToGUIItem.EXPERIMENTELL_ServerChange", yamlConfiguration);
Config.set("UseItem.Join.Cursor.ToGUIItem.Bungee.OnServerChange", yamlConfiguration.getBoolean("UseItem.Join.Cursor.ToGUIItem.EXPERIMENTELL_ServerChange"), yamlConfiguration);
}
Config.set("UseItem.Join.Cursor.ToGUIItem.OnLogin.Enable", true, yamlConfiguration);
Config.set("UseItem.Join.Cursor.ToGUIItem.Spigot.OnOnlyFirstLogin", true, yamlConfiguration);
Config.set("UseItem.Join.Cursor.ToGUIItem.Bungee.OnServerChange", false, yamlConfiguration);
Config.set("Advanced.UseItem.GameModeChange.Enable", true, yamlConfiguration);
Config.set("Advanced.UseItem.GameModeChange.DelayInTicks", 1, yamlConfiguration);
Config.set("Advanced.UseItem.GameModeChange.Protection.Enable", false, yamlConfiguration);
Config.set("Advanced.UseItem.GameModeChange.Protection.Mode", "blacklist", yamlConfiguration);
Config.set("Advanced.UseItem.GameModeChange.Protection.List", Arrays.asList("CREATIVE", "Spectator"), yamlConfiguration);
Config.set("Sound.Enable", true, yamlConfiguration);
Config.set("Sound.OpenInventory.Enable", true, yamlConfiguration);
if (MCVersion.minecraft1_8) {
Config.set("Sound.OpenInventory.Sound", "CHEST_OPEN", yamlConfiguration);
} else Config.set("Sound.OpenInventory.Sound", "BLOCK_CHEST_OPEN", yamlConfiguration);
Config.set("Sound.Click.Enable", true, yamlConfiguration);
if (MCVersion.minecraft1_8) {
Config.set("Sound.Click.Sound", "NOTE_STICKS", yamlConfiguration);
} else if (MCVersion.minecraft1_9 || MCVersion.minecraft1_10 || MCVersion.minecraft1_11 || MCVersion.minecraft1_12) {
Config.set("Sound.Click.Sound", "BLOCK_NOTE_HAT", yamlConfiguration);
} else Config.set("Sound.Click.Sound", "BLOCK_NOTE_BLOCK_HAT", yamlConfiguration);
Config.set("Sound.NoMoney.Enable", true, yamlConfiguration);
if (MCVersion.minecraft1_8) {
Config.set("Sound.NoMoney.Sound", "NOTE_PIANO", yamlConfiguration);
} else if (MCVersion.minecraft1_9 || MCVersion.minecraft1_10 || MCVersion.minecraft1_11 || MCVersion.minecraft1_12) {
Config.set("Sound.NoMoney.Sound", "BLOCK_NOTE_HARP", yamlConfiguration);
} else Config.set("Sound.NoMoney.Sound", "BLOCK_NOTE_BLOCK_HARP", yamlConfiguration);
Config.set("Sound.NoInventorySpace.Enable", true, yamlConfiguration);
if (MCVersion.minecraft1_8) {
Config.set("Sound.NoInventorySpace.Sound", "NOTE_PIANO", yamlConfiguration);
} else if (MCVersion.minecraft1_9 || MCVersion.minecraft1_10 || MCVersion.minecraft1_11 || MCVersion.minecraft1_12) {
Config.set("Sound.NoInventorySpace.Sound", "BLOCK_NOTE_HARP", yamlConfiguration);
} else Config.set("Sound.NoInventorySpace.Sound", "BLOCK_NOTE_BLOCK_HARP", yamlConfiguration);
Config.set("Sound.Give.Enable", true, yamlConfiguration);
if (MCVersion.minecraft1_8) {
Config.set("Sound.Give.Sound", "LEVEL_UP", yamlConfiguration);
} else Config.set("Sound.Give.Sound", "ENTITY_PLAYER_LEVELUP", yamlConfiguration);
Config.set("Sound.PlayerNotFound.Enable", true, yamlConfiguration);
if (MCVersion.minecraft1_8) {
Config.set("Sound.PlayerNotFound.Sound", "NOTE_PIANO", yamlConfiguration);
} else if (MCVersion.minecraft1_9 || MCVersion.minecraft1_10 || MCVersion.minecraft1_11 || MCVersion.minecraft1_12) {
Config.set("Sound.PlayerNotFound.Sound", "BLOCK_NOTE_HARP", yamlConfiguration);
} else Config.set("Sound.PlayerNotFound.Sound", "BLOCK_NOTE_BLOCK_HARP", yamlConfiguration);
try {
yamlConfiguration.save(config);
} catch (IOException e) {
e.printStackTrace();
}
send.console(Main.prefix + " §2config.yml were successfully created / updated." + " §7- §e" + (System.currentTimeMillis() - long_.longValue()) + "ms");
}
}

View File

@@ -0,0 +1,292 @@
package de.jatitv.commandguiv2.Spigot.config.config;
import de.jatitv.commandguiv2.Spigot.Main;
import de.jatitv.commandguiv2.Spigot.config.languages.SelectMessages;
import de.jatitv.commandguiv2.Spigot.system.database.MySQL;
import de.jatitv.commandguiv2.Util;
import net.t2code.lib.Spigot.Lib.messages.send;
import net.t2code.lib.Spigot.Lib.minecraftVersion.MCVersion;
import net.t2code.lib.Spigot.Lib.replace.Replace;
import org.bukkit.Sound;
import org.bukkit.configuration.file.YamlConfiguration;
import java.io.File;
import java.util.List;
public class SelectConfig {
public static Boolean DisableUpdateChecker;
public static Boolean UpdateCheckOnJoin;
public static Boolean Debug;
public static Boolean HelpAlias;
public static String language;
public static String Currency;
public static String Storage;
public static Boolean Bungee;
public static String thisServer;
public static String DefaultGUI;
public static Boolean UseItem_Enable;
public static Boolean UseItem_AllowToggle;
public static Boolean UseItem_AllowSetSlot;
public static Boolean UseItem_GiveOnEveryJoin;
public static Boolean UseItem_GiveOnlyOnFirstJoin;
public static Boolean UseItem_ServerChange;
public static Boolean Cursor_ToGUIItem_OnLogin;
public static Boolean Cursor_ToGUIItem_OnlyOnFirstLogin;
public static Boolean UseItem_BlockMoveAndDrop;
public static String UseItem_OpenGUI;
public static Boolean UseItem_Permission;
public static Boolean UseItem_KeepAtCommandClear;
public static Boolean UseItemGameModeChangeEnable;
public static int UseItemGameModeChangeDelayInTicks;
public static Boolean UseItemGameModeProtection;
public static String UseItemGameModeMode;
public static List<String> UseItemGameModeList;
public static Boolean UseItem_InventorySlot_FreeSlot;
public static Integer UseItem_InventorySlot;
public static Boolean UseItem_InventorySlotEnforce;
public static String UseItem_Material;
public static Boolean UseItem_PlayerHead_Enable;
public static Boolean UseItem_Base64_Enable;
public static String UseItem_Base64value;
public static Boolean UseItem_PlayerWhoHasOpenedTheGUI;
public static String UseItem_PlayerName;
public static String UseItem_Name;
public static List<String> UseItem_Lore;
public static Boolean Sound_Enable = true;
public static Boolean Sound_OpenInventory_Enable = true;
public static Sound Sound_OpenInventory;
public static String Sound_OpenInventory_input;
public static Boolean Sound_Click_Enable = true;
public static Sound Sound_Click;
public static String Sound_Click_input;
public static Boolean Sound_NoMoney_Enable = true;
public static Sound Sound_NoMoney;
public static String Sound_NoMoney_input;
public static Boolean Sound_NoInventorySpace_Enable = true;
public static Sound Sound_NoInventorySpace;
public static String Sound_NoInventorySpace_input;
public static Boolean Sound_Give_Enable = true;
public static Sound Sound_Give;
public static String Sound_Give_input;
public static Boolean Sound_PlayerNotFound_Enable = true;
public static Sound Sound_PlayerNotFound;
public static String Sound_PlayerNotFound_input;
public static void onSelect() {
File config = new File(Main.getPath(), "config.yml");
YamlConfiguration yamlConfiguration = YamlConfiguration.loadConfiguration(config);
if (yamlConfiguration.get("Plugin.DisableUpdateChecker") == null) {
DisableUpdateChecker = false;
} else DisableUpdateChecker = yamlConfiguration.getBoolean("Plugin.DisableUpdateChecker");
UpdateCheckOnJoin = yamlConfiguration.getBoolean("Plugin.UpdateCheckOnJoin");
Debug = yamlConfiguration.getBoolean("Plugin.Debug");
HelpAlias = yamlConfiguration.getBoolean("Plugin.HelpAlias");
language = yamlConfiguration.getString("Plugin.language");
Currency = yamlConfiguration.getString("Plugin.Currency");
DefaultGUI = yamlConfiguration.getString("Plugin.DefaultGUI");
Storage = yamlConfiguration.getString("Storage.Type").toUpperCase();
MySQL.ip = yamlConfiguration.getString("Storage.MySQL.IP");
MySQL.port = yamlConfiguration.getInt("Storage.MySQL.Port");
MySQL.database = yamlConfiguration.getString("Storage.MySQL.Database");
MySQL.user = yamlConfiguration.getString("Storage.MySQL.User");
MySQL.password = yamlConfiguration.getString("Storage.MySQL.Password");
MySQL.SSL = yamlConfiguration.getBoolean("Storage.MySQL.SSL");
Bungee = yamlConfiguration.getBoolean("BungeeCord.Enable");
thisServer = yamlConfiguration.getString("BungeeCord.ThisServer");
UseItem_Enable = yamlConfiguration.getBoolean("UseItem.Enable");
UseItem_AllowToggle = yamlConfiguration.getBoolean("UseItem.AllowToggle");
UseItem_AllowSetSlot = yamlConfiguration.getBoolean("UseItem.AllowSetSlot");
UseItem_BlockMoveAndDrop = yamlConfiguration.getBoolean("UseItem.BlockMoveAndDrop");
UseItem_OpenGUI = yamlConfiguration.getString("UseItem.OpenGUI");
UseItem_Permission = yamlConfiguration.getBoolean("UseItem.Permission.NeededToUse");
UseItem_KeepAtCommandClear = yamlConfiguration.getBoolean("UseItem.KeepAtCommandClear");
UseItem_InventorySlot_FreeSlot = yamlConfiguration.getBoolean("UseItem.InventorySlot.FreeSlot");
UseItem_InventorySlot = yamlConfiguration.getInt("UseItem.InventorySlot.Slot");
UseItem_InventorySlotEnforce = yamlConfiguration.getBoolean("UseItem.InventorySlot.SlotEnforce");
UseItem_Material = yamlConfiguration.getString("UseItem.Item.Material").toUpperCase();
UseItem_PlayerHead_Enable = yamlConfiguration.getBoolean("UseItem.Item.PlayerHead.Enable");
UseItem_Base64_Enable = yamlConfiguration.getBoolean("UseItem.Item.PlayerHead.Base64.Enable");
UseItem_Base64value = yamlConfiguration.getString("UseItem.Item.PlayerHead.Base64.Base64Value");
UseItem_PlayerWhoHasOpenedTheGUI = yamlConfiguration.getBoolean("UseItem.Item.PlayerHead.PlayerWhoHasOpenedTheGUI");
UseItem_PlayerName = yamlConfiguration.getString("UseItem.Item.PlayerHead.PlayerName");
UseItem_Name = Replace.replace(Util.getPrefix(),yamlConfiguration.getString("UseItem.Item.Name"));
UseItem_Lore = yamlConfiguration.getStringList("UseItem.Item.Lore");
UseItem_GiveOnEveryJoin = yamlConfiguration.getBoolean("UseItem.Join.GiveOnEveryJoin");
UseItem_GiveOnlyOnFirstJoin = yamlConfiguration.getBoolean("UseItem.Join.GiveOnlyOnFirstJoin");
Cursor_ToGUIItem_OnLogin = yamlConfiguration.getBoolean("UseItem.Join.Cursor.ToGUIItem.OnLogin.Enable");
Cursor_ToGUIItem_OnlyOnFirstLogin = yamlConfiguration.getBoolean("UseItem.Join.Cursor.ToGUIItem.Spigot.OnlyOnFirstLogin");
UseItem_ServerChange = yamlConfiguration.getBoolean("UseItem.Join.Cursor.ToGUIItem.Bungee.OnServerChange");
UseItemGameModeChangeEnable = yamlConfiguration.getBoolean("Advanced.UseItem.GameModeChange.Enable");
UseItemGameModeChangeDelayInTicks = yamlConfiguration.getInt("Advanced.UseItem.GameModeChange.DelayInTicks");
UseItemGameModeProtection = yamlConfiguration.getBoolean("Advanced.UseItem.GameModeChange.Protection.Enable");
UseItemGameModeMode = yamlConfiguration.getString("Advanced.UseItem.GameModeChange.Protection.Mode");
UseItemGameModeList = yamlConfiguration.getStringList("Advanced.UseItem.GameModeChange.Protection.List");
Sound_Enable = yamlConfiguration.getBoolean("Sound.Enable");
Sound_OpenInventory_Enable = yamlConfiguration.getBoolean("Sound.OpenInventory.Enable");
Sound_OpenInventory_input = (yamlConfiguration.getString("Sound.OpenInventory.Sound").toUpperCase().replace(".", "_"));
Sound_Click_Enable = yamlConfiguration.getBoolean("Sound.Click.Enable");
Sound_Click_input = (yamlConfiguration.getString("Sound.Click.Sound").toUpperCase().replace(".", "_"));
Sound_NoMoney_Enable = yamlConfiguration.getBoolean("Sound.NoMoney.Enable");
Sound_NoMoney_input = (yamlConfiguration.getString("Sound.NoMoney.Sound").toUpperCase().replace(".", "_"));
Sound_NoInventorySpace_Enable = yamlConfiguration.getBoolean("Sound.NoInventorySpace.Enable");
Sound_NoInventorySpace_input = (yamlConfiguration.getString("Sound.NoInventorySpace.Sound").toUpperCase().replace(".", "_"));
Sound_Give_Enable = yamlConfiguration.getBoolean("Sound.Give.Enable");
Sound_Give_input = (yamlConfiguration.getString("Sound.Give.Sound").toUpperCase().replace(".", "_"));
Sound_PlayerNotFound_Enable = yamlConfiguration.getBoolean("Sound.PlayerNotFound.Enable");
Sound_PlayerNotFound_input = (yamlConfiguration.getString("Sound.PlayerNotFound.Sound").toUpperCase().replace(".", "_"));
}
public static void sound(String Prefix) {
String soundOpenInventory;
if (MCVersion.minecraft1_8) {
soundOpenInventory = "CHEST_OPEN";
} else {
soundOpenInventory = "BLOCK_CHEST_OPEN";
}
String soundClick;
if (MCVersion.minecraft1_8) {
soundClick = "NOTE_STICKS";
} else if (MCVersion.minecraft1_9 || MCVersion.minecraft1_10 || MCVersion.minecraft1_11 || MCVersion.minecraft1_12) {
soundClick = "BLOCK_NOTE_HAT";
} else {
soundClick = "BLOCK_NOTE_BLOCK_HAT";
}
String soundNoMoney;
if (MCVersion.minecraft1_8) {
soundNoMoney = "NOTE_PIANO";
} else if (MCVersion.minecraft1_9 || MCVersion.minecraft1_10 || MCVersion.minecraft1_11 || MCVersion.minecraft1_12) {
soundNoMoney = "BLOCK_NOTE_HARP";
} else {
soundNoMoney = "BLOCK_NOTE_BLOCK_HARP";
}
String soundNoInventorySpace;
if (MCVersion.minecraft1_8) {
soundNoInventorySpace = "NOTE_PIANO";
} else if (MCVersion.minecraft1_9 || MCVersion.minecraft1_10 || MCVersion.minecraft1_11 || MCVersion.minecraft1_12) {
soundNoInventorySpace = "BLOCK_NOTE_BASS";
} else {
soundNoInventorySpace = "BLOCK_NOTE_BLOCK_GUITAR";
}
String soundGive;
if (MCVersion.minecraft1_8) {
soundGive = "LEVEL_UP";
} else {
soundGive = "ENTITY_PLAYER_LEVELUP";
}
String soundPlayerNotFound;
if (MCVersion.minecraft1_8) {
soundPlayerNotFound = "NOTE_PIANO";
} else if (MCVersion.minecraft1_9 || MCVersion.minecraft1_10 || MCVersion.minecraft1_11 || MCVersion.minecraft1_12) {
soundPlayerNotFound = "BLOCK_NOTE_HARP";
} else {
soundPlayerNotFound = "BLOCK_NOTE_BLOCK_HARP";
}
try {
Sound sound_OpenInventory = Sound.valueOf(Sound_OpenInventory_input);
if (sound_OpenInventory != null) {
Sound_OpenInventory = sound_OpenInventory;
}
} catch (Exception e) {
send.console("§4\n§4\n§4\n" + SelectMessages.SoundNotFound.replace("[prefix]", Prefix)
.replace("[sound]", "§8OpenInventory: §6" + Sound_OpenInventory_input) + "§4\n§4\n§4\n");
Sound_OpenInventory = Sound.valueOf(soundOpenInventory);
}
try {
Sound sound_Click = Sound.valueOf(Sound_Click_input);
if (sound_Click != null) {
Sound_Click = sound_Click;
}
} catch (Exception e) {
send.console("§4\n§4\n§4\n" + SelectMessages.SoundNotFound.replace("[prefix]", Prefix)
.replace("[sound]", "§8Click: §6" + Sound_Click_input) + "§4\n§4\n§4\n");
Sound_Click = Sound.valueOf(soundClick);
}
try {
Sound sound_NoMoney = Sound.valueOf(Sound_NoMoney_input);
if (sound_NoMoney != null) {
Sound_Click = sound_NoMoney;
}
} catch (Exception e) {
send.console("§4\n§4\n§4\n" + SelectMessages.SoundNotFound.replace("[prefix]", Prefix)
.replace("[sound]", "§8NoMoney: §6" + Sound_NoMoney_input) + "§4\n§4\n§4\n");
Sound_NoMoney = Sound.valueOf(soundNoMoney);
}
try {
Sound sound_NoInventorySpace = Sound.valueOf(Sound_NoInventorySpace_input);
if (sound_NoInventorySpace != null) {
Sound_NoInventorySpace = sound_NoInventorySpace;
}
} catch (Exception e) {
send.console("§4\n§4\n§4\n" + SelectMessages.SoundNotFound.replace("[prefix]", Prefix)
.replace("[sound]", "§8NoInventorySpace: §6" + Sound_NoInventorySpace_input) + "§4\n§4\n§4\n");
Sound_NoInventorySpace = Sound.valueOf(soundNoInventorySpace);
}
try {
Sound sound_Give = Sound.valueOf(Sound_Give_input);
if (sound_Give != null) {
Sound_Give = sound_Give;
}
} catch (Exception e) {
send.console("§4\n§4\n§4\n" + SelectMessages.SoundNotFound.replace("[prefix]", Prefix)
.replace("[sound]", "§8Give: §6" + Sound_Give_input) + "§4\n§4\n§4\n");
Sound_Give = Sound.valueOf(soundGive);
}
try {
Sound sound_PlayerNotFound = Sound.valueOf(Sound_PlayerNotFound_input);
if (sound_PlayerNotFound != null) {
Sound_PlayerNotFound = sound_PlayerNotFound;
}
} catch (Exception e) {
send.console("§4\n§4\n§4\n" + SelectMessages.SoundNotFound.replace("[prefix]", Prefix)
.replace("[sound]", "§8PlayerNotFound: §6" + Sound_PlayerNotFound_input) + "§4\n§4\n§4\n");
Sound_PlayerNotFound = Sound.valueOf(soundPlayerNotFound);
}
}
}

View File

@@ -0,0 +1,213 @@
package de.jatitv.commandguiv2.Spigot.config.languages;
import de.jatitv.commandguiv2.Spigot.Main;
import net.t2code.lib.Spigot.Lib.messages.send;
import org.bukkit.configuration.file.YamlConfiguration;
import org.bukkit.plugin.Plugin;
import java.io.File;
import java.io.IOException;
public class LanguagesCreate {
private static Plugin plugin = Main.plugin;
public static void langCreate() {
send.debug(plugin,"§4Language files are created / updated...");
Long long_ = Long.valueOf(System.currentTimeMillis());
/**
*
* ENGLISH
*
*/
File messagesEN = new File(Main.getPath(), "languages/english_messages.yml");
YamlConfiguration yamlConfigurationEN = YamlConfiguration.loadConfiguration(messagesEN);
set("Plugin.VaultNotSetUp", MSG.EN_VaultNotSetUp, yamlConfigurationEN);
set("Plugin.SoundNotFound", MSG.EN_SoundNotFound, yamlConfigurationEN);
set("Plugin.OnlyForPlayer", MSG.EN_OnlyForPlayer, yamlConfigurationEN);
set("Plugin.DefaultGUI.create", MSG.EN_DefaultGUI, yamlConfigurationEN);
set("Plugin.Reload.Start", MSG.EN_ReloadStart, yamlConfigurationEN);
set("Plugin.Reload.End", MSG.EN_ReloadEnd, yamlConfigurationEN);
set("NoPermission.ForCommandGUI", MSG.EN_NoPermission, yamlConfigurationEN);
set("NoPermission.ForCommand", MSG.EN_NoPermissionForCommand, yamlConfigurationEN);
set("NoPermission.ForUseItem", MSG.EN_NoPermissionForUseItem, yamlConfigurationEN);
set("NoPermission.ForItem", MSG.EN_NoPermissionForItem, yamlConfigurationEN);
set("UseItem.UseItem_ON", MSG.EN_ItemON, yamlConfigurationEN);
set("UseItem.UseItem_OFF", MSG.EN_ItemOFF, yamlConfigurationEN);
set("UseItem.Change_Slot", MSG.EN_ItemSlot, yamlConfigurationEN);
set("UseItem.SlotNotEmpty", MSG.EN_ItemSlotNotEmpty, yamlConfigurationEN);
set("UseItem.SlotAlreadySet", MSG.EN_ItemSlotAlreadySet, yamlConfigurationEN);
set("UseItem.ItemSlot_wrongValue", MSG.EN_ItemSlot_wrongValue, yamlConfigurationEN);
set("Cost.Buy_msg", MSG.EN_Buy_msg, yamlConfigurationEN);
set("Cost.No_money", MSG.EN_No_money, yamlConfigurationEN);
set("Cost.NoInventorySpace", MSG.EN_NoInventorySpace, yamlConfigurationEN);
set("ServerChange.onServerChange", MSG.EN_onServerChange, yamlConfigurationEN);
set("GUI.GUInotFound", MSG.EN_GUInotFound, yamlConfigurationEN);
set("GUI.GUIisDisabled", MSG.EN_GUIisDisabled, yamlConfigurationEN);
set("Give.Sender", MSG.EN_GiveSender, yamlConfigurationEN);
set("Give.Receiver", MSG.EN_GiveReceiver, yamlConfigurationEN);
set("Player.PlayerNotFond", MSG.EN_PlayerNotFond, yamlConfigurationEN);
set("Player.PlayerNoInventorySpace", MSG.EN_PlayerNoInventorySpace, yamlConfigurationEN);
set("Help.CGUI", MSG.EN_Help_CGUI, yamlConfigurationEN);
set("Help.Help", MSG.EN_Help_Help, yamlConfigurationEN);
set("Help.Info", MSG.EN_Help_Info, yamlConfigurationEN);
set("Help.Open", MSG.EN_Help_Open, yamlConfigurationEN);
set("Help.Give", MSG.EN_Help_Give, yamlConfigurationEN);
set("Help.CreateDefaultGUI", MSG.EN_Help_CreateDefaultGUI, yamlConfigurationEN);
set("Help.Reload", MSG.EN_Help_Reload, yamlConfigurationEN);
set("Help.UseItem_On", MSG.EN_GUIItemHelp_on, yamlConfigurationEN);
set("Help.UseItem_Off", MSG.EN_GUIItemHelp_off, yamlConfigurationEN);
set("Help.UseItem_Slot", MSG.EN_GUIItemHelp_Slot, yamlConfigurationEN);
try {
yamlConfigurationEN.save(messagesEN);
} catch (IOException e) {
send.warning(plugin,e.getMessage());
e.printStackTrace();
}
/**
*
* GERMAN
*
*/
File messagesDE = new File(Main.getPath(), "languages/german_messages.yml");
YamlConfiguration yamlConfigurationDE = YamlConfiguration.loadConfiguration(messagesDE);
set("Plugin.VaultNotSetUp", MSG.DE_VaultNotSetUp, yamlConfigurationDE);
set("Plugin.SoundNotFound", MSG.DE_SoundNotFound, yamlConfigurationDE);
set("Plugin.OnlyForPlayer", MSG.DE_OnlyForPlayer, yamlConfigurationDE);
set("Plugin.DefaultGUI.create", MSG.DE_DefaultGUI, yamlConfigurationDE);
set("Plugin.Reload.Start", MSG.DE_ReloadStart, yamlConfigurationDE);
set("Plugin.Reload.End", MSG.DE_ReloadEnd, yamlConfigurationDE);
set("NoPermission.ForCommandGUI", MSG.DE_NoPermission, yamlConfigurationDE);
set("NoPermission.ForCommand", MSG.DE_NoPermissionForCommand, yamlConfigurationDE);
set("NoPermission.ForUseItem", MSG.DE_NoPermissionForUseItem, yamlConfigurationDE);
set("NoPermission.ForItem", MSG.DE_NoPermissionForItem, yamlConfigurationDE);
set("UseItem.UseItem_ON", MSG.DE_ItemON, yamlConfigurationDE);
set("UseItem.UseItem_OFF", MSG.DE_ItemOFF, yamlConfigurationDE);
set("UseItem.Change_Slot", MSG.DE_ItemSlot, yamlConfigurationDE);
set("UseItem.SlotNotEmpty", MSG.DE_ItemSlotNotEmpty, yamlConfigurationDE);
set("UseItem.SlotAlreadySet", MSG.DE_ItemSlotAlreadySet, yamlConfigurationDE);
set("UseItem.ItemSlot_wrongValue", MSG.DE_ItemSlot_wrongValue, yamlConfigurationDE);
set("Cost.Buy_msg", MSG.DE_Buy_msg, yamlConfigurationDE);
set("Cost.No_money", MSG.DE_No_money, yamlConfigurationDE);
set("Cost.NoInventorySpace", MSG.DE_NoInventorySpace, yamlConfigurationDE);
set("ServerChange.onServerChange", MSG.DE_onServerChange, yamlConfigurationDE);
set("GUI.GUInotFound", MSG.DE_GUInotFound, yamlConfigurationDE);
set("GUI.GUIisDisabled", MSG.DE_GUIisDisabled, yamlConfigurationDE);
set("Give.Sender", MSG.DE_GiveSender, yamlConfigurationDE);
set("Give.Receiver", MSG.DE_GiveReceiver, yamlConfigurationDE);
set("Player.PlayerNotFond", MSG.DE_PlayerNotFond, yamlConfigurationDE);
set("Player.PlayerNoInventorySpace", MSG.DE_PlayerNoInventorySpace, yamlConfigurationDE);
set("Help.CGUI", MSG.DE_Help_CGUI, yamlConfigurationDE);
set("Help.Help", MSG.DE_Help_Help, yamlConfigurationDE);
set("Help.Info", MSG.DE_Help_Info, yamlConfigurationDE);
set("Help.Open", MSG.DE_Help_Open, yamlConfigurationDE);
set("Help.Give", MSG.DE_Help_Give, yamlConfigurationDE);
set("Help.CreateDefaultGUI", MSG.DE_Help_CreateDefaultGUI, yamlConfigurationDE);
set("Help.Reload", MSG.DE_Help_Reload, yamlConfigurationDE);
set("Help.UseItem_On", MSG.DE_GUIItemHelp_on, yamlConfigurationDE);
set("Help.UseItem_Off", MSG.DE_GUIItemHelp_off, yamlConfigurationDE);
set("Help.UseItem_Slot", MSG.DE_GUIItemHelp_Slot, yamlConfigurationDE);
try {
yamlConfigurationDE.save(messagesDE);
} catch (IOException e) {
send.warning(plugin,e.getMessage());
e.printStackTrace();
}
/**
*
* norwegian
*
*/
File messagesNO = new File(Main.getPath(), "languages/norwegian_messages.yml");
YamlConfiguration yamlConfigurationNO = YamlConfiguration.loadConfiguration(messagesNO);
set("Plugin.VaultNotSetUp", MSG.NO_VaultNotSetUp, yamlConfigurationNO);
set("Plugin.SoundNotFound", MSG.NO_SoundNotFound, yamlConfigurationNO);
set("Plugin.OnlyForPlayer", MSG.NO_OnlyForPlayer, yamlConfigurationNO);
set("Plugin.DefaultGUI.create", MSG.NO_DefaultGUI, yamlConfigurationNO);
set("Plugin.Reload.Start", MSG.NO_ReloadStart, yamlConfigurationNO);
set("Plugin.Reload.End", MSG.NO_ReloadEnd, yamlConfigurationNO);
set("NoPermission.ForCommandGUI", MSG.NO_NoPermission, yamlConfigurationNO);
set("NoPermission.ForCommand", MSG.NO_NoPermissionForCommand, yamlConfigurationNO);
set("NoPermission.ForUseItem", MSG.NO_NoPermissionForUseItem, yamlConfigurationNO);
set("NoPermission.ForItem", MSG.NO_NoPermissionForItem, yamlConfigurationNO);
set("UseItem.UseItem_ON", MSG.NO_ItemON, yamlConfigurationNO);
set("UseItem.UseItem_OFF", MSG.NO_ItemOFF, yamlConfigurationNO);
set("UseItem.Change_Slot", MSG.NO_ItemSlot, yamlConfigurationNO);
set("UseItem.SlotNotEmpty", MSG.NO_ItemSlotNotEmpty, yamlConfigurationNO);
set("UseItem.SlotAlreadySet", MSG.NO_ItemSlotAlreadySet, yamlConfigurationNO);
set("UseItem.ItemSlot_wrongValue", MSG.NO_ItemSlot_wrongValue, yamlConfigurationNO);
set("Cost.Buy_msg", MSG.NO_Buy_msg, yamlConfigurationNO);
set("Cost.No_money", MSG.NO_No_money, yamlConfigurationNO);
set("Cost.NoInventorySpace", MSG.NO_NoInventorySpace, yamlConfigurationNO);
set("ServerChange.onServerChange", MSG.NO_onServerChange, yamlConfigurationNO);
set("GUI.GUInotFound", MSG.NO_GUInotFound, yamlConfigurationNO);
set("GUI.GUIisDisabled", MSG.NO_GUIisDisabled, yamlConfigurationNO);
set("Give.Sender", MSG.NO_GiveSender, yamlConfigurationNO);
set("Give.Receiver", MSG.NO_GiveReceiver, yamlConfigurationNO);
set("Player.PlayerNotFond", MSG.NO_PlayerNotFond, yamlConfigurationNO);
set("Player.PlayerNoInventorySpace", MSG.NO_PlayerNoInventorySpace, yamlConfigurationNO);
set("Help.CGUI", MSG.NO_Help_CGUI, yamlConfigurationNO);
set("Help.Help", MSG.NO_Help_Help, yamlConfigurationNO);
set("Help.Info", MSG.NO_Help_Info, yamlConfigurationNO);
set("Help.Open", MSG.NO_Help_Open, yamlConfigurationNO);
set("Help.Give", MSG.NO_Help_Give, yamlConfigurationNO);
set("Help.CreateDefaultGUI", MSG.NO_Help_CreateDefaultGUI, yamlConfigurationNO);
set("Help.Reload", MSG.NO_Help_Reload, yamlConfigurationNO);
set("Help.UseItem_On", MSG.NO_GUIItemHelp_on, yamlConfigurationNO);
set("Help.UseItem_Off", MSG.NO_GUIItemHelp_off, yamlConfigurationNO);
set("Help.UseItem_Slot", MSG.NO_GUIItemHelp_Slot, yamlConfigurationNO);
try {
yamlConfigurationNO.save(messagesNO);
} catch (IOException e) {
send.warning(plugin,e.getMessage());
e.printStackTrace();
}
send.console(Main.prefix + " §2Language files were successfully created / updated." + " §7- §e" + (System.currentTimeMillis() - long_.longValue()) + "ms");
}
private static void set(String path, String value, YamlConfiguration config) {
if (!config.contains(path)) {
config.set(path, value);
}
}
}

View File

@@ -0,0 +1,160 @@
// This claas was created by JaTiTV
// -----------------------------
// _____ _____ _ _ _____
// / ____/ ____| | | |_ _|
// | | | | __| | | | | |
// | | | | |_ | | | | | |
// | |___| |__| | |__| |_| |_
// \_____\_____|\____/|_____|
// -----------------------------
package de.jatitv.commandguiv2.Spigot.config.languages;
public class MSG {
// EN
public static String EN_VaultNotSetUp = "[prefix] &4Vault / Economy not set up!";
public static String EN_SoundNotFound = "[prefix] &4The sound &6[sound] &4was not found! Please check the settings.";
public static String EN_OnlyForPlayer = "[prefix] &cThis command is for players only!";
public static String EN_DefaultGUI = "[prefix] &2DefaultGUI was created. You can find it in the directory: &e[directory]&2!";
public static String EN_ReloadStart = "[prefix] &6Plugin is reloaded...";
public static String EN_ReloadEnd = "[prefix] &2Plugin was successfully reloaded.";
public static String EN_NoPermission = "[prefix] &cYou do not have permission for &4Command&9GUI&c!";
public static String EN_NoPermissionForCommand = "[prefix] &cFor &b[cmd] &cyou lack the permission &6[perm]&c!";
public static String EN_NoPermissionForUseItem = "[prefix] &cYou lack the permission &6[perm] &cto use the item for the GUI: &6[gui].";
public static String EN_NoPermissionForItem = "[prefix] &cFor &b[item] &cyou lack the permission &6[perm]&c!";
public static String EN_Buy_msg = "[prefix] &2You bought [itemname] &2for &6[price]&2.";
public static String EN_No_money = "[prefix] &cYou don't have enough money!";
public static String EN_NoInventorySpace = "[prefix] &cYou have no room in your inventory!";
public static String EN_onServerChange = "[prefix] &2You will be connected to the server &e[server]§2.";
public static String EN_ItemON = "[prefix] &2You have activated the GUI item.";
public static String EN_ItemOFF = "[prefix] &2You have disabled the GUI item.";
public static String EN_ItemSlot = "[prefix] &2You have changed the GUI item to slot: &6[slot]&2.";
public static String EN_ItemSlotNotEmpty = "[prefix] &6The slot &e[slot] &6is currently occupied!";
public static String EN_ItemSlotAlreadySet = "[prefix] &6The slot §e[slot] §6is already set!";
public static String EN_ItemSlot_wrongValue = "[prefix] &cThe specified slot must be between 1 and 9!";
public static String EN_GUInotFound = "[prefix] &cThe GUI chosen by the does not exist.";
public static String EN_GUIisDisabled = "[prefix] &cThe GUI [gui] &cis currently Disabled!";
public static String EN_GiveSender = "[prefix] &2You have given &6[player] &2an [item] &2!";
public static String EN_GiveReceiver = "[prefix] &2You got &2, [item] &2from &6[sender]!";
public static String EN_PlayerNotFond = "[prefix] &cThe player &6[player] &cwas not found or is not online!";
public static String EN_PlayerNoInventorySpace = "[prefix] &6[player] &chas no free space in his inventory!";
public static String EN_Help_CGUI = "&8''&b/commandgui &8| &b/cgui&8'' &eOpen the default GUI &7(&r[gui]&7)&e.";
public static String EN_Help_Open = "&8''&b/commandgui [gui]&8'' &eOpen the GUI: &6[guiname]&e.";
public static String EN_Help_Help = "&8''&b/commandguihelp&8'' &eOpen this help.";
public static String EN_Help_Info = "&8''&b/commandgui admin info&8'' &eCall the info from &4Command&9GUI &e.";
public static String EN_Help_Give = "&8''&b/commandgui admin give &7<player>&8'' &eGive a player the GUI item.";
public static String EN_Help_CreateDefaultGUI = "&8''&b/commandgui admin createdefaultgui&8'' &eCreate a default GUI &7([directory])&e.";
public static String EN_Help_Reload = "&8''&b/commandgui admin reload&8'' &eReload the plugin.";
public static String EN_GUIItemHelp_on = "&8''&b/gui-item on&8'' &eActivate the GUIItem for you.";
public static String EN_GUIItemHelp_off = "&8''&b/gui-item off&8'' &eDisable the GUIItem for yourself.";
public static String EN_GUIItemHelp_Slot = "&8''&b/gui-item slot [slot]&8'' &eSet the slot for GUIItem for you.";
// DE
public static String DE_VaultNotSetUp = "[prefix] &4Vault / Economy nicht eingerichtet!";
public static String DE_SoundNotFound = "[prefix] &4Der Sound &6[sound] &4wurde nicht gefunden! Bitte [ue]berpr[ue]fe die Einstellungen.";
public static String DE_OnlyForPlayer = "[prefix] &cDieser Command ist nur f[ue]r Spieler!";
public static String DE_DefaultGUI = "[prefix] &2DefaultGUI wurde erstellt. Du findst sie im Verzeichnis: &e[directory]&2!";
public static String DE_ReloadStart = "[prefix] &6Plugin wird neu geladen...";
public static String DE_ReloadEnd = "[prefix] &2Plugin wurde erfolgreich neu geladen.";
public static String DE_NoPermission = "[prefix] &cDu hast keine Permission f[ue]r &4Command&9GUI&c!";
public static String DE_NoPermissionForCommand = "[prefix] &cF[ue]r &b[cmd] &cfehlt dir die Permission &6[perm]&c!";
public static String DE_NoPermissionForUseItem = "[prefix] &cDir fehlt die Permission &6[perm] &cum das Item f[ue]r die GUI: &6[gui] &cnutzen zu k[oe]nnen.";
public static String DE_NoPermissionForItem = "[prefix] &cF[ue]r &b[item] &cfehlt dir die Permission &6[perm]&c!";
public static String DE_ItemON = "[prefix] &2Du hast das GUI-Item aktiviert.";
public static String DE_ItemOFF = "[prefix] &2Du hast das GUI-Item deaktiviert.";
public static String DE_ItemSlot = "[prefix] &2Du hast das GUI-Item auf Slot &6[slot] &2umgestellt.";
public static String DE_ItemSlotNotEmpty = "[prefix] &6Der Slot §e[slot] §6ist derzeit belegt!.";
public static String DE_ItemSlotAlreadySet = "[prefix] &6Der Slot §e[slot] §6ist bereits eingestellt!";
public static String DE_ItemSlot_wrongValue = "[prefix] &cDer angegebene Slot muss sich zwischen 1 und 9 befinden!";
public static String DE_Buy_msg = "[prefix] &2Du hast dir [itemname] &2f[ue]r &6[price] &2gekauft.";
public static String DE_No_money = "[prefix] &cDu hast nicht gen[ue]gend Geld!";
public static String DE_NoInventorySpace = "[prefix] &cDu hast keinen Platz in deinem Inventar!";
public static String DE_onServerChange = "[prefix] &2Du wirst auf den Server §e[server] §2verbunden.";
public static String DE_GUInotFound = "[prefix] &cDie von die gew[ae]hlte GUI gibt es nicht.";
public static String DE_GUIisDisabled = "[prefix] &cDie GUI [gui] &cist derzeit Deaktiviert!";
public static String DE_GiveSender = "[prefix] &2Du hast &6[player] &2ein [item] &2gegeben!";
public static String DE_GiveReceiver = "[prefix] &2Du hast von &6[sender] &2, [item] &2bekommen!";
public static String DE_PlayerNotFond = "[prefix] &cDer Spieler &6[player] &cwurde nicht gefunden oder ist nicht Online!";
public static String DE_PlayerNoInventorySpace = "[prefix] &6[player] &chat keinen freien Platz in seinem Inventar!";
public static String DE_Help_CGUI = "&8''&b/commandgui &8| &b/cgui&8'' &e[OE]ffne die default GUI &7(&r[gui]&7)&e.";
public static String DE_Help_Open = "&8''&b/commandgui [gui]&8'' &e[OE]ffne die GUI: &6[guiname]&e.";
public static String DE_Help_Help = "&8''&b/commandguihelp&8'' &e[OE]ffne diese help.";
public static String DE_Help_Info = "&8''&b/commandgui admin info&8'' &eRufe die Infos von &4Command&9GUI &eauf.";
public static String DE_Help_Give = "&8''&b/commandgui admin give &7<player>&8'' &eGebe einem Spieler das GUI-Item.";
public static String DE_Help_CreateDefaultGUI = "&8''&b/commandgui admin createdefaultgui&8'' &eLasse eine default GUI erstellen &7([directory])&e.";
public static String DE_Help_Reload = "&8''&b/commandgui admin reload&8'' &eLade das Plugin neu.";
public static String DE_GUIItemHelp_on = "&8''&b/gui-item on&8'' &eAktiviere f[ue]r dich das GUIItem.";
public static String DE_GUIItemHelp_off = "&8''&b/gui-item off&8'' &eDeaktiviere f[ue]r dich das GUIItem.";
public static String DE_GUIItemHelp_Slot = "&8''&b/gui-item slot [slot]&8'' &eSetze den Slot für GUIItem für Sie einstellen.";
// FR
// NO
public static String NO_VaultNotSetUp = "[prefix] &4Vault / Økonomi har ikke blitt satt opp!";
public static String NO_SoundNotFound = "[prefix] &4Lyden &6[sound] &4ble ikke bli funnet! Vennligst sjekk innstillingene.";
public static String NO_OnlyForPlayer = "[prefix] &cDenne kommandoen er for spillere kun!";
public static String NO_DefaultGUI = "[prefix] &2DefaultGUI har blitt laget. Du kan finne den i mappen: &e[directory]&2!";
public static String NO_ReloadStart = "[prefix] &6Pluginet blir relastet...";
public static String NO_ReloadEnd = "[prefix] &2Pluginet har blitt lastet inn på nytt.";
public static String NO_NoPermission = "[prefix] &cDu har ikke tilgang til &4Command&9GUI&c!";
public static String NO_NoPermissionForCommand = "[prefix] &cFor &b[cmd] &cmangler du tillatelsen &6[perm]&c!";
public static String NO_NoPermissionForUseItem = "[prefix] &cDu mangler tillatelsen &6[perm] &cfor å bruke gjenstanden i GUI: &6[gui].";
public static String NO_NoPermissionForItem = "[prefix] &cFor &b[item] &cmangler du tillatelsen &6[perm]&c!";
public static String NO_ItemON = "[prefix] &2You have activated the GUI item.";
public static String NO_ItemOFF = "[prefix] &2You have disabled the GUI item.";
public static String NO_ItemSlot = "[prefix] &2You have changed the GUI item to slot: &6[slot]&2.";
public static String NO_ItemSlotNotEmpty = "[prefix] &6Plassen &e[slot] &6er opptatt for øyeblikket!";
public static String NO_ItemSlotAlreadySet = "[prefix] &6Plassen §e[slot] §6er allerede satt!";
public static String NO_ItemSlot_wrongValue = "[prefix] &cDen spesifiserte plassen må være mellom 1 og 9!";
public static String NO_Buy_msg = "[prefix] &2Du kjøpte [itemname] &2for &6[price]&2.";
public static String NO_No_money = "[prefix] &cDu har ikke nok penger!";
public static String NO_NoInventorySpace = "[prefix] &cDu har ikke nok plass i inventaret ditt!";
public static String NO_onServerChange = "[prefix] &2Du vil bli tilkoblet serveren &e[server]&2.";
public static String NO_GUInotFound = "[prefix] &cGUIen som ble spesifisert finnes ikke.";
public static String NO_GUIisDisabled = "[prefix] &cGUIen [gui] &cer slått av for øyeblikket!";
public static String NO_GiveSender = "[prefix] &2Du har gitt &6[player] &2en [item]&2!";
public static String NO_GiveReceiver = "[prefix] &2Du fikk &2, [item] &2fra &6[sender]!";
public static String NO_PlayerNotFond = "[prefix] &cSpilleren &6[player] &cble ikke funnet eller er ikke pålogget!";
public static String NO_PlayerNoInventorySpace = "[prefix] &6[player] &char ikke nok plass i inventaret sitt!";
public static String NO_Help_CGUI = "&8''&b/commandgui &8| &b/cgui&8'' &eÅpne default GUIen &7(&r[gui]&7)&e.";
public static String NO_Help_Open = "&8''&b/commandgui [gui]&8'' &eÅpne GUIen: &6[guiname]&e.";
public static String NO_Help_Help = "&8''&b/commandguihelp&8'' &eSender denne hjelpe meldingen.";
public static String NO_Help_Info = "&8''&b/commandgui admin info&8'' &eKall informasjon fra &4Command&9GUI&e.";
public static String NO_Help_Give = "&8''&b/commandgui admin give &7<player>&8'' &eGi en spiller GUI gjenstanden.";
public static String NO_Help_CreateDefaultGUI = "&8''&b/commandgui admin createdefaultgui&8'' &eLag en normalverdi GUI &7([directory])&e.";
public static String NO_Help_Reload = "&8''&b/commandgui admin reload&8'' &eLast inn pluginet på nytt.";
public static String NO_GUIItemHelp_on = "&8''&b/gui-item on&8'' &eAktiverer en GUI gjenstand for deg.";
public static String NO_GUIItemHelp_off = "&8''&b/gui-item off&8'' &eDeaktiverer en GUI gjenstand for deg.";
public static String NO_GUIItemHelp_Slot = "&8''&b/gui-item slot [slot]&8'' &eSett sporet for GUIItem for deg.";
}

View File

@@ -0,0 +1,134 @@
package de.jatitv.commandguiv2.Spigot.config.languages;
import de.jatitv.commandguiv2.Spigot.Main;
import de.jatitv.commandguiv2.Spigot.config.config.SelectConfig;
import de.jatitv.commandguiv2.Util;
import net.t2code.lib.Spigot.Lib.messages.send;
import net.t2code.lib.Spigot.Lib.replace.Replace;
import org.bukkit.configuration.file.YamlConfiguration;
import java.io.File;
public class SelectMessages {
public static String selectMSG;
public static String VaultNotSetUp;
public static String SoundNotFound;
public static String OnlyForPlayer;
public static String DefaultGUIcreate;
public static String ReloadStart;
public static String ReloadEnd;
public static String NoPermission;
public static String NoPermissionForCommand;
public static String NoPermissionForUseItem;
public static String NoPermissionForItem;
public static String ItemON;
public static String ItemOFF;
public static String ItemSlot;
public static String ItemSlotNotEmpty;
public static String ItemSlotAlreadySet;
public static String ItemSlot_wrongValue;
public static String Buy_msg;
public static String No_money;
public static String NoInventorySpace;
public static String onServerChange;
public static String GUInotFound;
public static String GUIIsDisabled;
public static String Give_Sender;
public static String Give_Receiver;
public static String PlayerNotFond;
public static String PlayerNoInventorySpace;
public static String HelpCgui;
public static String HelpHelp;
public static String HelpInfo;
public static String HelpOpen;
public static String HelpGive;
public static String HelpCreateDefaultGUI;
public static String HelpReload;
public static String GUIItemHelp_on;
public static String GUIItemHelp_off;
public static String GUIItemHelp_Slot;
public static void onSelect(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_msg = YamlConfiguration.loadConfiguration(msg);
VaultNotSetUp = select("Plugin.VaultNotSetUp", yamlConfiguration_msg);
SoundNotFound = select("Plugin.SoundNotFound", yamlConfiguration_msg);
OnlyForPlayer = select("Plugin.OnlyForPlayer", yamlConfiguration_msg);
DefaultGUIcreate = select("Plugin.DefaultGUI.create", yamlConfiguration_msg);
ReloadStart = select("Plugin.Reload.Start", yamlConfiguration_msg);
ReloadEnd = select("Plugin.Reload.End", yamlConfiguration_msg);
NoPermission = select("NoPermission.ForCommandGUI", yamlConfiguration_msg);
NoPermissionForCommand = select("NoPermission.ForCommand", yamlConfiguration_msg);
NoPermissionForUseItem = select("NoPermission.ForUseItem", yamlConfiguration_msg);
NoPermissionForItem = select("NoPermission.ForItem", yamlConfiguration_msg);
ItemON = select("UseItem.UseItem_ON", yamlConfiguration_msg);
ItemOFF = select("UseItem.UseItem_OFF", yamlConfiguration_msg);
ItemSlot = select("UseItem.Change_Slot", yamlConfiguration_msg);
ItemSlotNotEmpty = select("UseItem.SlotNotEmpty", yamlConfiguration_msg);
ItemSlotAlreadySet = select("UseItem.SlotAlreadySet", yamlConfiguration_msg);
ItemSlot_wrongValue = select("UseItem.ItemSlot_wrongValue", yamlConfiguration_msg);
Buy_msg = select("Cost.Buy_msg", yamlConfiguration_msg);
No_money = select("Cost.No_money", yamlConfiguration_msg);
NoInventorySpace = select("Cost.NoInventorySpace", yamlConfiguration_msg);
onServerChange = select("ServerChange.onServerChange", yamlConfiguration_msg);
GUInotFound = select("GUI.GUInotFound", yamlConfiguration_msg);
GUIIsDisabled = select("GUI.GUIisDisabled", yamlConfiguration_msg);
Give_Sender = select("Give.Sender", yamlConfiguration_msg);
Give_Receiver = select("Give.Receiver", yamlConfiguration_msg);
PlayerNotFond = select("Player.PlayerNotFond", yamlConfiguration_msg);
PlayerNoInventorySpace = select("Player.PlayerNoInventorySpace", yamlConfiguration_msg);
HelpCgui = select("Help.CGUI", yamlConfiguration_msg);
HelpHelp = select("Help.Help", yamlConfiguration_msg);
HelpInfo = select("Help.Info", yamlConfiguration_msg);
HelpOpen = select("Help.Open", yamlConfiguration_msg);
HelpGive = select("Help.Give", yamlConfiguration_msg);
HelpCreateDefaultGUI = select("Help.CreateDefaultGUI", yamlConfiguration_msg);
HelpReload = select("Help.Reload", yamlConfiguration_msg);
GUIItemHelp_on = select("Help.UseItem_On", yamlConfiguration_msg);
GUIItemHelp_off = select("Help.UseItem_Off", yamlConfiguration_msg);
GUIItemHelp_Slot = select("Help.UseItem_Slot", yamlConfiguration_msg);
send.console(Prefix + " §2Language successfully selected to: §6" + selectMSG + " §7- §e" + (System.currentTimeMillis() - long_.longValue()) + "ms");
}
private static String select(String path, YamlConfiguration yamlConfiguration){
return Replace.replace(Util.getPrefix(),yamlConfiguration.getString(path));
}
}