This commit is contained in:
JaTiTV 2022-08-10 15:53:01 +02:00
parent 7be7c9f09e
commit 8826ca9b6e
15 changed files with 368 additions and 364 deletions

View File

@ -17,6 +17,9 @@ import de.jatitv.commandguiv2.Spigot.enums.SoundEnum;
import de.jatitv.commandguiv2.Util;
import net.t2code.lib.Spigot.Lib.messages.send;
import net.t2code.lib.Spigot.Lib.update.UpdateAPI;
import net.t2code.t2codelib.SPIGOT.api.messages.T2Csend;
import net.t2code.t2codelib.SPIGOT.api.messages.T2Ctemplate;
import net.t2code.t2codelib.SPIGOT.api.update.T2CupdateAPI;
import org.bukkit.Bukkit;
import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player;
@ -25,41 +28,43 @@ import java.util.Objects;
public class Commands {
public static void info(CommandSender sender) {
if (sender instanceof Player) {
Player player = (Player) sender;
send.player(player, Util.getPrefix() + "§4======= §8[§4Command§9GUI§8] §4=======");
send.player(player, Util.getPrefix() + " §2Autor: §6" + String.valueOf(Main.autor).replace("[", "").replace("]", ""));
if (UpdateAPI.PluginVersionen.get(Main.getPlugin().getName()).publicVersion.equalsIgnoreCase(Main.version)) {
send.player(player, Util.getPrefix() + " §2Version: §6" + Main.version);
} else {
UpdateAPI.sendUpdateMsg(Util.getPrefix(), Util.getSpigot(), Util.getDiscord(), Main.version, UpdateAPI.PluginVersionen.get(Main.getPlugin().getName()).publicVersion, player);
}
send.player(player, Util.getPrefix() + " §2Spigot: §6" + Util.getSpigot());
send.player(player, Util.getPrefix() + " §2Discord: §6" + Util.getDiscord());
send.player(player, Util.getPrefix() + "§4======= §8[§4Command§9GUI§8] §4=======");
} else {
send.sender(sender, Util.getPrefix() + "§4======= §8[§4Command§9GUI§8] §4=======");
send.sender(sender, Util.getPrefix() + " §2String.valueOf(Main.autor): §6" + String.valueOf(String.valueOf(Main.autor)).replace("[", "").replace("]", ""));
if (UpdateAPI.PluginVersionen.get(Main.getPlugin().getName()).publicVersion.equalsIgnoreCase(Main.version)) {
send.sender(sender, Util.getPrefix() + " §2Version: §6" + Main.version);
} else {
UpdateAPI.sendUpdateMsg(Util.getPrefix(), Util.getSpigot(), Util.getDiscord(), Main.version, UpdateAPI.PluginVersionen.get(Main.getPlugin().getName()).publicVersion);
}
send.sender(sender, Util.getPrefix() + " §2Spigot: §6" + Util.getSpigot());
send.sender(sender, Util.getPrefix() + " §2Discord: §6" + Util.getDiscord());
send.sender(sender, Util.getPrefix() + "§4======= §8[§4Command§9GUI§8] §4=======");
}
T2Ctemplate.sendInfo(sender,Util.getPrefix(),Util.getSpigot(),Util.getDiscord(),Main.autor,);
T2Ctemplate.sendInfo();
//if (sender instanceof Player) {
// Player player = (Player) sender;
// send.player(player, Util.getPrefix() + "§4======= §8[§4Command§9GUI§8] §4=======");
// send.player(player, Util.getPrefix() + " §2Autor: §6" + String.valueOf(Main.autor).replace("[", "").replace("]", ""));
//
// if (UpdateAPI.PluginVersionen.get(Main.getPlugin().getName()).publicVersion.equalsIgnoreCase(Main.version)) {
// send.player(player, Util.getPrefix() + " §2Version: §6" + Main.version);
// } else {
// UpdateAPI.sendUpdateMsg(Util.getPrefix(), Util.getSpigot(), Util.getDiscord(), Main.version, UpdateAPI.PluginVersionen.get(Main.getPlugin().getName()).publicVersion, player);
// }
//
// send.player(player, Util.getPrefix() + " §2Spigot: §6" + Util.getSpigot());
// send.player(player, Util.getPrefix() + " §2Discord: §6" + Util.getDiscord());
// send.player(player, Util.getPrefix() + "§4======= §8[§4Command§9GUI§8] §4=======");
//} else {
// send.sender(sender, Util.getPrefix() + "§4======= §8[§4Command§9GUI§8] §4=======");
// send.sender(sender, Util.getPrefix() + " §2String.valueOf(Main.autor): §6" + String.valueOf(String.valueOf(Main.autor)).replace("[", "").replace("]", ""));
//
// if (T2CupdateAPI.pluginVersions.get(Main.getPlugin().getName()).publicVersion.equalsIgnoreCase(Main.version)) {
// send.sender(sender, Util.getPrefix() + " §2Version: §6" + Main.version);
// } else {
// T2CupdateAPI.sendUpdateMsg(Util.getPrefix(), Util.getSpigot(), Util.getDiscord(), Main.version, UpdateAPI.PluginVersionen.get(Main.getPlugin().getName()).publicVersion);
// }
//
// T2Csend.sender(sender, Util.getPrefix() + " §2Spigot: §6" + Util.getSpigot());
// T2Csend.sender(sender, Util.getPrefix() + " §2Discord: §6" + Util.getDiscord());
// T2Csend.sender(sender, Util.getPrefix() + "§4======= §8[§4Command§9GUI§8] §4=======");
//}
}
public static void reload(CommandSender sender) {
if (sender instanceof Player) sender.sendMessage(SelectMessages.ReloadStart);
send.console(Util.getPrefix() + "§8-------------------------------");
send.console(Util.getPrefix() + " §6Plugin reload...");
send.console(Util.getPrefix() + "§8-------------------------------");
T2Csend.console(Util.getPrefix() + "§8-------------------------------");
T2Csend.console(Util.getPrefix() + " §6Plugin reload...");
T2Csend.console(Util.getPrefix() + "§8-------------------------------");
SelectConfig.onSelect();
Main.getPlugin().reloadConfig();
@ -67,8 +72,8 @@ public class Commands {
CmdExecuter_GUI.arg1.put(SelectConfig.getAdminSubCommand(), "commandgui.admin;commandgui.giveitem.other;commandgui.command.info");
if (!Objects.equals(SelectDatabase.getStorage().toString(), SelectConfig.getStorage())) {
if (sender instanceof Player) send.sender(sender, "You have changed the storage medium! To apply this change, you must restart the server!");
send.warning(Main.getPlugin(), "You have changed the storage medium! To apply this change, you must restart the server!");
if (sender instanceof Player) T2Csend.sender(sender, "You have changed the storage medium! To apply this change, you must restart the server!");
T2Csend.warning(Main.getPlugin(), "You have changed the storage medium! To apply this change, you must restart the server!");
}
LanguagesCreate.langCreate();
@ -94,9 +99,9 @@ public class Commands {
}
if (sender instanceof Player) sender.sendMessage(SelectMessages.ReloadEnd);
send.console(Util.getPrefix() + "§8-------------------------------");
send.console(Util.getPrefix() + " §2Plugin successfully reloaded.");
send.console(Util.getPrefix() + "§8-------------------------------");
T2Csend.console(Util.getPrefix() + "§8-------------------------------");
T2Csend.console(Util.getPrefix() + " §2Plugin successfully reloaded.");
T2Csend.console(Util.getPrefix() + "§8-------------------------------");
}
public static void give(CommandSender sender, Player target) {

View File

@ -5,8 +5,8 @@ import de.jatitv.commandguiv2.Spigot.Main;
import de.jatitv.commandguiv2.Spigot.objects.guis.Gui;
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 net.t2code.t2codelib.SPIGOT.api.messages.T2Creplace;
import net.t2code.t2codelib.SPIGOT.api.messages.T2Csend;
import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player;
@ -16,7 +16,7 @@ public class Help {
public static void sendHelp(CommandSender sender, String Prefix) {
Gui gui = Main.guiHashMap.get(SelectConfig.getDefaultGUI());
send.sender(sender, Prefix + " §8----- §4Command§9GUI §chelp §8-----");
T2Csend.sender(sender, Prefix + " §8----- §4Command§9GUI §chelp §8-----");
cgui(sender, gui);
open(sender);
help(sender);
@ -25,7 +25,7 @@ public class Help {
give(sender);
createDefaultGUI(sender);
reload(sender);
send.sender(sender, Prefix + " §8-------------------------");
T2Csend.sender(sender, Prefix + " §8-------------------------");
}
@ -33,8 +33,8 @@ public class Help {
if (!sender.hasPermission("commandgui.command")) return;
if (sender instanceof Player) {
send.player((Player) sender, prefix + " " + SelectMessages.PlayerHelpCgui.replace("[gui]", Replace.replace(prefix, gui.guiName)));
} else send.sender(sender, prefix + " " + SelectMessages.HelpCgui.replace("[gui]", Replace.replace(prefix, gui.guiName)));
T2Csend.player((Player) sender, prefix + " " + SelectMessages.PlayerHelpCgui.replace("[gui]", T2Creplace.replace(prefix, gui.guiName)));
} else T2Csend.sender(sender, prefix + " " + SelectMessages.HelpCgui.replace("[gui]", T2Creplace.replace(prefix, gui.guiName)));
}
private static void open(CommandSender sender) {
@ -43,9 +43,9 @@ public class Help {
for (String alias : Main.allAliases) {
if (Main.guiHashMap.get(alias).guiEnable || sender.hasPermission("commandgui.bypass")) {
if (sender instanceof Player) {
send.player((Player) sender, prefix + " " + SelectMessages.PlayerHelpOpen.replace("[gui]", alias).replace("[guiname]", Replace.replace(prefix, Main.guiHashMap.get(alias).guiName)));
T2Csend.player((Player) sender, prefix + " " + SelectMessages.PlayerHelpOpen.replace("[gui]", alias).replace("[guiname]", T2Creplace.replace(prefix, Main.guiHashMap.get(alias).guiName)));
} else
send.sender(sender, prefix + " " + SelectMessages.HelpOpen.replace("[gui]", alias).replace("[guiname]", Replace.replace(prefix, Main.guiHashMap.get(alias).guiName)));
T2Csend.sender(sender, prefix + " " + SelectMessages.HelpOpen.replace("[gui]", alias).replace("[guiname]", T2Creplace.replace(prefix, Main.guiHashMap.get(alias).guiName)));
}
}
}
@ -54,58 +54,59 @@ public class Help {
if (!sender.hasPermission("commandgui.command")) return;
if (sender instanceof Player) {
send.player((Player) sender, prefix + " " + SelectMessages.PlayerHelpHelp);
} else send.sender(sender, prefix + " " + SelectMessages.HelpHelp);
T2Csend.player((Player) sender, prefix + " " + SelectMessages.PlayerHelpHelp);
} else T2Csend.sender(sender, prefix + " " + SelectMessages.HelpHelp);
}
private static void info(CommandSender sender) {
if (!sender.hasPermission("commandgui.command.info")) return;
if (sender instanceof Player) {
send.player((Player) sender, prefix + " " + SelectMessages.PlayerHelpInfo);
} else send.sender(sender, prefix + " " + SelectMessages.HelpInfo);
T2Csend.player((Player) sender, prefix + " " + SelectMessages.PlayerHelpInfo);
} else T2Csend.sender(sender, prefix + " " + SelectMessages.HelpInfo);
}
private static void give(CommandSender sender) {
if (!sender.hasPermission("commandgui.admin")) return;
if (sender instanceof Player) {
send.player((Player) sender, prefix + " " + SelectMessages.PlayerHelpGive);
} else send.sender(sender, prefix + " " + SelectMessages.HelpGive);
T2Csend.player((Player) sender, prefix + " " + SelectMessages.PlayerHelpGive);
} else T2Csend.sender(sender, prefix + " " + SelectMessages.HelpGive);
}
private static void createDefaultGUI(CommandSender sender) {
if (!sender.hasPermission("commandgui.admin")) return;
if (sender instanceof Player) {
send.player((Player) sender, prefix + " " + SelectMessages.PlayerHelpCreateDefaultGUI.replace("[directory]", Main.getPath() + "\\GUIs\\default.yml"));
} else send.sender(sender, prefix + " " + SelectMessages.HelpCreateDefaultGUI.replace("[directory]", Main.getPath() + "\\GUIs\\default.yml"));
T2Csend.player((Player) sender, prefix + " " + SelectMessages.PlayerHelpCreateDefaultGUI.replace("[directory]", Main.getPath() + "\\GUIs\\default.yml"));
} else T2Csend.sender(sender, prefix + " " + SelectMessages.HelpCreateDefaultGUI.replace("[directory]", Main.getPath() + "\\GUIs\\default.yml"));
}
private static void reload(CommandSender sender) {
if (!sender.hasPermission("commandgui.admin")) return;
if (sender instanceof Player) {
send.player((Player) sender, prefix + " " + SelectMessages.PlayerHelpReload);
} else send.sender(sender, prefix + " " + SelectMessages.HelpReload);
T2Csend.player((Player) sender, prefix + " " + SelectMessages.PlayerHelpReload);
} else T2Csend.sender(sender, prefix + " " + SelectMessages.HelpReload);
}
public static void gUIItemHelp(CommandSender sender) {
if (sender instanceof Player) {
send.player((Player) sender, prefix + " " + SelectMessages.PlayerGUIItemHelp_on);
} else send.sender(sender, prefix + " " + SelectMessages.GUIItemHelp_on);
T2Csend.player((Player) sender, prefix + " " + SelectMessages.PlayerGUIItemHelp_on);
} else T2Csend.sender(sender, prefix + " " + SelectMessages.GUIItemHelp_on);
if (sender instanceof Player) {
send.player((Player) sender, prefix + " " + SelectMessages.PlayerGUIItemHelp_off);
} else send.sender(sender, prefix + " " + SelectMessages.GUIItemHelp_off);
T2Csend.player((Player) sender, prefix + " " + SelectMessages.PlayerGUIItemHelp_off);
} else T2Csend.sender(sender, prefix + " " + SelectMessages.GUIItemHelp_off);
if (sender instanceof Player) {
send.player((Player) sender, prefix + " " + SelectMessages.PlayerGUIItemHelp_Slot);
} else send.sender(sender, prefix + " " + SelectMessages.GUIItemHelp_Slot);
T2Csend.player((Player) sender, prefix + " " + SelectMessages.PlayerGUIItemHelp_Slot);
} else T2Csend.sender(sender, prefix + " " + SelectMessages.GUIItemHelp_Slot);
}
public static void sendGUIItemHelp(CommandSender sender) {
if (sender.hasPermission("commandgui.useitem.toggle")) {
send.sender(sender, prefix + " §8------ §4Command§9GUI§2Item §chelp §8------");
T2Csend.sender(sender, prefix + " §8------ §4Command§9GUI§2Item §chelp §8------");
gUIItemHelp(sender);
send.sender(sender, prefix + " §8------------------------------");
T2Csend.sender(sender, prefix + " §8------------------------------");
}
}
}

View File

@ -2,10 +2,10 @@ package de.jatitv.commandguiv2.Spigot.config.config;
import de.jatitv.commandguiv2.Spigot.Main;
import de.jatitv.commandguiv2.Util;
import net.t2code.lib.Spigot.Lib.items.ItemVersion;
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 net.t2code.t2codelib.SPIGOT.api.items.T2CitemVersion;
import net.t2code.t2codelib.SPIGOT.api.messages.T2Csend;
import net.t2code.t2codelib.SPIGOT.api.minecraftVersion.T2CmcVersion;
import net.t2code.t2codelib.SPIGOT.api.yaml.T2Cconfig;
import org.bukkit.Material;
import org.bukkit.configuration.file.YamlConfiguration;
@ -22,148 +22,148 @@ public class ConfigCreate {
public static void configCreate() {
long long_ = System.currentTimeMillis();
if (new File(Main.getPath(), "config.yml").exists()) {
if (Main.getPlugin().getConfig().getBoolean("Plugin.Debug")) send.console(Util.getPrefix() + " §5DEBUG: §6" + " §4config.yml are created / updated...");
} else send.console(Util.getPrefix() + " §4config.yml are created...");
if (Main.getPlugin().getConfig().getBoolean("Plugin.Debug")) T2Csend.console(Util.getPrefix() + " §5DEBUG: §6" + " §4config.yml are created / updated...");
} else T2Csend.console(Util.getPrefix() + " §4config.yml are created...");
File config = new File(Main.getPath(), "config.yml");
YamlConfiguration yamlConfiguration = YamlConfiguration.loadConfiguration(config);
if (!config.exists()) Config.set("ConfigVersion", Util.getConfigVersion(), yamlConfiguration);
if (!config.exists()) T2Cconfig.set("ConfigVersion", Util.getConfigVersion(), yamlConfiguration);
Config.set("Plugin.Debug", false, yamlConfiguration);
Config.set("Plugin.HelpAlias", true, yamlConfiguration);
Config.set("Plugin.AdminSubCommand", "admin", yamlConfiguration);
Config.set("Plugin.language", "english", yamlConfiguration);
Config.set("Plugin.Currency", "$", yamlConfiguration);
Config.set("Plugin.DefaultGUI", "default", yamlConfiguration);
T2Cconfig.set("Plugin.Debug", false, yamlConfiguration);
T2Cconfig.set("Plugin.HelpAlias", true, yamlConfiguration);
T2Cconfig.set("Plugin.AdminSubCommand", "admin", yamlConfiguration);
T2Cconfig.set("Plugin.language", "english", yamlConfiguration);
T2Cconfig.set("Plugin.Currency", "$", yamlConfiguration);
T2Cconfig.set("Plugin.DefaultGUI", "default", yamlConfiguration);
if (Main.legacy){
Config.set("Storage.Type", "YML", yamlConfiguration);
} else Config.set("Storage.Type", "SQLITE", 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);
T2Cconfig.set("Storage.Type", "YML", yamlConfiguration);
} else T2Cconfig.set("Storage.Type", "SQLITE", yamlConfiguration);
T2Cconfig.set("Storage.MySQL.IP", "localhost", yamlConfiguration);
T2Cconfig.set("Storage.MySQL.Port", 3306, yamlConfiguration);
T2Cconfig.set("Storage.MySQL.Database", "database", yamlConfiguration);
T2Cconfig.set("Storage.MySQL.User", "root", yamlConfiguration);
T2Cconfig.set("Storage.MySQL.Password", "password", yamlConfiguration);
T2Cconfig.set("Storage.MySQL.SSL", false, yamlConfiguration);
Config.set("BungeeCord.Enable", false, yamlConfiguration);
Config.set("BungeeCord.ThisServer", "server", yamlConfiguration);
T2Cconfig.set("BungeeCord.Enable", false, yamlConfiguration);
T2Cconfig.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);
T2Cconfig.set("UseItem.Enable", true, yamlConfiguration);
T2Cconfig.set("UseItem.AllowToggle", true, yamlConfiguration);
T2Cconfig.set("UseItem.AllowSetSlot", true, yamlConfiguration);
T2Cconfig.set("UseItem.BlockMoveAndDrop", true, yamlConfiguration);
T2Cconfig.set("UseItem.OpenGUI", "default", yamlConfiguration);
T2Cconfig.set("UseItem.Permission.NeededToUse", true, yamlConfiguration);
T2Cconfig.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);
T2Cconfig.set("UseItem.InventorySlot.Slot", 1, yamlConfiguration);
T2Cconfig.set("UseItem.InventorySlot.SlotEnforce", false, yamlConfiguration);
T2Cconfig.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);
T2Cconfig.set("UseItem.Item.Material", "paper", yamlConfiguration);
if (!(T2CmcVersion.isMc1_8() || T2CmcVersion.isMc1_9() || T2CmcVersion.isMc1_10() || T2CmcVersion.isMc1_11() || T2CmcVersion.isMc1_12())) {
T2Cconfig.set("UseItem.Item.PlayerHead.Enable", false, yamlConfiguration);
T2Cconfig.set("UseItem.Item.PlayerHead.Base64.Enable", false, yamlConfiguration);
T2Cconfig.set("UseItem.Item.PlayerHead.Base64.Base64Value", "", yamlConfiguration);
T2Cconfig.set("UseItem.Item.PlayerHead.PlayerWhoHasOpenedTheGUI", false, yamlConfiguration);
T2Cconfig.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);
T2Cconfig.set("UseItem.Item.Name", "&bDefault &6GUI", yamlConfiguration);
T2Cconfig.set("UseItem.Item.Lore", Arrays.asList("&eThis is an example GUI"), yamlConfiguration);
T2Cconfig.set("UseItem.Join.GiveOnEveryJoin", true, yamlConfiguration);
T2Cconfig.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);
T2Cconfig.set("UseItem.Join.Cursor.ToGUIItem.OnEveryLogin", yamlConfiguration);
T2Cconfig.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);
T2Cconfig.set("UseItem.Join.Cursor.ToGUIItem.OnOnlyFirstLogin", yamlConfiguration);
T2Cconfig.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);
T2Cconfig.set("UseItem.Join.Cursor.ToGUIItem.EXPERIMENTELL_ServerChange", yamlConfiguration);
T2Cconfig.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);
T2Cconfig.set("UseItem.Join.Cursor.ToGUIItem.OnLogin.Enable", true, yamlConfiguration);
T2Cconfig.set("UseItem.Join.Cursor.ToGUIItem.Spigot.OnOnlyFirstLogin", true, yamlConfiguration);
T2Cconfig.set("UseItem.Join.Cursor.ToGUIItem.Bungee.OnServerChange", false, yamlConfiguration);
Config.set("Toggle.Items.OnOrYes.Item.Base64.Enable", false, yamlConfiguration);
Config.set("Toggle.Items.OnOrYes.Item.Base64.Base64Value", "", yamlConfiguration);
T2Cconfig.set("Toggle.Items.OnOrYes.Item.Base64.Enable", false, yamlConfiguration);
T2Cconfig.set("Toggle.Items.OnOrYes.Item.Base64.Base64Value", "", yamlConfiguration);
if (Main.legacy) {
Config.set("Toggle.Items.OnOrYes.Item.Material", "WOOL,5", yamlConfiguration);
} else Config.set("Toggle.Items.OnOrYes.Item.Material", ItemVersion.getGreenWool().getType().toString(), yamlConfiguration);
T2Cconfig.set("Toggle.Items.OnOrYes.Item.Material", "WOOL,5", yamlConfiguration);
} else T2Cconfig.set("Toggle.Items.OnOrYes.Item.Material", T2CitemVersion.getGreenWool().getType().toString(), yamlConfiguration);
Config.set("Toggle.Items.OffOrNo.Item.Base64.Enable", false, yamlConfiguration);
Config.set("Toggle.Items.OffOrNo.Item.Base64.Base64Value", "", yamlConfiguration);
T2Cconfig.set("Toggle.Items.OffOrNo.Item.Base64.Enable", false, yamlConfiguration);
T2Cconfig.set("Toggle.Items.OffOrNo.Item.Base64.Base64Value", "", yamlConfiguration);
if (Main.legacy) {
Config.set("Toggle.Items.OffOrNo.Item.Material", "WOOL,14", yamlConfiguration);
} else Config.set("Toggle.Items.OffOrNo.Item.Material", ItemVersion.getRedWool().getType().toString(), yamlConfiguration);
T2Cconfig.set("Toggle.Items.OffOrNo.Item.Material", "WOOL,14", yamlConfiguration);
} else T2Cconfig.set("Toggle.Items.OffOrNo.Item.Material", T2CitemVersion.getRedWool().getType().toString(), yamlConfiguration);
Config.set("Toggle.Permission.Commands.True", "luckperms user [player] permission set [perm] true", yamlConfiguration);
Config.set("Toggle.Permission.Commands.False", "luckperms user [player] permission set [perm] false", yamlConfiguration);
T2Cconfig.set("Toggle.Permission.Commands.True", "luckperms user [player] permission set [perm] true", yamlConfiguration);
T2Cconfig.set("Toggle.Permission.Commands.False", "luckperms user [player] permission set [perm] false", yamlConfiguration);
Config.set("Placeholder.True", "&2true", yamlConfiguration);
Config.set("Placeholder.False", "&4false", yamlConfiguration);
T2Cconfig.set("Placeholder.True", "&2true", yamlConfiguration);
T2Cconfig.set("Placeholder.False", "&4false", yamlConfiguration);
Config.set("Sound.Enable", true, yamlConfiguration);
T2Cconfig.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);
T2Cconfig.set("Sound.OpenInventory.Enable", true, yamlConfiguration);
if (T2CmcVersion.isMc1_8()) {
T2Cconfig.set("Sound.OpenInventory.Sound", "CHEST_OPEN", yamlConfiguration);
} else T2Cconfig.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);
T2Cconfig.set("Sound.Click.Enable", true, yamlConfiguration);
if (T2CmcVersion.isMc1_8()) {
T2Cconfig.set("Sound.Click.Sound", "NOTE_STICKS", yamlConfiguration);
} else if (T2CmcVersion.isMc1_9() || T2CmcVersion.isMc1_10() || T2CmcVersion.isMc1_11() || T2CmcVersion.isMc1_12()) {
T2Cconfig.set("Sound.Click.Sound", "BLOCK_NOTE_HAT", yamlConfiguration);
} else T2Cconfig.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);
T2Cconfig.set("Sound.NoMoney.Enable", true, yamlConfiguration);
if (T2CmcVersion.isMc1_8()) {
T2Cconfig.set("Sound.NoMoney.Sound", "NOTE_PIANO", yamlConfiguration);
} else if (T2CmcVersion.isMc1_9() || T2CmcVersion.isMc1_10() || T2CmcVersion.isMc1_11() || T2CmcVersion.isMc1_12()) {
T2Cconfig.set("Sound.NoMoney.Sound", "BLOCK_NOTE_HARP", yamlConfiguration);
} else T2Cconfig.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);
T2Cconfig.set("Sound.NoInventorySpace.Enable", true, yamlConfiguration);
if (T2CmcVersion.isMc1_8()) {
T2Cconfig.set("Sound.NoInventorySpace.Sound", "NOTE_PIANO", yamlConfiguration);
} else if (T2CmcVersion.isMc1_9() || T2CmcVersion.isMc1_10() || T2CmcVersion.isMc1_11() || T2CmcVersion.isMc1_12()) {
T2Cconfig.set("Sound.NoInventorySpace.Sound", "BLOCK_NOTE_HARP", yamlConfiguration);
} else T2Cconfig.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);
T2Cconfig.set("Sound.Give.Enable", true, yamlConfiguration);
if (T2CmcVersion.isMc1_8()) {
T2Cconfig.set("Sound.Give.Sound", "LEVEL_UP", yamlConfiguration);
} else T2Cconfig.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);
T2Cconfig.set("Sound.PlayerNotFound.Enable", true, yamlConfiguration);
if (T2CmcVersion.isMc1_8()) {
T2Cconfig.set("Sound.PlayerNotFound.Sound", "NOTE_PIANO", yamlConfiguration);
} else if (T2CmcVersion.isMc1_9() || T2CmcVersion.isMc1_10() || T2CmcVersion.isMc1_11() || T2CmcVersion.isMc1_12()) {
T2Cconfig.set("Sound.PlayerNotFound.Sound", "BLOCK_NOTE_HARP", yamlConfiguration);
} else T2Cconfig.set("Sound.PlayerNotFound.Sound", "BLOCK_NOTE_BLOCK_HARP", yamlConfiguration);
Config.set("Advanced.UseItem.GameMode.Change.Enable", true, yamlConfiguration);
Config.set("Advanced.UseItem.GameMode.Change.DelayInTicks", 1, yamlConfiguration);
Config.set("Advanced.UseItem.GameMode.Protection.Enable", false, yamlConfiguration);
Config.set("Advanced.UseItem.GameMode.Protection.RemoveItemWhenItIsDisabled", false, yamlConfiguration);
Config.set("Advanced.UseItem.GameMode.Protection.Mode", "blacklist", yamlConfiguration);
Config.set("Advanced.UseItem.GameMode.Protection.List", Arrays.asList("CREATIVE", "Spectator"), yamlConfiguration);
T2Cconfig.set("Advanced.UseItem.GameMode.Change.Enable", true, yamlConfiguration);
T2Cconfig.set("Advanced.UseItem.GameMode.Change.DelayInTicks", 1, yamlConfiguration);
T2Cconfig.set("Advanced.UseItem.GameMode.Protection.Enable", false, yamlConfiguration);
T2Cconfig.set("Advanced.UseItem.GameMode.Protection.RemoveItemWhenItIsDisabled", false, yamlConfiguration);
T2Cconfig.set("Advanced.UseItem.GameMode.Protection.Mode", "blacklist", yamlConfiguration);
T2Cconfig.set("Advanced.UseItem.GameMode.Protection.List", Arrays.asList("CREATIVE", "Spectator"), yamlConfiguration);
Config.set("Advanced.UseItem.World.Change.Enable", true, yamlConfiguration);
Config.set("Advanced.UseItem.World.Change.DelayInTicks", 1, yamlConfiguration);
Config.set("Advanced.UseItem.World.Protection.Enable", false, yamlConfiguration);
Config.set("Advanced.UseItem.World.Protection.RemoveItemWhenItIsDisabled", false, yamlConfiguration);
Config.set("Advanced.UseItem.World.Protection.Mode", "blacklist", yamlConfiguration);
Config.set("Advanced.UseItem.World.Protection.List", Arrays.asList("World1", "World2"), yamlConfiguration);
T2Cconfig.set("Advanced.UseItem.World.Change.Enable", true, yamlConfiguration);
T2Cconfig.set("Advanced.UseItem.World.Change.DelayInTicks", 1, yamlConfiguration);
T2Cconfig.set("Advanced.UseItem.World.Protection.Enable", false, yamlConfiguration);
T2Cconfig.set("Advanced.UseItem.World.Protection.RemoveItemWhenItIsDisabled", false, yamlConfiguration);
T2Cconfig.set("Advanced.UseItem.World.Protection.Mode", "blacklist", yamlConfiguration);
T2Cconfig.set("Advanced.UseItem.World.Protection.List", Arrays.asList("World1", "World2"), yamlConfiguration);
if (!yamlConfiguration.contains("Advanced.UseItem.ItemBlockBlacklist")) {
List<String> materialList = Arrays.asList("BUTTON", "DOOR", "FENCE", "CHEST", "FURNACE", "NOTE_BLOCK", "CRAFTING_TABLE", "WORKBENCH",
@ -177,7 +177,7 @@ public class ConfigCreate {
if (material.toString().contains(target)) materialBlacklist.add(material.toString());
}
}
Config.set("Advanced.UseItem.ItemBlockBlacklist", materialBlacklist, yamlConfiguration);
T2Cconfig.set("Advanced.UseItem.ItemBlockBlacklist", materialBlacklist, yamlConfiguration);
}
try {
@ -185,6 +185,6 @@ public class ConfigCreate {
} catch (IOException e) {
e.printStackTrace();
}
send.console(Util.getPrefix() + " §2config.yml were successfully created / updated." + " §7- §e" + (System.currentTimeMillis() - long_) + "ms");
T2Csend.console(Util.getPrefix() + " §2config.yml were successfully created / updated." + " §7- §e" + (System.currentTimeMillis() - long_) + "ms");
}
}

View File

@ -4,9 +4,9 @@ import de.jatitv.commandguiv2.Spigot.Main;
import de.jatitv.commandguiv2.Spigot.config.configConverter.ConfigConverterUnderV5;
import de.jatitv.commandguiv2.Spigot.config.languages.SelectMessages;
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 net.t2code.t2codelib.SPIGOT.api.messages.T2Creplace;
import net.t2code.t2codelib.SPIGOT.api.messages.T2Csend;
import net.t2code.t2codelib.SPIGOT.api.minecraftVersion.T2CmcVersion;
import org.bukkit.Sound;
import org.bukkit.configuration.file.YamlConfiguration;
@ -21,11 +21,11 @@ public class SelectConfig {
YamlConfiguration yamlConfiguration = YamlConfiguration.loadConfiguration(config);
if (yamlConfiguration.getInt("ConfigVersion") < Util.getConfigVersion() && new File(Main.getPath(), "config.yml").exists()) {
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----------------------");
T2Csend.console(Util.getPrefix() + " §4----------------------");
T2Csend.console(Util.getPrefix() + " ");
T2Csend.console(Util.getPrefix() + " §6New features have been added to CommandGUI. The Config is adapted!");
T2Csend.console(Util.getPrefix() + " ");
T2Csend.console(Util.getPrefix() + " §4----------------------");
if (yamlConfiguration.getInt("ConfigVersion") < 5) {
ConfigConverterUnderV5.convert();
}
@ -67,7 +67,7 @@ public class SelectConfig {
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_Name = T2Creplace.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");
@ -133,50 +133,50 @@ public class SelectConfig {
public static void sound(String Prefix) {
String soundOpenInventory;
if (MCVersion.minecraft1_8) {
if (T2CmcVersion.isMc1_8()) {
soundOpenInventory = "CHEST_OPEN";
} else {
soundOpenInventory = "BLOCK_CHEST_OPEN";
}
String soundClick;
if (MCVersion.minecraft1_8) {
if (T2CmcVersion.isMc1_8()) {
soundClick = "NOTE_STICKS";
} else if (MCVersion.minecraft1_9 || MCVersion.minecraft1_10 || MCVersion.minecraft1_11 || MCVersion.minecraft1_12) {
} else if (T2CmcVersion.isMc1_9() || T2CmcVersion.isMc1_10() || T2CmcVersion.isMc1_11() || T2CmcVersion.isMc1_12()) {
soundClick = "BLOCK_NOTE_HAT";
} else {
soundClick = "BLOCK_NOTE_BLOCK_HAT";
}
String soundNoMoney;
if (MCVersion.minecraft1_8) {
if (T2CmcVersion.isMc1_8()) {
soundNoMoney = "NOTE_PIANO";
} else if (MCVersion.minecraft1_9 || MCVersion.minecraft1_10 || MCVersion.minecraft1_11 || MCVersion.minecraft1_12) {
} else if (T2CmcVersion.isMc1_9() || T2CmcVersion.isMc1_10() || T2CmcVersion.isMc1_11() || T2CmcVersion.isMc1_12()) {
soundNoMoney = "BLOCK_NOTE_HARP";
} else {
soundNoMoney = "BLOCK_NOTE_BLOCK_HARP";
}
String soundNoInventorySpace;
if (MCVersion.minecraft1_8) {
if (T2CmcVersion.isMc1_8()) {
soundNoInventorySpace = "NOTE_PIANO";
} else if (MCVersion.minecraft1_9 || MCVersion.minecraft1_10 || MCVersion.minecraft1_11 || MCVersion.minecraft1_12) {
} else if (T2CmcVersion.isMc1_9() || T2CmcVersion.isMc1_10() || T2CmcVersion.isMc1_11() || T2CmcVersion.isMc1_12()) {
soundNoInventorySpace = "BLOCK_NOTE_BASS";
} else {
soundNoInventorySpace = "BLOCK_NOTE_BLOCK_GUITAR";
}
String soundGive;
if (MCVersion.minecraft1_8) {
if (T2CmcVersion.isMc1_8()) {
soundGive = "LEVEL_UP";
} else {
soundGive = "ENTITY_PLAYER_LEVELUP";
}
String soundPlayerNotFound;
if (MCVersion.minecraft1_8) {
if (T2CmcVersion.isMc1_8()) {
soundPlayerNotFound = "NOTE_PIANO";
} else if (MCVersion.minecraft1_9 || MCVersion.minecraft1_10 || MCVersion.minecraft1_11 || MCVersion.minecraft1_12) {
} else if (T2CmcVersion.isMc1_9() || T2CmcVersion.isMc1_10() || T2CmcVersion.isMc1_11() || T2CmcVersion.isMc1_12()) {
soundPlayerNotFound = "BLOCK_NOTE_HARP";
} else {
soundPlayerNotFound = "BLOCK_NOTE_BLOCK_HARP";
@ -188,7 +188,7 @@ public class SelectConfig {
Sound_OpenInventory = sound_OpenInventory;
}
} catch (Exception e) {
send.console("§4\n§4\n§4\n" + SelectMessages.SoundNotFound.replace("[prefix]", Prefix)
T2Csend.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);
}
@ -199,7 +199,7 @@ public class SelectConfig {
Sound_Click = sound_Click;
}
} catch (Exception e) {
send.console("§4\n§4\n§4\n" + SelectMessages.SoundNotFound.replace("[prefix]", Prefix)
T2Csend.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);
}
@ -210,7 +210,7 @@ public class SelectConfig {
Sound_Click = sound_NoMoney;
}
} catch (Exception e) {
send.console("§4\n§4\n§4\n" + SelectMessages.SoundNotFound.replace("[prefix]", Prefix)
T2Csend.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);
}
@ -222,7 +222,7 @@ public class SelectConfig {
Sound_NoInventorySpace = sound_NoInventorySpace;
}
} catch (Exception e) {
send.console("§4\n§4\n§4\n" + SelectMessages.SoundNotFound.replace("[prefix]", Prefix)
T2Csend.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);
}
@ -233,7 +233,7 @@ public class SelectConfig {
Sound_Give = sound_Give;
}
} catch (Exception e) {
send.console("§4\n§4\n§4\n" + SelectMessages.SoundNotFound.replace("[prefix]", Prefix)
T2Csend.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);
}
@ -244,7 +244,7 @@ public class SelectConfig {
Sound_PlayerNotFound = sound_PlayerNotFound;
}
} catch (Exception e) {
send.console("§4\n§4\n§4\n" + SelectMessages.SoundNotFound.replace("[prefix]", Prefix)
T2Csend.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

@ -5,8 +5,8 @@ import de.jatitv.commandguiv2.Spigot.config.functions.CreateFunctions;
import de.jatitv.commandguiv2.Spigot.enums.FunctionItemEnum;
import de.jatitv.commandguiv2.Spigot.enums.FunctionVoteEnum;
import de.jatitv.commandguiv2.Util;
import net.t2code.lib.Spigot.Lib.messages.send;
import net.t2code.lib.Spigot.Lib.minecraftVersion.MCVersion;
import net.t2code.t2codelib.SPIGOT.api.messages.T2Csend;
import net.t2code.t2codelib.SPIGOT.api.minecraftVersion.T2CmcVersion;
import org.apache.commons.io.FileUtils;
import org.bukkit.configuration.file.YamlConfiguration;
@ -22,19 +22,19 @@ public class ConfigConverterUnderV5 {
File newF = new File("plugins/T2C-CommandGUI");
if (oldF.renameTo(newF)) {
send.error(Main.getPlugin(), "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!");
send.error(Main.getPlugin(), "");
send.warning(Main.getPlugin(), "File renamed successfully");
send.warning(Main.getPlugin(), "The plugin folder has been renamed from 'CommandGUI' to 'T2C-CommandGUI");
send.error(Main.getPlugin(), "");
send.error(Main.getPlugin(), "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!");
T2Csend.error(Main.getPlugin(), "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!");
T2Csend.error(Main.getPlugin(), "");
T2Csend.warning(Main.getPlugin(), "File renamed successfully");
T2Csend.warning(Main.getPlugin(), "The plugin folder has been renamed from 'CommandGUI' to 'T2C-CommandGUI");
T2Csend.error(Main.getPlugin(), "");
T2Csend.error(Main.getPlugin(), "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!");
} else {
send.error(Main.getPlugin(), "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!");
send.error(Main.getPlugin(), "");
send.error(Main.getPlugin(), "Failed to rename file");
send.error(Main.getPlugin(), "An error occurred while renaming the plugin folder from 'CommandGUI' to 'T2C-CommandGUI'! Please report on our Discord: " + Util.getDiscord());
send.error(Main.getPlugin(), "");
send.error(Main.getPlugin(), "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!");
T2Csend.error(Main.getPlugin(), "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!");
T2Csend.error(Main.getPlugin(), "");
T2Csend.error(Main.getPlugin(), "Failed to rename file");
T2Csend.error(Main.getPlugin(), "An error occurred while renaming the plugin folder from 'CommandGUI' to 'T2C-CommandGUI'! Please report on our Discord: " + Util.getDiscord());
T2Csend.error(Main.getPlugin(), "");
T2Csend.error(Main.getPlugin(), "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!");
}
}
}
@ -49,23 +49,23 @@ public class ConfigConverterUnderV5 {
} catch (IOException e) {
e.printStackTrace();
}
send.error(Main.getPlugin(), "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!");
send.error(Main.getPlugin(), "");
send.warning(Main.getPlugin(), "'Slots.Function.NoPermission.Message.Enable' was added to the function " + config.getName() + "!");
send.warning(Main.getPlugin(), "'Slots.Function.NoPermission.Message.CustomNoPermMessage' was added to the function " + config.getName() + "!");
send.warning(Main.getPlugin(), "'Slots.Function.NoPermission.Item.Lore.Enable' was added to the function " + config.getName() + "!");
send.warning(Main.getPlugin(), "'Slots.Function.NoPermission.Item.Lore.Lore' was added to the function " + config.getName() + "!");
send.error(Main.getPlugin(), "");
send.error(Main.getPlugin(), "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!");
T2Csend.error(Main.getPlugin(), "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!");
T2Csend.error(Main.getPlugin(), "");
T2Csend.warning(Main.getPlugin(), "'Slots.Function.NoPermission.Message.Enable' was added to the function " + config.getName() + "!");
T2Csend.warning(Main.getPlugin(), "'Slots.Function.NoPermission.Message.CustomNoPermMessage' was added to the function " + config.getName() + "!");
T2Csend.warning(Main.getPlugin(), "'Slots.Function.NoPermission.Item.Lore.Enable' was added to the function " + config.getName() + "!");
T2Csend.warning(Main.getPlugin(), "'Slots.Function.NoPermission.Item.Lore.Lore' was added to the function " + config.getName() + "!");
T2Csend.error(Main.getPlugin(), "");
T2Csend.error(Main.getPlugin(), "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!");
}
public static void convert() {
renameFolder();
send.console(Util.getPrefix() + " §7[§5ConfigConvert§7] §4----------------------");
send.console(Util.getPrefix() + " §7[§5ConfigConvert§7]");
send.console(Util.getPrefix() + " §7[§5ConfigConvert§7] §4Config conversion to the new config structure starts!");
send.console(Util.getPrefix() + " §7[§5ConfigConvert§7]");
send.console(Util.getPrefix() + " §7[§5ConfigConvert§7] §4----------------------");
T2Csend.console(Util.getPrefix() + " §7[§5ConfigConvert§7] §4----------------------");
T2Csend.console(Util.getPrefix() + " §7[§5ConfigConvert§7]");
T2Csend.console(Util.getPrefix() + " §7[§5ConfigConvert§7] §4Config conversion to the new config structure starts!");
T2Csend.console(Util.getPrefix() + " §7[§5ConfigConvert§7]");
T2Csend.console(Util.getPrefix() + " §7[§5ConfigConvert§7] §4----------------------");
File f = new File(Main.getPath() + "/OldConfig/GUIs/Version4");
File[] fileArray = f.listFiles();
@ -83,7 +83,7 @@ public class ConfigConverterUnderV5 {
String name = yamlConfigurationOld.getString("GUI.Name");
Boolean fillItemEnable = yamlConfigurationOld.getBoolean("GUI.FillItem.Enable");
String fillItem;
if (MCVersion.minecraft1_8 || MCVersion.minecraft1_9 || MCVersion.minecraft1_10 || MCVersion.minecraft1_11 || MCVersion.minecraft1_12) {
if (T2CmcVersion.isMc1_8() || T2CmcVersion.isMc1_9() || T2CmcVersion.isMc1_10() || T2CmcVersion.isMc1_11() || T2CmcVersion.isMc1_12()) {
fillItem = yamlConfigurationOld.getString("GUI.FillItem.GlassPaneColor");
} else fillItem = yamlConfigurationOld.getString("GUI.FillItem.Item");
@ -162,11 +162,11 @@ public class ConfigConverterUnderV5 {
}
}
}
send.console(Util.getPrefix() + " §7[§5ConfigConvert§7] §4----------------------");
send.console(Util.getPrefix() + " §7[§5ConfigConvert§7]");
send.console(Util.getPrefix() + " §7[§5ConfigConvert§7] §4The conversion to the new config structure is completed!");
send.console(Util.getPrefix() + " §7[§5ConfigConvert§7]");
send.console(Util.getPrefix() + " §7[§5ConfigConvert§7] §4----------------------");
T2Csend.console(Util.getPrefix() + " §7[§5ConfigConvert§7] §4----------------------");
T2Csend.console(Util.getPrefix() + " §7[§5ConfigConvert§7]");
T2Csend.console(Util.getPrefix() + " §7[§5ConfigConvert§7] §4The conversion to the new config structure is completed!");
T2Csend.console(Util.getPrefix() + " §7[§5ConfigConvert§7]");
T2Csend.console(Util.getPrefix() + " §7[§5ConfigConvert§7] §4----------------------");
}
private static void renameFolder() {
@ -185,7 +185,7 @@ public class ConfigConverterUnderV5 {
set("GUI.Lines", lines, yamlConfiguration);
set("GUI.Name", name, yamlConfiguration);
set("GUI.FillItem.Enable", fillItemEnable, yamlConfiguration);
if (MCVersion.minecraft1_8 || MCVersion.minecraft1_9 || MCVersion.minecraft1_10 || MCVersion.minecraft1_11 || MCVersion.minecraft1_12) {
if (T2CmcVersion.isMc1_8() || T2CmcVersion.isMc1_9() || T2CmcVersion.isMc1_10() || T2CmcVersion.isMc1_11() || T2CmcVersion.isMc1_12()) {
set("GUI.FillItem.GlassPaneColor", fillItem, yamlConfiguration);
} else set("GUI.FillItem.Item", fillItem, yamlConfiguration);

View File

@ -4,7 +4,7 @@ import de.jatitv.commandguiv2.Spigot.Main;
import de.jatitv.commandguiv2.Spigot.enums.FunctionItemEnum;
import de.jatitv.commandguiv2.Spigot.enums.FunctionVoteEnum;
import de.jatitv.commandguiv2.Util;
import net.t2code.lib.Spigot.Lib.messages.send;
import net.t2code.t2codelib.SPIGOT.api.messages.T2Csend;
import org.bukkit.configuration.file.YamlConfiguration;
import java.io.File;
@ -56,7 +56,7 @@ public class CreateFunctions {
i++;
}
send.console(Util.getPrefix() + " §4Function GUI file (Functions/" + config.getName() + ") is loaded...");
T2Csend.console(Util.getPrefix() + " §4Function GUI file (Functions/" + config.getName() + ") is loaded...");
YamlConfiguration yamlConfiguration = YamlConfiguration.loadConfiguration(config);
@ -130,7 +130,7 @@ public class CreateFunctions {
} catch (IOException e) {
e.printStackTrace();
}
send.console(Util.getPrefix() + " §2Function file (Functions/" + config.getName() + ") was loaded." + " §7- §e" + (System.currentTimeMillis() - long_) + "ms");
T2Csend.console(Util.getPrefix() + " §2Function file (Functions/" + config.getName() + ") was loaded." + " §7- §e" + (System.currentTimeMillis() - long_) + "ms");
}

View File

@ -2,20 +2,18 @@ package de.jatitv.commandguiv2.Spigot.config.gui;
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.t2codelib.SPIGOT.api.messages.T2Csend;
import net.t2code.t2codelib.SPIGOT.api.minecraftVersion.T2CmcVersion;
import org.bukkit.configuration.file.YamlConfiguration;
import java.io.File;
import java.io.IOException;
import java.util.Arrays;
import java.util.List;
public class CreateGUI {
public static void configCreate() {
long long_ = System.currentTimeMillis();
send.console(Util.getPrefix() + " §4Default GUI file (GUIs/default.yml) is loaded...");
T2Csend.console(Util.getPrefix() + " §4Default GUI file (GUIs/default.yml) is loaded...");
File config = new File(Main.getPath(), "GUIs/default.yml");
YamlConfiguration yamlConfiguration = YamlConfiguration.loadConfiguration(config);
@ -23,7 +21,7 @@ public class CreateGUI {
set("GUI.Lines", 1, yamlConfiguration);
set("GUI.Name", "&5default &9GUI", yamlConfiguration);
set("GUI.FillItem.Enable", true, yamlConfiguration);
if (MCVersion.minecraft1_8 || MCVersion.minecraft1_9 || MCVersion.minecraft1_10 || MCVersion.minecraft1_11 || MCVersion.minecraft1_12) {
if (T2CmcVersion.isMc1_8() || T2CmcVersion.isMc1_9() || T2CmcVersion.isMc1_10() || T2CmcVersion.isMc1_11() || T2CmcVersion.isMc1_12()) {
set("GUI.FillItem.GlassPaneColor", 15, yamlConfiguration);
} else set("GUI.FillItem.Item", "BLACK_STAINED_GLASS_PANE", yamlConfiguration);
@ -50,7 +48,7 @@ public class CreateGUI {
} catch (IOException e) {
e.printStackTrace();
}
send.console(Util.getPrefix() + " §2Default GUI file (GUIs/default.yml) was loaded." + " §7- §e" + (System.currentTimeMillis() - long_) + "ms");
T2Csend.console(Util.getPrefix() + " §2Default GUI file (GUIs/default.yml) was loaded." + " §7- §e" + (System.currentTimeMillis() - long_) + "ms");
}
private static void set(String path, String value, YamlConfiguration config) {

View File

@ -2,7 +2,7 @@ package de.jatitv.commandguiv2.Spigot.config.languages;
import de.jatitv.commandguiv2.Spigot.Main;
import de.jatitv.commandguiv2.Util;
import net.t2code.lib.Spigot.Lib.messages.send;
import net.t2code.t2codelib.SPIGOT.api.messages.T2Csend;
import org.bukkit.configuration.file.YamlConfiguration;
import org.bukkit.plugin.Plugin;
@ -13,7 +13,7 @@ public class LanguagesCreate {
private static Plugin plugin = Main.getPlugin();
public static void langCreate() {
send.debug(plugin,"§4Language files are created / updated...");
T2Csend.debug(plugin, "§4Language files are created / updated...");
Long long_ = Long.valueOf(System.currentTimeMillis());
/**
@ -63,13 +63,13 @@ public class LanguagesCreate {
set("Player.PlayerNotFond", MSG.EN_PlayerNotFond, yamlConfigurationEN);
set("Player.PlayerNoInventorySpace", MSG.EN_PlayerNoInventorySpace, yamlConfigurationEN);
set("FunctionItem.Add", MSG.EN_FunctionItemAdd,yamlConfigurationEN);
set("FunctionItem.Remove", MSG.EN_FunctionItemRemove,yamlConfigurationEN);
set("FunctionItem.RemoveError", MSG.EN_FunctionItemRemoveError,yamlConfigurationEN);
set("FunctionItem.Add", MSG.EN_FunctionItemAdd, yamlConfigurationEN);
set("FunctionItem.Remove", MSG.EN_FunctionItemRemove, yamlConfigurationEN);
set("FunctionItem.RemoveError", MSG.EN_FunctionItemRemoveError, yamlConfigurationEN);
set("FunctionVote.Add", MSG.EN_FunctionVoteAdd,yamlConfigurationEN);
set("FunctionVote.Remove", MSG.EN_FunctionVoteRemove,yamlConfigurationEN);
set("FunctionVote.RemoveError", MSG.EN_FunctionVoteRemoveError,yamlConfigurationEN);
set("FunctionVote.Add", MSG.EN_FunctionVoteAdd, yamlConfigurationEN);
set("FunctionVote.Remove", MSG.EN_FunctionVoteRemove, yamlConfigurationEN);
set("FunctionVote.RemoveError", MSG.EN_FunctionVoteRemoveError, yamlConfigurationEN);
set("Help.CGUI", MSG.EN_Help_CGUI, yamlConfigurationEN);
set("Help.Help", MSG.EN_Help_Help, yamlConfigurationEN);
@ -96,7 +96,7 @@ public class LanguagesCreate {
try {
yamlConfigurationEN.save(messagesEN);
} catch (IOException e) {
send.warning(plugin,e.getMessage());
T2Csend.warning(plugin, e.getMessage());
e.printStackTrace();
}
@ -148,13 +148,13 @@ public class LanguagesCreate {
set("Player.PlayerNotFond", MSG.DE_PlayerNotFond, yamlConfigurationDE);
set("Player.PlayerNoInventorySpace", MSG.DE_PlayerNoInventorySpace, yamlConfigurationDE);
set("FunctionItem.Add", MSG.DE_FunctionItemAdd,yamlConfigurationDE);
set("FunctionItem.Remove", MSG.DE_FunctionItemRemove,yamlConfigurationDE);
set("FunctionItem.RemoveError", MSG.DE_FunctionItemRemoveError,yamlConfigurationDE);
set("FunctionItem.Add", MSG.DE_FunctionItemAdd, yamlConfigurationDE);
set("FunctionItem.Remove", MSG.DE_FunctionItemRemove, yamlConfigurationDE);
set("FunctionItem.RemoveError", MSG.DE_FunctionItemRemoveError, yamlConfigurationDE);
set("FunctionVote.Add", MSG.DE_FunctionVoteAdd,yamlConfigurationDE);
set("FunctionVote.Remove", MSG.DE_FunctionVoteRemove,yamlConfigurationDE);
set("FunctionVote.RemoveError", MSG.DE_FunctionVoteRemoveError,yamlConfigurationDE);
set("FunctionVote.Add", MSG.DE_FunctionVoteAdd, yamlConfigurationDE);
set("FunctionVote.Remove", MSG.DE_FunctionVoteRemove, yamlConfigurationDE);
set("FunctionVote.RemoveError", MSG.DE_FunctionVoteRemoveError, yamlConfigurationDE);
set("Help.CGUI", MSG.DE_Help_CGUI, yamlConfigurationDE);
set("Help.Help", MSG.DE_Help_Help, yamlConfigurationDE);
@ -181,7 +181,7 @@ public class LanguagesCreate {
try {
yamlConfigurationDE.save(messagesDE);
} catch (IOException e) {
send.warning(plugin,e.getMessage());
T2Csend.warning(plugin, e.getMessage());
e.printStackTrace();
}
@ -234,13 +234,13 @@ public class LanguagesCreate {
set("Player.PlayerNotFond", MSG.NO_PlayerNotFond, yamlConfigurationNO);
set("Player.PlayerNoInventorySpace", MSG.NO_PlayerNoInventorySpace, yamlConfigurationNO);
set("FunctionItem.Add", MSG.NO_FunctionItemAdd,yamlConfigurationNO);
set("FunctionItem.Remove", MSG.NO_FunctionItemRemove,yamlConfigurationNO);
set("FunctionItem.RemoveError", MSG.NO_FunctionItemRemoveError,yamlConfigurationNO);
set("FunctionItem.Add", MSG.NO_FunctionItemAdd, yamlConfigurationNO);
set("FunctionItem.Remove", MSG.NO_FunctionItemRemove, yamlConfigurationNO);
set("FunctionItem.RemoveError", MSG.NO_FunctionItemRemoveError, yamlConfigurationNO);
set("FunctionVote.Add", MSG.NO_FunctionVoteAdd,yamlConfigurationNO);
set("FunctionVote.Remove", MSG.NO_FunctionVoteRemove,yamlConfigurationNO);
set("FunctionVote.RemoveError", MSG.NO_FunctionVoteRemoveError,yamlConfigurationNO);
set("FunctionVote.Add", MSG.NO_FunctionVoteAdd, yamlConfigurationNO);
set("FunctionVote.Remove", MSG.NO_FunctionVoteRemove, yamlConfigurationNO);
set("FunctionVote.RemoveError", MSG.NO_FunctionVoteRemoveError, yamlConfigurationNO);
set("Help.CGUI", MSG.NO_Help_CGUI, yamlConfigurationNO);
set("Help.Help", MSG.NO_Help_Help, yamlConfigurationNO);
@ -267,12 +267,11 @@ public class LanguagesCreate {
try {
yamlConfigurationNO.save(messagesNO);
} catch (IOException e) {
send.warning(plugin,e.getMessage());
T2Csend.warning(plugin, e.getMessage());
e.printStackTrace();
}
send.console(Util.getPrefix() + " §2Language files were successfully created / updated." + " §7- §e" + (System.currentTimeMillis() - long_.longValue()) + "ms");
T2Csend.console(Util.getPrefix() + " §2Language files were successfully created / updated." + " §7- §e" + (System.currentTimeMillis() - long_.longValue()) + "ms");
}
private static void set(String path, String value, YamlConfiguration config) {

View File

@ -3,8 +3,8 @@ 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 net.t2code.t2codelib.SPIGOT.api.messages.T2Creplace;
import net.t2code.t2codelib.SPIGOT.api.messages.T2Csend;
import org.bukkit.configuration.file.YamlConfiguration;
import java.io.File;
@ -82,20 +82,19 @@ public class SelectMessages {
public static String PlayerGUIItemHelp_Slot;
public static void onSelect(String Prefix) {
send.debug(Main.getPlugin(), "§4Select language...");
T2Csend.debug(Main.getPlugin(), "§4Select language...");
long long_ = System.currentTimeMillis();
File msg;
msg = new File(Main.getPath(), "languages/" + SelectConfig.getLanguage() + "_messages.yml");
if (!msg.isFile()) {
send.console(Prefix);
send.console(Prefix + " §4!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!");
send.console(Prefix + " §4The selected §c" + SelectConfig.getLanguage() + " §4language file was not found.");
send.console(Prefix + " §6The default language §eEnglish §6is used!");
send.console(Prefix + " §4!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!");
send.console(Prefix);
T2Csend.console(Prefix);
T2Csend.console(Prefix + " §4!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!");
T2Csend.console(Prefix + " §4The selected §c" + SelectConfig.getLanguage() + " §4language file was not found.");
T2Csend.console(Prefix + " §6The default language §eEnglish §6is used!");
T2Csend.console(Prefix + " §4!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!");
T2Csend.console(Prefix);
msg = new File(Main.getPath(), "languages/" + "english_messages.yml");
selectMSG = "english";
} else selectMSG = SelectConfig.getLanguage();
@ -171,10 +170,10 @@ public class SelectMessages {
PlayerGUIItemHelp_Slot = select("Help.Player.UseItem_Slot", yamlConfiguration_msg);
send.console(Prefix + " §2Language successfully selected to: §6" + selectMSG + " §7- §e" + (System.currentTimeMillis() - long_) + "ms");
T2Csend.console(Prefix + " §2Language successfully selected to: §6" + selectMSG + " §7- §e" + (System.currentTimeMillis() - long_) + "ms");
}
private static String select(String path, YamlConfiguration yamlConfiguration) {
return Replace.replace(Util.getPrefix(), Objects.requireNonNull(yamlConfiguration.getString(path)));
return T2Creplace.replace(Util.getPrefix(), Objects.requireNonNull(yamlConfiguration.getString(path)));
}
}

View File

@ -5,7 +5,7 @@ import com.zaxxer.hikari.HikariDataSource;
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.t2codelib.SPIGOT.api.messages.T2Csend;
import java.sql.*;
import java.time.ZoneId;
@ -22,7 +22,7 @@ public class MySQL {
long long_ = System.currentTimeMillis();
Calendar now = Calendar.getInstance();
ZoneId timeZone = now.getTimeZone().toZoneId();
send.debug(Main.getPlugin(), "Server TimeZone is : " + timeZone);
T2Csend.debug(Main.getPlugin(), "Server TimeZone is : " + timeZone);
try {
config.setJdbcUrl("jdbc:mysql://" + SelectConfig.getMysqlIp() + ":" + SelectConfig.getMysqlPort() + "/" + SelectConfig.getMysqlDatabase()
+ "?useJDBCCompliantTimezoneShift=true&allowMultiQueries=true&useLegacyDatetimeCode=false&autoReconnect=true&serverTimezone=" + timeZone
@ -33,23 +33,23 @@ public class MySQL {
config.addDataSourceProperty("prepStmtCacheSize", "250");
config.addDataSourceProperty("prepStmtCacheSqlLimit", "2048");
ds = new HikariDataSource(config);
send.console(Util.getPrefix() + " §2MYSQL successfully connected." + " §7- §e" + (System.currentTimeMillis() - long_) + "ms");
T2Csend.console(Util.getPrefix() + " §2MYSQL successfully connected." + " §7- §e" + (System.currentTimeMillis() - long_) + "ms");
} catch (Exception ex) {
send.console(Util.getPrefix() + " §4MYSQL not connected." + " §7- §e" + (System.currentTimeMillis() - long_) + "ms");
send.error(Main.getPlugin(), ex.getMessage() + " --- " + (System.currentTimeMillis() - long_) + "ms");
T2Csend.console(Util.getPrefix() + " §4MYSQL not connected." + " §7- §e" + (System.currentTimeMillis() - long_) + "ms");
T2Csend.error(Main.getPlugin(), ex.getMessage() + " --- " + (System.currentTimeMillis() - long_) + "ms");
}
if (SelectConfig.getDebug() || Main.version.toLowerCase().contains("dev") || Main.version.toLowerCase().contains("beta") || Main.version.toLowerCase().contains("snapshot")) {
try {
send.error(Main.getPlugin(), "MySQL DEBUG:");
T2Csend.error(Main.getPlugin(), "MySQL DEBUG:");
Connection con = ds.getConnection();
DatabaseMetaData dbmd = con.getMetaData();
send.debugmsg(Main.getPlugin(), "§6Metadata of the database:");
send.debugmsg(Main.getPlugin(), "§6DB: §e" + dbmd.getDatabaseProductName());
send.debugmsg(Main.getPlugin(), "§6Version: §e" + dbmd.getDatabaseProductVersion());
send.debugmsg(Main.getPlugin(), "§6Driver: §e" + dbmd.getDriverName());
send.debugmsg(Main.getPlugin(), "§6Driver MajorVersion: §e" + dbmd.getDriverMajorVersion() + "." + dbmd.getDriverMinorVersion());
send.debugmsg(Main.getPlugin(), "§6Driver Version: §e" + dbmd.getDriverVersion());
T2Csend.debugmsg(Main.getPlugin(), "§6Metadata of the database:");
T2Csend.debugmsg(Main.getPlugin(), "§6DB: §e" + dbmd.getDatabaseProductName());
T2Csend.debugmsg(Main.getPlugin(), "§6Version: §e" + dbmd.getDatabaseProductVersion());
T2Csend.debugmsg(Main.getPlugin(), "§6Driver: §e" + dbmd.getDriverName());
T2Csend.debugmsg(Main.getPlugin(), "§6Driver MajorVersion: §e" + dbmd.getDriverMajorVersion() + "." + dbmd.getDriverMinorVersion());
T2Csend.debugmsg(Main.getPlugin(), "§6Driver Version: §e" + dbmd.getDriverVersion());
con.close();
} catch (SQLException e) {
throw new RuntimeException(e);
@ -65,7 +65,7 @@ public class MySQL {
if (ds == null) {
return;
}
send.debug(Main.getPlugin(), query);
T2Csend.debug(Main.getPlugin(), query);
Connection con = ds.getConnection();
Statement stmt = con.createStatement();
stmt.execute(query);
@ -75,7 +75,7 @@ public class MySQL {
public static HashMap<String, ArrayList<String>> selectAll(String query) {
send.debug(Main.getPlugin(), query);
T2Csend.debug(Main.getPlugin(), query);
HashMap<String, ArrayList<String>> Result = new HashMap<>();
try (Connection con = ds.getConnection()) {
Statement stmt = con.createStatement();
@ -97,7 +97,7 @@ public class MySQL {
}
public static String select(String query) {
send.debug(Main.getPlugin(), query);
T2Csend.debug(Main.getPlugin(), query);
String Ausgabe = "";
try (Connection con = ds.getConnection()) {
Statement stmt = con.createStatement();
@ -114,7 +114,7 @@ public class MySQL {
}
public static int count(String query) {
send.debug(Main.getPlugin(), query);
T2Csend.debug(Main.getPlugin(), query);
int count = 0;
try (Connection con = ds.getConnection()) {
Statement stmt = con.createStatement();
@ -131,7 +131,7 @@ public class MySQL {
}
public static ArrayList<String> selectRow(String query) {
send.debug(Main.getPlugin(), query);
T2Csend.debug(Main.getPlugin(), query);
ArrayList<String> Result = new ArrayList<>();
try (Connection con = ds.getConnection()) {
Statement stmt = con.createStatement();

View File

@ -2,7 +2,7 @@ package de.jatitv.commandguiv2.Spigot.database;
import de.jatitv.commandguiv2.Spigot.Main;
import de.jatitv.commandguiv2.Util;
import net.t2code.lib.Spigot.Lib.messages.send;
import net.t2code.t2codelib.SPIGOT.api.messages.T2Csend;
import org.bukkit.Bukkit;
import java.io.File;
@ -28,7 +28,7 @@ public class SQLITE {
public static void query(String query) {
send.debug(Main.getPlugin(), query);
T2Csend.debug(Main.getPlugin(), query);
try {
Statement stmt = con.createStatement();
stmt.execute(query);
@ -42,7 +42,7 @@ public class SQLITE {
try {
Statement stmt = con.createStatement();
for (String query : queryList) {
send.debug(Main.getPlugin(), query);
T2Csend.debug(Main.getPlugin(), query);
stmt.addBatch(query);
}
stmt.executeBatch();
@ -54,7 +54,7 @@ public class SQLITE {
public static HashMap<String, ArrayList<String>> selectAll(String query) {
send.debug(Main.getPlugin(), query);
T2Csend.debug(Main.getPlugin(), query);
HashMap<String, ArrayList<String>> Result = new HashMap<>();
try {
Statement stmt = con.createStatement();
@ -76,7 +76,7 @@ public class SQLITE {
}
public static String select(String query) {
send.debug(Main.getPlugin(), query);
T2Csend.debug(Main.getPlugin(), query);
String Ausgabe = "";
try {
Statement stmt = con.createStatement();
@ -93,7 +93,7 @@ public class SQLITE {
}
public static int count(String query) {
send.debug(Main.getPlugin(), query);
T2Csend.debug(Main.getPlugin(), query);
int count = 0;
try {
Statement stmt = con.createStatement();
@ -110,7 +110,7 @@ public class SQLITE {
}
public static ArrayList<String> selectRow(String query) {
send.debug(Main.getPlugin(), query);
T2Csend.debug(Main.getPlugin(), query);
ArrayList<String> Result = new ArrayList<>();
try {
Statement stmt = con.createStatement();

View File

@ -2,7 +2,7 @@ package de.jatitv.commandguiv2.Spigot.database;
import de.jatitv.commandguiv2.Spigot.Main;
import de.jatitv.commandguiv2.Spigot.objects.Obj_Select;
import net.t2code.lib.Spigot.Lib.messages.send;
import net.t2code.t2codelib.SPIGOT.api.messages.T2Csend;
import org.bukkit.configuration.file.YamlConfiguration;
import org.bukkit.entity.Player;
import org.bukkit.plugin.Plugin;
@ -58,11 +58,11 @@ public class YML {
public static Integer selectSlot(Player player) {
send.debug(plugin, "yml-1");
T2Csend.debug(plugin, "yml-1");
if (!yamlConfigurationStorage.contains(String.valueOf(player.getUniqueId()))) return null;
if (yamlConfigurationStorage.getString(player.getUniqueId() + ".Slot") == null) return null;
send.debug(plugin, "yml-2");
send.debug(plugin, String.valueOf(yamlConfigurationStorage.getInt(player.getUniqueId() + ".Slot")));
T2Csend.debug(plugin, "yml-2");
T2Csend.debug(plugin, String.valueOf(yamlConfigurationStorage.getInt(player.getUniqueId() + ".Slot")));
return yamlConfigurationStorage.getInt(player.getUniqueId() + ".Slot");
}
}

View File

@ -14,10 +14,10 @@ import de.jatitv.commandguiv2.Spigot.system.Placeholder;
import de.jatitv.commandguiv2.Spigot.sound.Sound;
import de.jatitv.commandguiv2.Spigot.enums.SoundEnum;
import de.jatitv.commandguiv2.Util;
import net.t2code.lib.Spigot.Lib.eco.Eco;
import net.t2code.lib.Spigot.Lib.items.ItemVersion;
import net.t2code.lib.Spigot.Lib.messages.send;
import net.t2code.lib.Spigot.Lib.replace.Replace;
import net.t2code.t2codelib.SPIGOT.api.eco.T2Ceco;
import net.t2code.t2codelib.SPIGOT.api.items.T2CitemVersion;
import net.t2code.t2codelib.SPIGOT.api.messages.T2Creplace;
import net.t2code.t2codelib.SPIGOT.api.messages.T2Csend;
import org.bukkit.Bukkit;
import org.bukkit.Material;
import org.bukkit.configuration.file.YamlConfiguration;
@ -26,8 +26,8 @@ import org.bukkit.event.EventHandler;
import org.bukkit.event.Listener;
import org.bukkit.event.inventory.ClickType;
import org.bukkit.event.inventory.InventoryClickEvent;
import org.bukkit.inventory.ItemStack;
import org.bukkit.plugin.Plugin;
import org.bukkit.plugin.java.JavaPlugin;
import org.bukkit.scheduler.BukkitRunnable;
import java.io.File;
@ -45,8 +45,8 @@ public class GUIListener implements Listener {
if (e.getInventory() == null) return;
if (e.getCurrentItem() == null) return;
for (Gui gui : Main.guiHashMap.values()) {
if (player.getOpenInventory().getTitle().equals(Replace.replace(prefix, GUICode + gui.guiName))
|| (Main.PaPi && player.getOpenInventory().getTitle().equals(Replace.replace(prefix, player, GUICode + gui.guiName)))) {
if (player.getOpenInventory().getTitle().equals(T2Creplace.replace(prefix, GUICode + gui.guiName))
|| (Main.PaPi && player.getOpenInventory().getTitle().equals(T2Creplace.replace(prefix, player, GUICode + gui.guiName)))) {
e.setCancelled(true);
for (Slot slot : gui.slots) {
execute(e, slot, player, gui);
@ -62,16 +62,16 @@ public class GUIListener implements Listener {
if (slot.permission && !player.hasPermission(slot.permissionToUse)) {
if (function.noPermMessageEnable) {
if (function.customNoPermMessage == null || function.customNoPermMessage.equals("")) {
send.player(player, SelectMessages.NoPermissionForItem.replace("[item]", Replace.replace(prefix, function.name))
T2Csend.player(player, SelectMessages.NoPermissionForItem.replace("[item]", T2Creplace.replace(prefix, function.name))
.replace("[perm]", slot.permissionToUse));
} else send.player(player, function.customNoPermMessage.replace("[item]", Replace.replace(prefix, function.name))
} else T2Csend.player(player, function.customNoPermMessage.replace("[item]", T2Creplace.replace(prefix, function.name))
.replace("[perm]", slot.permissionToUse));
}
return;
}
if (e.getCurrentItem().getType() == ItemVersion.getHead() || e.getCurrentItem().getType() == ItemVersion.getGreenWool().getType() ||
e.getCurrentItem().getType() == ItemVersion.getRedWool().getType() ||
if (e.getCurrentItem().getType() == T2CitemVersion.getHead() || e.getCurrentItem().getType() == T2CitemVersion.getGreenWool().getType() ||
e.getCurrentItem().getType() == T2CitemVersion.getRedWool().getType() ||
e.getCurrentItem().getType() == Material.valueOf(function.item.toUpperCase().replace(".", "_"))) {
if (!slot.enable) return;
if (function.cost_Enable) {
@ -120,8 +120,8 @@ public class GUIListener implements Listener {
Bungee_Sender_Reciver.sendToBungee(player, cmd.replace("[player]", player.getName()), slot.commandAsConsole);
}
} else {
send.console(prefix + " §4To use bungee commands, enable the Bungee option in the config.");
send.player(player, prefix + " §4To use bungee commands, enable the Bungee option in the config.");
T2Csend.console(prefix + " §4To use bungee commands, enable the Bungee option in the config.");
T2Csend.player(player, prefix + " §4To use bungee commands, enable the Bungee option in the config.");
}
} else {
for (String cmd : slot.command) {
@ -149,12 +149,12 @@ public class GUIListener implements Listener {
for (String msg : slot.message) {
if (Main.PaPi) {
if (slot.cost_Enable) {
send.player(player, Replace.replacePrice(prefix, player, Placeholder.replace(msg, player), slot.price + " " + SelectConfig.getCurrency()));
} else send.player(player, Replace.replace(prefix, player, Placeholder.replace(msg, player)));
T2Csend.player(player, T2Creplace.replacePrice(prefix, player, Placeholder.replace(msg, player), slot.price + " " + SelectConfig.getCurrency()));
} else T2Csend.player(player, T2Creplace.replace(prefix, player, Placeholder.replace(msg, player)));
} else {
if (slot.cost_Enable) {
send.player(player, Replace.replacePrice(prefix, Placeholder.replace(msg, player), slot.price + " " + SelectConfig.getCurrency()));
} else send.player(player, Replace.replace(prefix, Placeholder.replace(msg, player)));
T2Csend.player(player, T2Creplace.replacePrice(prefix, Placeholder.replace(msg, player), slot.price + " " + SelectConfig.getCurrency()));
} else T2Csend.player(player, T2Creplace.replace(prefix, Placeholder.replace(msg, player)));
}
}
}
@ -166,7 +166,7 @@ public class GUIListener implements Listener {
player.closeInventory();
}
}.runTaskLater(plugin, 1L);
send.player(player, SelectMessages.onServerChange.replace("[server]", slot.serverChangeServer));
T2Csend.player(player, SelectMessages.onServerChange.replace("[server]", slot.serverChangeServer));
new BukkitRunnable() {
@Override
public void run() {
@ -197,7 +197,7 @@ public class GUIListener implements Listener {
yamlConfiguration.set(slot.configOptionPath.replace("/", "."), slot.configListValueLeft);
break;
default:
send.player(player, "§cCheck the Option §6SetConfig/Option/Premat"); //todo
T2Csend.player(player, "§cCheck the Option §6SetConfig/Option/Premat"); //todo
break;
}
@ -220,7 +220,7 @@ public class GUIListener implements Listener {
yamlConfiguration.set(slot.configOptionPath.replace("/", "."), slot.configListValueRight);
break;
default:
send.player(player, "§cCheck the Option §6SetConfig/Option/Premat"); //todo
T2Csend.player(player, "§cCheck the Option §6SetConfig/Option/Premat"); //todo
break;
}
@ -281,13 +281,13 @@ public class GUIListener implements Listener {
player.closeInventory();
switch (function.functionVotePointsMode) {
case ADD:
Eco.votePointsAdd(prefix, player, function.functionVotePointsAmount);
send.player(player, SelectMessages.functionVoteAdd.replace("[amount]", function.functionVotePointsAmount.toString()));
T2Ceco.votePointsAdd(prefix, player, function.functionVotePointsAmount);
T2Csend.player(player, SelectMessages.functionVoteAdd.replace("[amount]", function.functionVotePointsAmount.toString()));
break;
case REMOVE:
if (Eco.votePointsRemove(prefix, player, function.functionVotePointsAmount)) {
send.player(player, SelectMessages.functionVoteRemove.replace("[amount]", function.functionVotePointsAmount.toString()));
} else send.player(player, SelectMessages.functionVoteRemoveError.replace("[amount]", function.functionVotePointsAmount.toString()));
if (T2Ceco.votePointsRemove(prefix, player, function.functionVotePointsAmount)) {
T2Csend.player(player, SelectMessages.functionVoteRemove.replace("[amount]", function.functionVotePointsAmount.toString()));
} else T2Csend.player(player, SelectMessages.functionVoteRemoveError.replace("[amount]", function.functionVotePointsAmount.toString()));
break;
}
}
@ -297,14 +297,14 @@ public class GUIListener implements Listener {
player.closeInventory();
switch (function.functionItemMode) {
case ADD:
Eco.itemAdd(player, item[0], Integer.parseInt(item[1]));
send.player(player, SelectMessages.functionItemAdd.replace("[amount]", item[1]).replace("[item]", item[0]));
T2Ceco.itemAdd(player, new ItemStack(Material.valueOf(item[0])), Integer.parseInt(item[1]));
T2Csend.player(player, SelectMessages.functionItemAdd.replace("[amount]", item[1]).replace("[item]", item[0]));
break;
case REMOVE:
if (Eco.itemRemove(player, item[0], Integer.parseInt(item[1]))) {
send.player(player, SelectMessages.functionItemRemove.replace("[amount]", item[1]).replace("[item]", item[0]));
if (T2Ceco.itemRemove(player, item[0], Integer.parseInt(item[1]))) {
T2Csend.player(player, SelectMessages.functionItemRemove.replace("[amount]", item[1]).replace("[item]", item[0]));
} else send.player(player, SelectMessages.functionItemRemoveError.replace("[amount]", item[1]));
} else T2Csend.player(player, SelectMessages.functionItemRemoveError.replace("[amount]", item[1]));
break;
}
}
@ -313,50 +313,50 @@ public class GUIListener implements Listener {
switch (function.ecoModule) {
case ITEM:
String[] item = function.ecoItem.split(";");
if (!Eco.itemRemove(player, item[0], Integer.parseInt(item[1]))) {
if (!T2Ceco.itemRemove(player, item[0], Integer.parseInt(item[1]))) {
new BukkitRunnable() {
@Override
public void run() {
player.closeInventory();
}
}.runTaskLater(plugin, 1L);
send.player(player, SelectMessages.noMoneyItem.replace("[item]", item[0]).replace("[amount]", item[1]));
T2Csend.player(player, SelectMessages.noMoneyItem.replace("[item]", item[0]).replace("[amount]", item[1]));
Sound.play(player, SoundEnum.NoMoney);
} else {
send.player(player, SelectMessages.Buy_msg.replace("[itemname]", Replace.replace(prefix, function.name))
T2Csend.player(player, SelectMessages.Buy_msg.replace("[itemname]", T2Creplace.replace(prefix, function.name))
.replace("[price]", item[1] + " " + item[0]));
execute(function, slot, player, e, gui);
}
break;
case VOTEPOINTS:
if (!Eco.votePointsRemove(prefix, player, function.votePoints)) {
if (!T2Ceco.votePointsRemove(prefix, player, function.votePoints)) {
new BukkitRunnable() {
@Override
public void run() {
player.closeInventory();
}
}.runTaskLater(plugin, 1L);
send.player(player, SelectMessages.noMoneyVote.replace("[amount]", function.votePoints.toString()));
T2Csend.player(player, SelectMessages.noMoneyVote.replace("[amount]", function.votePoints.toString()));
Sound.play(player, SoundEnum.NoMoney);
} else {
send.player(player, SelectMessages.Buy_msg.replace("[itemname]", Replace.replace(prefix, function.name))
T2Csend.player(player, SelectMessages.Buy_msg.replace("[itemname]", T2Creplace.replace(prefix, function.name))
.replace("[price]", function.votePoints + " VotePoints"));
execute(function, slot, player, e, gui);
}
break;
case VAULT:
case MONEY:
if (!Eco.moneyRemove(prefix, player, function.price)) {
if (!T2Ceco.moneyRemove(prefix, player, function.price)) {
new BukkitRunnable() {
@Override
public void run() {
player.closeInventory();
}
}.runTaskLater(plugin, 1L);
send.player(player, Replace.replacePrice(prefix, SelectMessages.noMoney, String.valueOf(function.price)));
T2Csend.player(player, T2Creplace.replacePrice(prefix, SelectMessages.noMoney, String.valueOf(function.price)));
Sound.play(player, SoundEnum.NoMoney);
} else {
send.player(player, SelectMessages.Buy_msg.replace("[itemname]", Replace.replace(prefix, function.name))
T2Csend.player(player, SelectMessages.Buy_msg.replace("[itemname]", T2Creplace.replace(prefix, function.name))
.replace("[price]", function.price + " " + SelectConfig.getCurrency()));
execute(function, slot, player, e, gui);
}

View File

@ -9,9 +9,9 @@ import de.jatitv.commandguiv2.Spigot.config.config.SelectConfig;
import de.jatitv.commandguiv2.Spigot.objects.slots.Slot;
import de.jatitv.commandguiv2.Spigot.system.Placeholder;
import de.jatitv.commandguiv2.Util;
import net.t2code.lib.Spigot.Lib.items.ItemVersion;
import net.t2code.lib.Spigot.Lib.minecraftVersion.MCVersion;
import net.t2code.lib.Spigot.Lib.replace.Replace;
import net.t2code.t2codelib.SPIGOT.api.items.T2CitemVersion;
import net.t2code.t2codelib.SPIGOT.api.messages.T2Creplace;
import net.t2code.t2codelib.SPIGOT.api.minecraftVersion.T2CmcVersion;
import org.bukkit.Material;
import org.bukkit.entity.Player;
import org.bukkit.inventory.Inventory;
@ -66,21 +66,21 @@ public class GuiBuilder {
private static void setDisplayNameAndLore(ItemMeta itemMeta, Player player, Slot slot) {
Function function = Main.functionHashMap.get(slot.function);
if (Main.PaPi) {
itemMeta.setDisplayName(Replace.replace(prefix, player, Placeholder.replace(function.name, player)));
itemMeta.setDisplayName(T2Creplace.replace(prefix, player, Placeholder.replace(function.name, player)));
if (slot.permission && !player.hasPermission(slot.permissionToUse) && function.noPermLoreEnable) {
itemMeta.setLore(Replace.replacePrice(prefix, player, Placeholder.replace(function.noPermLore, player), function.price + " " + SelectConfig.getCurrency()));
} else itemMeta.setLore(Replace.replacePrice(prefix, player, Placeholder.replace(function.lore, player), function.price + " " + SelectConfig.getCurrency()));
itemMeta.setLore(T2Creplace.replacePrice(prefix, player, Placeholder.replace(function.noPermLore, player), function.price + " " + SelectConfig.getCurrency()));
} else itemMeta.setLore(T2Creplace.replacePrice(prefix, player, Placeholder.replace(function.lore, player), function.price + " " + SelectConfig.getCurrency()));
} else {
itemMeta.setDisplayName(Replace.replace(prefix, Placeholder.replace(function.name, player)));
itemMeta.setDisplayName(T2Creplace.replace(prefix, Placeholder.replace(function.name, player)));
if (slot.permission && !player.hasPermission(slot.permissionToUse) && function.noPermLoreEnable) {
itemMeta.setLore(Replace.replacePrice(prefix, Placeholder.replace(function.noPermLore, player), function.price + " " + SelectConfig.getCurrency()));
} else itemMeta.setLore(Replace.replacePrice(prefix, Placeholder.replace(function.lore, player), function.price + " " + SelectConfig.getCurrency()));
itemMeta.setLore(T2Creplace.replacePrice(prefix, Placeholder.replace(function.noPermLore, player), function.price + " " + SelectConfig.getCurrency()));
} else itemMeta.setLore(T2Creplace.replacePrice(prefix, Placeholder.replace(function.lore, player), function.price + " " + SelectConfig.getCurrency()));
}
}
protected static void base64(String base64Value, Slot slot, Player player, Inventory inventory) {
Function function = Main.functionHashMap.get(slot.function);
ItemStack item = ItemVersion.getHeadIS();
ItemStack item = T2CitemVersion.getHeadIS();
SkullMeta itemMeta = (SkullMeta) item.getItemMeta();
setBase64(itemMeta, base64Value);
setDisplayNameAndLore(itemMeta, player, slot);
@ -113,7 +113,7 @@ public class GuiBuilder {
protected static void playerHead(Slot slot, Player player, Inventory inventory, String skullName) {
Function function = Main.functionHashMap.get(slot.function);
ItemStack item = ItemVersion.getHeadIS();
ItemStack item = T2CitemVersion.getHeadIS();
SkullMeta itemMeta = (SkullMeta) item.getItemMeta();
setDisplayNameAndLore(itemMeta, player, slot);
itemMeta.setOwner(skullName);
@ -128,7 +128,7 @@ public class GuiBuilder {
public static void fillItem(Inventory inventory, Gui gui) {
ItemStack glass;
if (MCVersion.minecraft1_8 || MCVersion.minecraft1_9 || MCVersion.minecraft1_10 || MCVersion.minecraft1_11 || MCVersion.minecraft1_12) {
if (T2CmcVersion.isMc1_8() || T2CmcVersion.isMc1_9() || T2CmcVersion.isMc1_10() || T2CmcVersion.isMc1_11() || T2CmcVersion.isMc1_12()) {
glass = new ItemStack(Material.valueOf("STAINED_GLASS_PANE"), 1, Short.parseShort(gui.guiFillItemItem));
} else glass = new ItemStack(Material.valueOf(gui.guiFillItemItem.toUpperCase().replace(".", "_")));
ItemMeta itemMetaglass = glass.getItemMeta();

View File

@ -13,7 +13,9 @@ import de.jatitv.commandguiv2.Spigot.enums.SoundEnum;
import de.jatitv.commandguiv2.Util;
import io.github.solyze.plugmangui.inventories.PluginListGUI;
import net.t2code.luckyBox.api.LuckyBoxAPI;
import net.t2code.t2codelib.SPIGOT.api.messages.T2Creplace;
import net.t2code.t2codelib.SPIGOT.api.messages.T2Csend;
import net.t2code.t2codelib.SPIGOT.api.minecraftVersion.T2CmcVersion;
import org.bukkit.Bukkit;
import org.bukkit.Material;
import org.bukkit.entity.Player;
@ -62,14 +64,14 @@ public class OpenGUI {
return;
}
if (MCVersion.minecraft1_13) {
if (T2CmcVersion.isMc1_13()) {
GUIListener.GUICode = "";
} else GUIListener.GUICode = "§6§8§9§r";
if (gui.guiEnable || player.hasPermission(Permissions.updatemsg)) {
Inventory inventory;
if (Main.PaPi) {
inventory = Bukkit.createInventory((InventoryHolder) null, 9 * gui.guiLines, (Replace.replace(prefix, player, GUIListener.GUICode + gui.guiName)));
} else inventory = Bukkit.createInventory((InventoryHolder) null, 9 * gui.guiLines, (Replace.replace(prefix, GUIListener.GUICode + gui.guiName)));
inventory = Bukkit.createInventory((InventoryHolder) null, 9 * gui.guiLines, (T2Creplace.replace(prefix, player, GUIListener.GUICode + gui.guiName)));
} else inventory = Bukkit.createInventory((InventoryHolder) null, 9 * gui.guiLines, (T2Creplace.replace(prefix, GUIListener.GUICode + gui.guiName)));
if (gui.guiFillItemEnable) {
GuiBuilder.fillItem(inventory, gui);
@ -129,8 +131,8 @@ public class OpenGUI {
Sound.play(player, SoundEnum.OpenInventory);
}
player.openInventory(inventory);
T2Csend.debug(plugin, "§6" + player.getName() + " §5Open §6" + Replace.replace(prefix, gui.guiName) + " §5" + " §7- §e" + (System.currentTimeMillis() - long_.longValue()) + "ms");
} else T2Csend.player(player, SelectMessages.GUIIsDisabled.replace("[gui]", Replace.replace(prefix, gui.guiName)));
T2Csend.debug(plugin, "§6" + player.getName() + " §5Open §6" + T2Creplace.replace(prefix, gui.guiName) + " §5" + " §7- §e" + (System.currentTimeMillis() - long_.longValue()) + "ms");
} else T2Csend.player(player, SelectMessages.GUIIsDisabled.replace("[gui]", T2Creplace.replace(prefix, gui.guiName)));
}
private static void toggleOn(Function function, Slot slot, Player player, Inventory inventory) {