diff --git a/CommandGUI V2/pom.xml b/CommandGUI V2/pom.xml
index 2e5c2b5..c9cc7ae 100644
--- a/CommandGUI V2/pom.xml
+++ b/CommandGUI V2/pom.xml
@@ -6,7 +6,7 @@
net.t2code
CommandGUI_V2
- 2.9_dev-1
+ 2.9_dev-24
jar
T2C-CommandGUI
@@ -77,7 +77,7 @@
net.t2code
T2CodeLib
16.7
- dev-23
+ dev-24
provided
@@ -135,19 +135,8 @@
com.zaxxer
HikariCP
- 4.0.3
- compile
-
-
- org.slf4j
- slf4j-jdk14
- 1.7.10
- compile
-
-
- org.slf4j
- slf4j-api
- 1.7.22
+
+ 5.1.0
compile
@@ -156,6 +145,5 @@
1.18.30
provided
-
diff --git a/CommandGUI V2/src/main/java/net/t2code/commandguiv2/Spigot/Main.java b/CommandGUI V2/src/main/java/net/t2code/commandguiv2/Spigot/Main.java
index c8b82e6..11209bb 100644
--- a/CommandGUI V2/src/main/java/net/t2code/commandguiv2/Spigot/Main.java
+++ b/CommandGUI V2/src/main/java/net/t2code/commandguiv2/Spigot/Main.java
@@ -1,10 +1,11 @@
package net.t2code.commandguiv2.Spigot;
import lombok.Getter;
-import net.t2code.commandguiv2.Spigot.objects.functions.Function;
+import net.t2code.commandguiv2.Spigot.objects.Function;
import net.t2code.commandguiv2.Spigot.system.Load;
-import net.t2code.commandguiv2.Spigot.objects.guis.Gui;
+import net.t2code.commandguiv2.Spigot.objects.Gui;
import net.t2code.commandguiv2.Spigot.database.MySQL;
+import net.t2code.commandguiv2.Spigot.system.Plugman;
import net.t2code.commandguiv2.Util;
import net.t2code.t2codelib.SPIGOT.api.messages.T2C_Send;
import net.t2code.t2codelib.SPIGOT.api.messages.T2C_Template;
@@ -53,6 +54,7 @@ public final class Main extends JavaPlugin {
autor = this.getDescription().getAuthors();
version = this.getDescription().getVersion();
if (pluginNotFound("T2CodeLib", 96388, Util.getRequiredT2CodeLibVersion())) return;
+ Util.load();
if (T2C_McVersion.isMc1_8() || T2C_McVersion.isMc1_9() || T2C_McVersion.isMc1_10() || T2C_McVersion.isMc1_11() || T2C_McVersion.isMc1_12() || T2C_McVersion.isMc1_13() ||
T2C_McVersion.isMc1_14() || T2C_McVersion.isMc1_15() || T2C_McVersion.isNms1_16_R1()) {
legacy = true;
@@ -140,6 +142,7 @@ public final class Main extends JavaPlugin {
public void onDisable() {
// Plugin shutdown logic
if (enable) T2C_Template.onDisable(Util.getPrefix(), plugin);
+ Plugman.unLoad();
MySQL.close();
}
diff --git a/CommandGUI V2/src/main/java/net/t2code/commandguiv2/Spigot/cmdManagement/CmdExecuter_GUI.java b/CommandGUI V2/src/main/java/net/t2code/commandguiv2/Spigot/cmdManagement/CmdExecuter_GUI.java
index 697dc2e..2f4fbb5 100644
--- a/CommandGUI V2/src/main/java/net/t2code/commandguiv2/Spigot/cmdManagement/CmdExecuter_GUI.java
+++ b/CommandGUI V2/src/main/java/net/t2code/commandguiv2/Spigot/cmdManagement/CmdExecuter_GUI.java
@@ -1,9 +1,9 @@
package net.t2code.commandguiv2.Spigot.cmdManagement;
import net.t2code.commandguiv2.Spigot.Main;
-import net.t2code.commandguiv2.Spigot.config.config.SelectConfig;
-import net.t2code.commandguiv2.Spigot.config.gui.CreateGUI;
-import net.t2code.commandguiv2.Spigot.config.languages.SelectMessages;
+import net.t2code.commandguiv2.Spigot.config.config.Config;
+import net.t2code.commandguiv2.Spigot.config.gui.GuiFile;
+import net.t2code.commandguiv2.Spigot.config.languages.Languages;
import net.t2code.commandguiv2.Util;
import net.t2code.t2codelib.SPIGOT.api.commands.T2C_Tab;
import org.bukkit.Bukkit;
@@ -24,13 +24,13 @@ public class CmdExecuter_GUI implements CommandExecutor, TabCompleter {
public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {
if (args.length == 0) {
if (!(sender instanceof Player)) {
- sender.sendMessage(SelectMessages.OnlyForPlayer);
+ sender.sendMessage(Languages.VALUES.OnlyForPlayer.getValue().toString());
return false;
}
Player player = (Player) sender;
Commands.gui(player);
} else {
- if (args[0].equals(SelectConfig.getAdminSubCommand())) {
+ if (args[0].equals(Config.VALUES.adminSubCommand.getValue().toString())) {
if (args.length == 1) {
Help.sendHelp(sender, prefix);
return false;
@@ -44,21 +44,21 @@ public class CmdExecuter_GUI implements CommandExecutor, TabCompleter {
case "ver":
if (sender.hasPermission("commandgui.command.info")) {
Commands.info(sender);
- } else sender.sendMessage(SelectMessages.NoPermissionForCommand
+ } else sender.sendMessage(Languages.VALUES.NoPermissionForCommand.getValue().toString()
.replace("[cmd]", "/commandgui admin").replace("[perm]", "commandgui.command.info"));
break;
case "reload":
case "rl":
if (sender.hasPermission("commandgui.admin")) {
Commands.reload(sender);
- } else sender.sendMessage(SelectMessages.NoPermissionForCommand
+ } else sender.sendMessage(Languages.VALUES.NoPermissionForCommand.getValue().toString()
.replace("[cmd]", "/commandgui admin").replace("[perm]", "commandgui.admin"));
break;
case "createdefaultgui":
if (sender.hasPermission("commandgui.admin")) {
- CreateGUI.configCreate();
- sender.sendMessage(SelectMessages.DefaultGUIcreate.replace("[directory]", Main.getPath() + "/GUIs/default.yml"));
- } else sender.sendMessage(SelectMessages.NoPermissionForCommand
+ GuiFile.createDefault(true);
+ sender.sendMessage(Languages.VALUES.DefaultGUIcreate.getValue().toString().replace("[directory]", Main.getPath() + "/GUIs/default.yml"));
+ } else sender.sendMessage(Languages.VALUES.NoPermissionForCommand.getValue().toString()
.replace("[cmd]", "/commandgui admin").replace("[perm]", "commandgui.admin"));
break;
case "give":
@@ -66,7 +66,7 @@ public class CmdExecuter_GUI implements CommandExecutor, TabCompleter {
if (sender.hasPermission("commandgui.giveitem.other")) {
Player target = Bukkit.getPlayer(args[2]);
Commands.give(sender, target);
- } else sender.sendMessage(SelectMessages.NoPermissionForCommand.replace("[cmd]", "/commandgui give")
+ } else sender.sendMessage(Languages.VALUES.NoPermissionForCommand.getValue().toString().replace("[cmd]", "/commandgui give")
.replace("[perm]", "commandgui.command.give"));
} else Help.sendHelp(sender, prefix);
break;
@@ -76,7 +76,7 @@ public class CmdExecuter_GUI implements CommandExecutor, TabCompleter {
break;
}
} else {
- if (!args[0].equalsIgnoreCase("updateinfo")){
+ if (!args[0].equalsIgnoreCase("updateinfo")) {
if (sender instanceof Player) {
Player player = (Player) sender;
Commands.gui(player, args[0]);
@@ -108,7 +108,7 @@ public class CmdExecuter_GUI implements CommandExecutor, TabCompleter {
List list = new ArrayList<>();
T2C_Tab.tab(list, sender, 0, args, arg1);
- T2C_Tab.tab(list, sender, 0, SelectConfig.getAdminSubCommand(), 1, args, arg2);
+ T2C_Tab.tab(list, sender, 0, Config.VALUES.adminSubCommand.getValue().toString(), 1, args, arg2);
T2C_Tab.tab(list, sender, 1, "give", 2, args, "commandgui.giveitem.other", true);
return list;
}
diff --git a/CommandGUI V2/src/main/java/net/t2code/commandguiv2/Spigot/cmdManagement/CmdExecuter_GUIItem.java b/CommandGUI V2/src/main/java/net/t2code/commandguiv2/Spigot/cmdManagement/CmdExecuter_GUIItem.java
index 6208ffa..2a9c7f9 100644
--- a/CommandGUI V2/src/main/java/net/t2code/commandguiv2/Spigot/cmdManagement/CmdExecuter_GUIItem.java
+++ b/CommandGUI V2/src/main/java/net/t2code/commandguiv2/Spigot/cmdManagement/CmdExecuter_GUIItem.java
@@ -1,7 +1,7 @@
package net.t2code.commandguiv2.Spigot.cmdManagement;
-import net.t2code.commandguiv2.Spigot.config.config.SelectConfig;
-import net.t2code.commandguiv2.Spigot.config.languages.SelectMessages;
+import net.t2code.commandguiv2.Spigot.config.config.Config;
+import net.t2code.commandguiv2.Spigot.config.languages.Languages;
import net.t2code.commandguiv2.Util;
import net.t2code.t2codelib.SPIGOT.api.messages.T2C_Send;
import org.bukkit.command.Command;
@@ -19,16 +19,16 @@ public class CmdExecuter_GUIItem implements CommandExecutor, TabCompleter {
@Override
public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {
- Player player = (Player) sender;
if (sender.hasPermission("commandgui.useitem.toggle")) {
if (args.length == 0) {
- if (SelectConfig.getUseItem_AllowToggle()) {
+ if ((boolean)Config.VALUES.useItemAllowToggle.getValue()) {
Help.sendGUIItemHelp(sender);
- } else T2C_Send.sender(sender, "§4UseItem toggle is disabled!");// todo
+ } else T2C_Send.sender(sender, "§4UseItem toggle is disabled!");//todo in lang file
} else {
if (args.length == 1 || args.length == 2) {
if (sender instanceof Player) {
- if (SelectConfig.getUseItem_AllowToggle()) {
+ Player player = (Player) sender;
+ if ((boolean) Config.VALUES.useItemAllowToggle.getValue()) {
switch (args[0].toLowerCase()) {
case "on":
Commands.itemOn(player);
@@ -41,21 +41,21 @@ public class CmdExecuter_GUIItem implements CommandExecutor, TabCompleter {
try {
Commands.onSetSlot(player, Integer.valueOf(args[1]));
} catch (Exception e5) {
- T2C_Send.player(player, SelectMessages.ItemSlot_wrongValue);
+ T2C_Send.player(player, Languages.VALUES.ItemSlot_wrongValue.getValue().toString());
}
- } else T2C_Send.player(player, "§4Use: §7/gui-item slot [slot]");
+ } else T2C_Send.player(player, "§4Use: §7/gui-item slot [slot]"); //todo in lang file
break;
default:
Help.sendHelp(player, prefix);
}
- } else T2C_Send.sender(sender, "§4UseItem toggle is disabled!");// todo
- } else sender.sendMessage(SelectMessages.OnlyForPlayer);
+ } else T2C_Send.sender(sender, "§4UseItem toggle is disabled!");//todo in lang file
+ } else sender.sendMessage(Languages.VALUES.OnlyForPlayer.getValue().toString());
}
}
- } else sender.sendMessage(SelectMessages.NoPermissionForCommand.replace("[cmd]", "/commandgui-item")
+ } else sender.sendMessage(Languages.VALUES.NoPermissionForCommand.getValue().toString().replace("[cmd]", "/commandgui-item")
.replace("[perm]", "commandgui.useitem.toggle"));
return false;
}
@@ -65,7 +65,7 @@ public class CmdExecuter_GUIItem implements CommandExecutor, TabCompleter {
private static HashMap arg1 = new HashMap() {{
put("on", "commandgui.useitem.toggle");
put("off", "commandgui.useitem.toggle");
- if (SelectConfig.getUseItem_AllowSetSlot()) {
+ if ((boolean)Config.VALUES.useItemAllowSetSlot.getValue()) {
put("slot", "commandgui.useitem.toggle");
}
}};
@@ -74,7 +74,7 @@ public class CmdExecuter_GUIItem implements CommandExecutor, TabCompleter {
public List onTabComplete(CommandSender sender, Command cmd, String s, String[] args) {
List list = new ArrayList<>();
if (sender instanceof Player) {
- if (SelectConfig.getUseItem_AllowToggle()) {
+ if ((boolean)Config.VALUES.useItemAllowToggle.getValue()) {
Player p = (Player) sender;
if (args.length == 1) {
for (String command : arg1.keySet()) {
diff --git a/CommandGUI V2/src/main/java/net/t2code/commandguiv2/Spigot/cmdManagement/Commands.java b/CommandGUI V2/src/main/java/net/t2code/commandguiv2/Spigot/cmdManagement/Commands.java
index d4b873c..866f762 100644
--- a/CommandGUI V2/src/main/java/net/t2code/commandguiv2/Spigot/cmdManagement/Commands.java
+++ b/CommandGUI V2/src/main/java/net/t2code/commandguiv2/Spigot/cmdManagement/Commands.java
@@ -1,23 +1,24 @@
package net.t2code.commandguiv2.Spigot.cmdManagement;
+import net.t2code.commandguiv2.Spigot.config.config.Config;
+import net.t2code.commandguiv2.Spigot.config.functions.FunctionsFile;
+import net.t2code.commandguiv2.Spigot.config.gui.GuiFile;
+import net.t2code.commandguiv2.Spigot.config.languages.Languages;
import net.t2code.commandguiv2.Spigot.useItem.Events;
import net.t2code.commandguiv2.Spigot.Main;
-import net.t2code.commandguiv2.Spigot.objects.Obj_Select;
-import net.t2code.commandguiv2.Spigot.objects.guis.Gui;
+import net.t2code.commandguiv2.Spigot.objects.Gui;
import net.t2code.commandguiv2.Spigot.cmdManagement.register.AliasRegister;
import net.t2code.commandguiv2.Spigot.gui.OpenGUI;
import net.t2code.commandguiv2.Spigot.useItem.UseItem;
-import net.t2code.commandguiv2.Spigot.config.config.SelectConfig;
-import net.t2code.commandguiv2.Spigot.config.languages.LanguagesCreate;
-import net.t2code.commandguiv2.Spigot.config.languages.SelectMessages;
import net.t2code.commandguiv2.Spigot.system.Permissions;
import net.t2code.commandguiv2.Spigot.database.SelectDatabase;
import net.t2code.commandguiv2.Spigot.sound.Sound;
import net.t2code.commandguiv2.Spigot.enums.SoundEnum;
import net.t2code.commandguiv2.Util;
+import net.t2code.t2codelib.SPIGOT.api.debug.T2C_Debug;
import net.t2code.t2codelib.SPIGOT.api.messages.T2C_Send;
import net.t2code.t2codelib.SPIGOT.api.messages.T2C_Template;
-import net.t2code.t2codelib.SPIGOT.system.config.config.SelectLibConfig;
+import net.t2code.t2codelib.SPIGOT.system.T2C_Main;
import org.bukkit.Bukkit;
import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player;
@@ -33,29 +34,28 @@ public class Commands {
Bukkit.getScheduler().runTaskAsynchronously(Main.getPlugin(), new Runnable() {
@Override
public void run() {
- if (sender instanceof Player) sender.sendMessage(SelectMessages.ReloadStart);
+ if (sender instanceof Player) sender.sendMessage(Languages.VALUES.ReloadStart.getValue().toString());
T2C_Send.console(Util.getPrefix() + "§8-------------------------------");
T2C_Send.console(Util.getPrefix() + " §6Plugin reload...");
T2C_Send.console(Util.getPrefix() + "§8-------------------------------");
- SelectConfig.onSelect();
+ Config.set(true);
Main.getPlugin().reloadConfig();
CmdExecuter_GUI.arg1.clear();
- CmdExecuter_GUI.arg1.put(SelectConfig.getAdminSubCommand(), "commandgui.admin;commandgui.giveitem.other;commandgui.command.info");
+ CmdExecuter_GUI.arg1.put(Config.VALUES.adminSubCommand.getValue().toString(), "commandgui.admin;commandgui.giveitem.other;commandgui.command.info");
- if (!Objects.equals(SelectDatabase.getStorage().toString(), SelectConfig.getStorage())) {
+ if (!Objects.equals(SelectDatabase.getStorage().toString(), Config.VALUES.storage.getValue().toString())) {
if (sender instanceof Player) T2C_Send.sender(sender, "You have changed the storage medium! To apply this change, you must restart the server!");
T2C_Send.warning(Main.getPlugin(), "You have changed the storage medium! To apply this change, you must restart the server!");
}
- LanguagesCreate.langCreate();
-
- Obj_Select.onSelect();
- SelectMessages.onSelect(Util.getPrefix());
- SelectConfig.sound(Util.getPrefix());
+ FunctionsFile.select(true);
+ GuiFile.set(true);
+ Languages.set(true);
+ Config.checkSounds();
try {
- AliasRegister.onRegister();
+ AliasRegister.onRegister(true);
} catch (Exception e) {
e.printStackTrace();
}
@@ -65,12 +65,12 @@ public class Commands {
e.printStackTrace();
}
- if (SelectLibConfig.getBungee()) {
+ if (T2C_Main.isProxy()) {
Bukkit.getMessenger().registerOutgoingPluginChannel(Main.getPlugin(), "commandgui:bungee");
}
- if (sender instanceof Player) sender.sendMessage(SelectMessages.ReloadEnd);
+ if (sender instanceof Player) sender.sendMessage(Languages.VALUES.ReloadEnd.getValue().toString());
T2C_Send.console(Util.getPrefix() + "§8-------------------------------");
T2C_Send.console(Util.getPrefix() + " §2Plugin successfully reloaded.");
T2C_Send.console(Util.getPrefix() + "§8-------------------------------");
@@ -81,11 +81,11 @@ public class Commands {
public static void give(CommandSender sender, Player target) {
if (Bukkit.getPlayer(target.getName()) != null) {
UseItem.giveUseItem(target);
- T2C_Send.sender(sender, SelectMessages.Give_Sender.replace("[player]", target.getName()).replace("[item]", SelectConfig.getUseItem_Name()));
- T2C_Send.player(target, SelectMessages.Give_Receiver.replace("[sender]", sender.getName()).replace("[item]", SelectConfig.getUseItem_Name()));
+ T2C_Send.sender(sender, Languages.VALUES.Give_Sender.getValue().toString().replace("[player]", target.getName()).replace("[item]", Config.VALUES.useItemName.getValue().toString()));
+ T2C_Send.player(target, Languages.VALUES.Give_Receiver.getValue().toString().replace("[sender]", sender.getName()).replace("[item]", Config.VALUES.useItemName.getValue().toString()));
Sound.play(target, SoundEnum.Give);
} else {
- sender.sendMessage(SelectMessages.PlayerNotFond.replace("[player]", target.getName()));
+ sender.sendMessage(Languages.VALUES.PlayerNotFond.getValue().toString().replace("[player]", target.getName()));
if (sender instanceof Player) Sound.play((Player) sender, SoundEnum.PlayerNotFound);
}
}
@@ -93,8 +93,8 @@ public class Commands {
public static void itemOn(Player player) {
UseItem.removeItem(player);
Integer slot = null;
- if (SelectConfig.getUseItem_InventorySlotEnforce()) {
- slot = SelectConfig.getUseItem_InventorySlot();
+ if ((boolean) Config.VALUES.useItemInventorySlotEnforce.getValue()) {
+ slot = (int) Config.VALUES.useItemInventorySlot.getValue();
} else {
slot = Events.useItemSlotHashMap.get(player.getName());
}
@@ -113,9 +113,9 @@ public class Commands {
if (empty) {
SelectDatabase.setItemStatusTrue(player);
UseItem.addUseItem(player);
- T2C_Send.player(player, SelectMessages.ItemON);
+ T2C_Send.player(player, Languages.VALUES.ItemON);
} else {
- T2C_Send.player(player, SelectMessages.NoInventorySpace);
+ T2C_Send.player(player, Languages.VALUES.NoInventorySpace);
Sound.play(player, SoundEnum.NoInventorySpace);
}
}
@@ -124,33 +124,33 @@ public class Commands {
public static void itemOff(Player player) {
SelectDatabase.setItemStatusFalse(player);
UseItem.removeItem(player);
- T2C_Send.player(player, SelectMessages.ItemOFF);
+ T2C_Send.player(player, Languages.VALUES.ItemOFF);
}
public static void onSetSlot(Player player, Integer setSlot) {
- if (!SelectConfig.getUseItem_AllowSetSlot()) {
+ if (!(boolean) Config.VALUES.useItemAllowSetSlot.getValue()) {
T2C_Send.player(player, Util.getPrefix() + " §4Function disabled");
return;
}
if (setSlot < 1) {
- T2C_Send.player(player, SelectMessages.ItemSlot_wrongValue);
+ T2C_Send.player(player, Languages.VALUES.ItemSlot_wrongValue);
return;
}
if (setSlot > 9) {
- T2C_Send.player(player, SelectMessages.ItemSlot_wrongValue);
+ T2C_Send.player(player, Languages.VALUES.ItemSlot_wrongValue);
return;
}
if (Events.useItemHashMap.get(player.getName())) {
if (Objects.equals(Events.useItemSlotHashMap.get(player.getName()), setSlot)) {
- T2C_Send.player(player, SelectMessages.ItemSlotAlreadySet.replace("[slot]", setSlot.toString()));
+ T2C_Send.player(player, Languages.VALUES.ItemSlotAlreadySet.getValue().toString().replace("[slot]", setSlot.toString()));
return;
}
}
- if (SelectConfig.getUseItem_InventorySlotEnforce() || player.getInventory().getItem(setSlot - 1) != null) {
- T2C_Send.player(player, SelectMessages.ItemSlotNotEmpty.replace("[slot]", setSlot.toString()));
+ if ((boolean) Config.VALUES.useItemInventorySlotEnforce.getValue() || player.getInventory().getItem(setSlot - 1) != null) {
+ T2C_Send.player(player, Languages.VALUES.ItemSlotNotEmpty.getValue().toString().replace("[slot]", setSlot.toString()));
return;
}
@@ -162,18 +162,18 @@ public class Commands {
UseItem.giveUseItem(player);
}
- T2C_Send.player(player, SelectMessages.ItemSlot.replace("[slot]", setSlot.toString()));
+ T2C_Send.player(player, Languages.VALUES.ItemSlot.getValue().toString().replace("[slot]", setSlot.toString()));
}
public static void gui(Player player) {
- if (Main.guiHashMap.containsKey(SelectConfig.getDefaultGUI())) {
- Gui gui = Main.guiHashMap.get(SelectConfig.getDefaultGUI());
+ if (Main.guiHashMap.containsKey(Config.VALUES.defaultGUI.getValue().toString())) {
+ Gui gui = Main.guiHashMap.get(Config.VALUES.defaultGUI.getValue().toString());
if (gui.guiEnable || player.hasPermission("commandgui.bypass")) {
if (!gui.commandPermissionEnable || player.hasPermission("commandgui.command") || player.hasPermission("commandgui.bypass")) {
- OpenGUI.openGUI(player, SelectConfig.getDefaultGUI(), true);
- } else T2C_Send.player(player, SelectMessages.NoPermissionForCommand.replace("[cmd]", "/commandgui")
+ OpenGUI.openGUI(player, Config.VALUES.defaultGUI.toString(), true);
+ } else T2C_Send.player(player, Languages.VALUES.NoPermissionForCommand.getValue().toString().replace("[cmd]", "/commandgui")
.replace("[perm]", "commandgui.command"));
- } else T2C_Send.player(player, SelectMessages.GUIIsDisabled.replace("[gui]", gui.guiName));
+ } else T2C_Send.player(player, Languages.VALUES.GUIIsDisabled.getValue().toString().replace("[gui]", gui.guiName));
}
}
@@ -183,9 +183,9 @@ public class Commands {
if (gui.guiEnable || player.hasPermission("commandgui.bypass")) {
if (!gui.commandPermissionEnable || player.hasPermission("commandgui.command." + gui.key) || player.hasPermission("commandgui.bypass")) {
OpenGUI.openGUI(player, arg, true);
- } else T2C_Send.player(player, SelectMessages.NoPermissionForCommand.replace("[cmd]", "/commandgui " + gui.key)
+ } else T2C_Send.player(player, Languages.VALUES.NoPermissionForCommand.getValue().toString().replace("[cmd]", "/commandgui " + gui.key)
.replace("[perm]", "commandgui.command." + arg.toLowerCase()));
- } else T2C_Send.player(player, SelectMessages.GUIIsDisabled.replace("[gui]", gui.key));
- } else T2C_Send.player(player, SelectMessages.guiNotFound);
+ } else T2C_Send.player(player, Languages.VALUES.GUIIsDisabled.getValue().toString().replace("[gui]", gui.key));
+ } else T2C_Send.player(player, Languages.VALUES.guiNotFound);
}
}
diff --git a/CommandGUI V2/src/main/java/net/t2code/commandguiv2/Spigot/cmdManagement/Help.java b/CommandGUI V2/src/main/java/net/t2code/commandguiv2/Spigot/cmdManagement/Help.java
index 642f071..46d5670 100644
--- a/CommandGUI V2/src/main/java/net/t2code/commandguiv2/Spigot/cmdManagement/Help.java
+++ b/CommandGUI V2/src/main/java/net/t2code/commandguiv2/Spigot/cmdManagement/Help.java
@@ -1,9 +1,9 @@
package net.t2code.commandguiv2.Spigot.cmdManagement;
-import net.t2code.commandguiv2.Spigot.config.languages.SelectMessages;
+import net.t2code.commandguiv2.Spigot.config.config.Config;
import net.t2code.commandguiv2.Spigot.Main;
-import net.t2code.commandguiv2.Spigot.objects.guis.Gui;
-import net.t2code.commandguiv2.Spigot.config.config.SelectConfig;
+import net.t2code.commandguiv2.Spigot.config.languages.Languages;
+import net.t2code.commandguiv2.Spigot.objects.Gui;
import net.t2code.commandguiv2.Util;
import net.t2code.t2codelib.SPIGOT.api.messages.T2C_Replace;
import net.t2code.t2codelib.SPIGOT.api.messages.T2C_Send;
@@ -11,10 +11,10 @@ import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player;
public class Help {
- private static String prefix = Util.getPrefix();
+ private static final String prefix = Util.getPrefix();
public static void sendHelp(CommandSender sender, String Prefix) {
- Gui gui = Main.guiHashMap.get(SelectConfig.getDefaultGUI());
+ Gui gui = Main.guiHashMap.get(Config.VALUES.defaultGUI.getValue().toString());
T2C_Send.sender(sender, Prefix + " §8----- §4Command§9GUI §chelp §8-----");
cgui(sender, gui);
@@ -33,8 +33,8 @@ public class Help {
if (!sender.hasPermission("commandgui.command")) return;
if (sender instanceof Player) {
- T2C_Send.player((Player) sender, prefix + " " + SelectMessages.PlayerHelpCgui.replace("[gui]", T2C_Replace.replace(prefix, gui.guiName)));
- } else T2C_Send.sender(sender, prefix + " " + SelectMessages.HelpCgui.replace("[gui]", T2C_Replace.replace(prefix, gui.guiName)));
+ T2C_Send.player((Player) sender, prefix + " " + Languages.VALUES.PlayerHelpCgui.getValue().toString().replace("[gui]", T2C_Replace.replace(prefix, gui.guiName)));
+ } else T2C_Send.sender(sender, prefix + " " + Languages.VALUES.HelpCgui.getValue().toString().replace("[gui]", T2C_Replace.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) {
- T2C_Send.player((Player) sender, prefix + " " + SelectMessages.PlayerHelpOpen.replace("[gui]", alias).replace("[guiname]", T2C_Replace.replace(prefix, Main.guiHashMap.get(alias).guiName)));
+ T2C_Send.player((Player) sender, prefix + " " + Languages.VALUES.PlayerHelpOpen.getValue().toString().replace("[gui]", alias).replace("[guiname]", T2C_Replace.replace(prefix, Main.guiHashMap.get(alias).guiName)));
} else
- T2C_Send.sender(sender, prefix + " " + SelectMessages.HelpOpen.replace("[gui]", alias).replace("[guiname]", T2C_Replace.replace(prefix, Main.guiHashMap.get(alias).guiName)));
+ T2C_Send.sender(sender, prefix + " " + Languages.VALUES.HelpOpen.getValue().toString().replace("[gui]", alias).replace("[guiname]", T2C_Replace.replace(prefix, Main.guiHashMap.get(alias).guiName)));
}
}
}
@@ -54,52 +54,52 @@ public class Help {
if (!sender.hasPermission("commandgui.command")) return;
if (sender instanceof Player) {
- T2C_Send.player((Player) sender, prefix + " " + SelectMessages.PlayerHelpHelp);
- } else T2C_Send.sender(sender, prefix + " " + SelectMessages.HelpHelp);
+ T2C_Send.player((Player) sender, prefix + " " + Languages.VALUES.PlayerHelpHelp);
+ } else T2C_Send.sender(sender, prefix + " " + Languages.VALUES.HelpHelp);
}
private static void info(CommandSender sender) {
if (!sender.hasPermission("commandgui.command.info")) return;
if (sender instanceof Player) {
- T2C_Send.player((Player) sender, prefix + " " + SelectMessages.PlayerHelpInfo);
- } else T2C_Send.sender(sender, prefix + " " + SelectMessages.HelpInfo);
+ T2C_Send.player((Player) sender, prefix + " " + Languages.VALUES.PlayerHelpInfo);
+ } else T2C_Send.sender(sender, prefix + " " + Languages.VALUES.HelpInfo);
}
private static void give(CommandSender sender) {
if (!sender.hasPermission("commandgui.admin")) return;
if (sender instanceof Player) {
- T2C_Send.player((Player) sender, prefix + " " + SelectMessages.PlayerHelpGive);
- } else T2C_Send.sender(sender, prefix + " " + SelectMessages.HelpGive);
+ T2C_Send.player((Player) sender, prefix + " " + Languages.VALUES.PlayerHelpGive);
+ } else T2C_Send.sender(sender, prefix + " " + Languages.VALUES.HelpGive);
}
private static void createDefaultGUI(CommandSender sender) {
if (!sender.hasPermission("commandgui.admin")) return;
if (sender instanceof Player) {
- T2C_Send.player((Player) sender, prefix + " " + SelectMessages.PlayerHelpCreateDefaultGUI.replace("[directory]", Main.getPath() + "\\GUIs\\default.yml"));
- } else T2C_Send.sender(sender, prefix + " " + SelectMessages.HelpCreateDefaultGUI.replace("[directory]", Main.getPath() + "\\GUIs\\default.yml"));
+ T2C_Send.player((Player) sender, prefix + " " + Languages.VALUES.PlayerHelpCreateDefaultGUI.getValue().toString().replace("[directory]", Main.getPath() + "\\GUIs\\default.yml"));
+ } else T2C_Send.sender(sender, prefix + " " + Languages.VALUES.HelpCreateDefaultGUI.getValue().toString().replace("[directory]", Main.getPath() + "\\GUIs\\default.yml"));
}
private static void reload(CommandSender sender) {
if (!sender.hasPermission("commandgui.admin")) return;
if (sender instanceof Player) {
- T2C_Send.player((Player) sender, prefix + " " + SelectMessages.PlayerHelpReload);
- } else T2C_Send.sender(sender, prefix + " " + SelectMessages.HelpReload);
+ T2C_Send.player((Player) sender, prefix + " " + Languages.VALUES.PlayerHelpReload);
+ } else T2C_Send.sender(sender, prefix + " " + Languages.VALUES.HelpReload);
}
public static void gUIItemHelp(CommandSender sender) {
if (sender instanceof Player) {
- T2C_Send.player((Player) sender, prefix + " " + SelectMessages.PlayerGUIItemHelp_on);
- } else T2C_Send.sender(sender, prefix + " " + SelectMessages.GUIItemHelp_on);
+ T2C_Send.player((Player) sender, prefix + " " + Languages.VALUES.PlayerGUIItemHelp_on);
+ } else T2C_Send.sender(sender, prefix + " " + Languages.VALUES.GUIItemHelp_on);
if (sender instanceof Player) {
- T2C_Send.player((Player) sender, prefix + " " + SelectMessages.PlayerGUIItemHelp_off);
- } else T2C_Send.sender(sender, prefix + " " + SelectMessages.GUIItemHelp_off);
+ T2C_Send.player((Player) sender, prefix + " " + Languages.VALUES.PlayerGUIItemHelp_off);
+ } else T2C_Send.sender(sender, prefix + " " + Languages.VALUES.GUIItemHelp_off);
if (sender instanceof Player) {
- T2C_Send.player((Player) sender, prefix + " " + SelectMessages.PlayerGUIItemHelp_Slot);
- } else T2C_Send.sender(sender, prefix + " " + SelectMessages.GUIItemHelp_Slot);
+ T2C_Send.player((Player) sender, prefix + " " + Languages.VALUES.PlayerGUIItemHelp_Slot);
+ } else T2C_Send.sender(sender, prefix + " " + Languages.VALUES.GUIItemHelp_Slot);
}
public static void sendGUIItemHelp(CommandSender sender) {
diff --git a/CommandGUI V2/src/main/java/net/t2code/commandguiv2/Spigot/cmdManagement/register/AliasRegister.java b/CommandGUI V2/src/main/java/net/t2code/commandguiv2/Spigot/cmdManagement/register/AliasRegister.java
index 785780a..235e106 100644
--- a/CommandGUI V2/src/main/java/net/t2code/commandguiv2/Spigot/cmdManagement/register/AliasRegister.java
+++ b/CommandGUI V2/src/main/java/net/t2code/commandguiv2/Spigot/cmdManagement/register/AliasRegister.java
@@ -4,6 +4,7 @@ import net.t2code.commandguiv2.Spigot.Main;
import net.t2code.commandguiv2.Util;
import net.t2code.t2codelib.SPIGOT.api.debug.T2C_Debug;
import net.t2code.t2codelib.SPIGOT.api.messages.T2C_Send;
+import net.t2code.t2codelib.SPIGOT.api.messages.T2C_Template;
import org.bukkit.Bukkit;
import org.bukkit.command.CommandMap;
import org.bukkit.plugin.Plugin;
@@ -12,11 +13,11 @@ import java.lang.reflect.Field;
public class AliasRegister {
- public static void onRegister() {
+ public static void onRegister(boolean isReload) {
Plugin plugin = Main.getPlugin();
T2C_Debug.debug(plugin, Bukkit.getServer().getClass().getPackage().getName());
if (Main.allAliases.toString().equals("[]")) {
- T2C_Send.console(Util.getPrefix() + " §4No GUI files available");
+ T2C_Send.sendStartTextCenter(Util.getPrefix(),"§4No GUI files available",isReload);
return;
}
for (String alias : Main.allAliases) {
diff --git a/CommandGUI V2/src/main/java/net/t2code/commandguiv2/Spigot/cmdManagement/register/RegisterCommand.java b/CommandGUI V2/src/main/java/net/t2code/commandguiv2/Spigot/cmdManagement/register/RegisterCommand.java
index b99161b..896a733 100644
--- a/CommandGUI V2/src/main/java/net/t2code/commandguiv2/Spigot/cmdManagement/register/RegisterCommand.java
+++ b/CommandGUI V2/src/main/java/net/t2code/commandguiv2/Spigot/cmdManagement/register/RegisterCommand.java
@@ -2,9 +2,9 @@ package net.t2code.commandguiv2.Spigot.cmdManagement.register;
import net.t2code.commandguiv2.Spigot.Main;
-import net.t2code.commandguiv2.Spigot.objects.guis.Gui;
+import net.t2code.commandguiv2.Spigot.config.languages.Languages;
+import net.t2code.commandguiv2.Spigot.objects.Gui;
import net.t2code.commandguiv2.Spigot.gui.OpenGUI;
-import net.t2code.commandguiv2.Spigot.config.languages.SelectMessages;
import net.t2code.t2codelib.SPIGOT.api.messages.T2C_Send;
import org.bukkit.command.Command;
import org.bukkit.command.CommandSender;
@@ -28,9 +28,9 @@ public class RegisterCommand extends Command {
if (gui.guiEnable || player.hasPermission("commandgui.bypass")) {
if (!gui.commandPermissionEnable || player.hasPermission("commandgui.command." + alias) || player.hasPermission("commandgui.bypass")) {
OpenGUI.openGUI(player, alias, true);
- } else T2C_Send.player(player, SelectMessages.NoPermissionForCommand.replace("[cmd]", "/commandgui " + alias)
+ } else T2C_Send.player(player, Languages.VALUES.NoPermissionForCommand.getValue().toString().replace("[cmd]", "/commandgui " + alias)
.replace("[perm]", "commandgui.command." + alias));
- } else T2C_Send.player(player,SelectMessages.GUIIsDisabled.replace("[gui]", gui.guiName));
+ } else T2C_Send.player(player,Languages.VALUES.GUIIsDisabled.getValue().toString().replace("[gui]", gui.guiName));
} else sender.sendMessage("§8[§6Command§9GUI§8] §cThis command is only for players!");
return true;
}
diff --git a/CommandGUI V2/src/main/java/net/t2code/commandguiv2/Spigot/config/config/Config.java b/CommandGUI V2/src/main/java/net/t2code/commandguiv2/Spigot/config/config/Config.java
index c54f982..433fa9c 100644
--- a/CommandGUI V2/src/main/java/net/t2code/commandguiv2/Spigot/config/config/Config.java
+++ b/CommandGUI V2/src/main/java/net/t2code/commandguiv2/Spigot/config/config/Config.java
@@ -1,7 +1,7 @@
package net.t2code.commandguiv2.Spigot.config.config;
import net.t2code.commandguiv2.Spigot.Main;
-import net.t2code.commandguiv2.Spigot.config.languages.SelectMessages;
+import net.t2code.commandguiv2.Spigot.config.languages.Languages;
import net.t2code.commandguiv2.Util;
import net.t2code.t2codelib.SPIGOT.api.items.T2C_ItemVersion;
import net.t2code.t2codelib.SPIGOT.api.messages.T2C_Send;
@@ -22,293 +22,294 @@ public class Config {
public static enum VALUES implements T2C_ConfigItem {
- Debug("Plugin.Debug", false, true,
+ debug("plugin.debug", false, true,
new HashMap<>() {{
put(T2C_LanguageEnum.german, List.of());
put(T2C_LanguageEnum.english, List.of());
}}),
- updateCheckOnJoin("Plugin.updateCheck.onJoin", true, true,
+ updateCheckOnJoin("plugin.updateCheck.onJoin", true, true,
new HashMap<>() {{
put(T2C_LanguageEnum.german, List.of());
put(T2C_LanguageEnum.english, List.of());
}}),
- updateCheckSeePreReleaseUpdates("Plugin.updateCheck.seePreReleaseUpdates", true, true,
+ updateCheckSeePreReleaseUpdates("plugin.updateCheck.seePreReleaseUpdates", true, true,
new HashMap<>() {{
put(T2C_LanguageEnum.german, List.of());
put(T2C_LanguageEnum.english, List.of());
}}),
- updateCheckTimeInterval("Plugin.updateCheck.timeInterval", 60, true,
+ updateCheckTimeInterval("plugin.updateCheck.timeInterval", 60, true,
new HashMap<>() {{
put(T2C_LanguageEnum.german, List.of());
put(T2C_LanguageEnum.english, List.of());
}}),
- HelpAlias("Plugin.HelpAlias", true, true,
+ helpAlias("plugin.helpAlias", true, true,
new HashMap<>() {{
put(T2C_LanguageEnum.german, List.of());
put(T2C_LanguageEnum.english, List.of());
}}),
- adminSubCommand("Plugin.AdminSubCommand", "admin", true,
+ adminSubCommand("plugin.adminSubCommand", "admin", true,
new HashMap<>() {{
put(T2C_LanguageEnum.german, List.of());
put(T2C_LanguageEnum.english, List.of());
}}),
- language("Plugin.language", T2C_LanguageEnum.english, true,
+ language("plugin.language", T2C_LanguageEnum.english, true,
new HashMap<>() {{
put(T2C_LanguageEnum.german, List.of());
put(T2C_LanguageEnum.english, List.of());
}}),
- Currency("Plugin.Currency", "$", true,
+ currency("plugin.currency", "$", true,
new HashMap<>() {{
put(T2C_LanguageEnum.german, List.of());
put(T2C_LanguageEnum.english, List.of());
}}),
- DefaultGUI("Plugin.DefaultGUI", "default", true,
+ defaultGUI("plugin.defaultGUI", "default", true,
new HashMap<>() {{
put(T2C_LanguageEnum.german, List.of());
put(T2C_LanguageEnum.english, List.of());
}}),
- prefix("Plugin.Prefix", "&8[&4C&9GUI&8]", true,
+ prefix("plugin.prefix", "&8[&4C&9GUI&8]", true,
new HashMap<>() {{
put(T2C_LanguageEnum.german, List.of());
put(T2C_LanguageEnum.english, List.of());
}}),
- storage("Storage.Type", Main.legacy ? "YML" : "SQLITE", true,
+ storage("storage.type", Main.legacy ? "YML" : "SQLITE", true,
new HashMap<>() {{
put(T2C_LanguageEnum.german, List.of("Speichermöglichkeiten: YML, SQLITE, MYSQL"));
put(T2C_LanguageEnum.english, List.of());
}}),
- mysqlIp("Storage.MySQL.IP", "localhost", true,
+ mysqlIp("storage.mysql.ip", "localhost", true,
new HashMap<>() {{
put(T2C_LanguageEnum.german, List.of());
put(T2C_LanguageEnum.english, List.of());
}}),
- mysqlPort("Storage.MySQL.Port", 3306, true,
+ mysqlPort("storage.mysql.port", 3306, true,
new HashMap<>() {{
put(T2C_LanguageEnum.german, List.of());
put(T2C_LanguageEnum.english, List.of());
}}),
- mysqlDatabase("Storage.MySQL.Database", "database", true,
+ mysqlDatabase("storage.mysql.database", "database", true,
new HashMap<>() {{
put(T2C_LanguageEnum.german, List.of());
put(T2C_LanguageEnum.english, List.of());
}}),
- mysqlUser("Storage.MySQL.User", "user", true,
+ mysqlUser("storage.mysql.user", "user", true,
new HashMap<>() {{
put(T2C_LanguageEnum.german, List.of());
put(T2C_LanguageEnum.english, List.of());
}}),
- mysqlPassword("Storage.MySQL.Password", "password", true,
+ mysqlPassword("storage.mysql.password", "password", true,
new HashMap<>() {{
put(T2C_LanguageEnum.german, List.of());
put(T2C_LanguageEnum.english, List.of());
}}),
- mysqlSSL("Storage.MySQL.SSL", false, true,
+ mysqlSSL("storage.mysql.ssl", false, true,
new HashMap<>() {{
put(T2C_LanguageEnum.german, List.of());
put(T2C_LanguageEnum.english, List.of());
}}),
- UseItem_Enable("UseItem.Enable", true, true,
+ useItemEnable("useItem.enable", true, true,
new HashMap<>() {{
put(T2C_LanguageEnum.german, List.of());
put(T2C_LanguageEnum.english, List.of());
}}),
- UseItem_AllowToggle("UseItem.AllowToggle", true, true,
+ useItemAllowToggle("useItem.allowToggle", true, true,
new HashMap<>() {{
put(T2C_LanguageEnum.german, List.of());
put(T2C_LanguageEnum.english, List.of());
}}),
- UseItem_AllowSetSlot("UseItem.AllowSetSlot", true, true,
+ useItemAllowSetSlot("useItem.allowSetSlot", true, true,
new HashMap<>() {{
put(T2C_LanguageEnum.german, List.of());
put(T2C_LanguageEnum.english, List.of());
}}),
- UseItem_BlockMoveAndDrop("UseItem.BlockMoveAndDrop", true, true,
+ useItemBlockMoveAndDrop("useItem.blockMoveAndDrop", true, true,
new HashMap<>() {{
put(T2C_LanguageEnum.german, List.of());
put(T2C_LanguageEnum.english, List.of());
}}),
- UseItem_OpenGUI("UseItem.OpenGUI", "default", true,
+ useItemOpenGUI("useItem.openGUI", "default", true,
new HashMap<>() {{
put(T2C_LanguageEnum.german, List.of());
put(T2C_LanguageEnum.english, List.of());
}}),
- UseItem_Permission("UseItem.Permission.NeededToUse", true, true,
+ useItemPermissionNeeded("useItem.permission.neededToUse", true, true,
new HashMap<>() {{
put(T2C_LanguageEnum.german, List.of());
put(T2C_LanguageEnum.english, List.of());
}}),
- UseItem_KeepAtCommandClear("UseItem.KeepAtCommandClear", true, true,
+ useItemKeepAtCommandClear("useItem.keepAtCommandClear", true, true,
new HashMap<>() {{
put(T2C_LanguageEnum.german, List.of());
put(T2C_LanguageEnum.english, List.of());
}}),
- UseItem_InventorySlot_FreeSlot("UseItem.InventorySlot.FreeSlot", 1, true,
+
+ useItemInventorySlot("useItem.inventorySlot.slot", 1, true,
new HashMap<>() {{
put(T2C_LanguageEnum.german, List.of());
put(T2C_LanguageEnum.english, List.of());
}}),
- UseItem_InventorySlot("UseItem.InventorySlot.Slot", false, true,
+ useItemInventorySlotEnforce("useItem.inventorySlot.slotEnforce", false, true,
new HashMap<>() {{
put(T2C_LanguageEnum.german, List.of());
put(T2C_LanguageEnum.english, List.of());
}}),
- UseItem_InventorySlotEnforce("UseItem.InventorySlot.SlotEnforce", false, true,
+ useItemInventorySlotFreeSlot("useItem.inventorySlot.freeSlot", false, true,
new HashMap<>() {{
put(T2C_LanguageEnum.german, List.of());
put(T2C_LanguageEnum.english, List.of());
}}),
- UseItem_Material("UseItem.Item.Material", "paper", true,
+ useItemMaterial("useItem.item.material", "paper", true,
new HashMap<>() {{
put(T2C_LanguageEnum.german, List.of());
put(T2C_LanguageEnum.english, List.of());
}}),
- UseItem_PlayerHead_Enable(isHead() ? "UseItem.Item.PlayerHead.Enable" : null, false, true,
+ useItemPlayerHeadEnable(isHead() ? "useItem.item.playerHead.enable" : null, false, true,
new HashMap<>() {
{
put(T2C_LanguageEnum.german, List.of());
put(T2C_LanguageEnum.english, List.of());
}
}),
- UseItem_Base64_Enable(isHead() ? "UseItem.Item.PlayerHead.Base64.Enable" : null, false, true,
+ useItemBase64Enable(isHead() ? "useItem.item.playerHead.base64.enable" : null, false, true,
new HashMap<>() {
{
put(T2C_LanguageEnum.german, List.of());
put(T2C_LanguageEnum.english, List.of());
}
}),
- UseItem_Base64value(isHead() ? "UseItem.Item.PlayerHead.Base64.Base64Value" : null, "", true,
+ useItemBase64value(isHead() ? "useItem.item.playerHead.base64.base64value" : null, "", true,
new HashMap<>() {
{
put(T2C_LanguageEnum.german, List.of());
put(T2C_LanguageEnum.english, List.of());
}
}),
- UseItem_PlayerWhoHasOpenedTheGUI(isHead() ? "UseItem.Item.PlayerHead.PlayerWhoHasOpenedTheGUI" : null, false, true,
+ useItemPlayerWhoHasOpenedTheGUI(isHead() ? "useItem.item.playerHead.playerWhoHasOpenedTheGUI" : null, false, true,
new HashMap<>() {
{
put(T2C_LanguageEnum.german, List.of());
put(T2C_LanguageEnum.english, List.of());
}
}),
- UseItem_PlayerName(isHead() ? "UseItem.Item.PlayerHead.PlayerName" : null, "", true,
+ useItemPlayerName(isHead() ? "useItem.item.playerHead.playerName" : null, "", true,
new HashMap<>() {
{
put(T2C_LanguageEnum.german, List.of());
put(T2C_LanguageEnum.english, List.of());
}
}),
- UseItem_Name("UseItem.Item.Name", "&bDefault &6GUI", true,
+ useItemName("useItem.item.name", "&bDefault &6GUI", true,
new HashMap<>() {
{
put(T2C_LanguageEnum.german, List.of());
put(T2C_LanguageEnum.english, List.of());
}
}),
- UseItem_Lore("UseItem.Item.Lore", List.of("&eThis is an example GUI"), true,
+ useItemLore("useItem.item.lore", List.of("&eThis is an example GUI"), true,
new HashMap<>() {
{
put(T2C_LanguageEnum.german, List.of());
put(T2C_LanguageEnum.english, List.of());
}
}),
- UseItem_GiveOnEveryJoin("UseItem.Join.GiveOnEveryJoin", true, true,
+ useItemGiveOnEveryJoin("useItem.Join.GiveOnEveryJoin", true, true,
new HashMap<>() {
{
put(T2C_LanguageEnum.german, List.of());
put(T2C_LanguageEnum.english, List.of());
}
}),
- UseItem_GiveOnlyOnFirstJoin("UseItem.Join.GiveOnlyOnFirstJoin", false, true,
+ useItemGiveOnlyOnFirstJoin("useItem.join.giveOnlyOnFirstJoin", false, true,
new HashMap<>() {
{
put(T2C_LanguageEnum.german, List.of());
put(T2C_LanguageEnum.english, List.of());
}
}),
- Cursor_ToGUIItem_OnLogin("UseItem.Join.Cursor.ToGUIItem.OnLogin.Enable", true, true,
+ cursorToGUIItemOnLogin("useItem.join.cursor.toGUIItem.onLogin.enable", true, true,
new HashMap<>() {
{
put(T2C_LanguageEnum.german, List.of());
put(T2C_LanguageEnum.english, List.of());
}
}),
- Cursor_ToGUIItem_OnlyOnFirstLogin("UseItem.Join.Cursor.ToGUIItem.Spigot.OnlyOnFirstLogin", true, true,
+ cursorToGUIItemOnlyOnFirstLogin("useItem.join.cursor.toGUIItem.onlyOnFirstLogin", true, true,
new HashMap<>() {
{
put(T2C_LanguageEnum.german, List.of());
put(T2C_LanguageEnum.english, List.of());
}
}),
- UseItem_ServerChange("UseItem.Join.Cursor.ToGUIItem.Bungee.OnServerChange", false, true,
+ cursorUseItemServerChange("useItem.join.cursor.toGUIItem.onServerChange", false, true,
new HashMap<>() {
{
put(T2C_LanguageEnum.german, List.of());
put(T2C_LanguageEnum.english, List.of());
}
}),
- toggleItemOnOrYesBase64("Toggle.Items.OnOrYes.Item.Base64.Enable", false, true,
+ toggleItemOnOrYesBase64("toggle.items.onOrYes.item.base64.enable", false, true,
new HashMap<>() {
{
put(T2C_LanguageEnum.german, List.of());
put(T2C_LanguageEnum.english, List.of());
}
}),
- toggleItemOnOrYesBase64Value("Toggle.Items.OnOrYes.Item.Base64.Base64Value", "", true,
+ toggleItemOnOrYesBase64Value("toggle.items.onOrYes.item.base64.base64value", "", true,
new HashMap<>() {
{
put(T2C_LanguageEnum.german, List.of());
put(T2C_LanguageEnum.english, List.of());
}
}),
- toggleItemOnOrYesMaterial("Toggle.Items.OnOrYes.Item.Material", Main.legacy ? "WOOL,5" : T2C_ItemVersion.getGreenWool().getType().toString(), true,
+ toggleItemOnOrYesMaterial("toggle.items.onOrYes.item.material", Main.legacy ? "WOOL,5" : T2C_ItemVersion.getGreenWool().getType().toString(), true,
new HashMap<>() {
{
put(T2C_LanguageEnum.german, List.of());
put(T2C_LanguageEnum.english, List.of());
}
}),
- toggleItemOffOrNoBase64("Toggle.Items.OffOrNo.Item.Base64.Enable", false, true,
+ toggleItemOffOrNoBase64("toggle.items.offOrNo.item.base64.enable", false, true,
new HashMap<>() {
{
put(T2C_LanguageEnum.german, List.of());
put(T2C_LanguageEnum.english, List.of());
}
}),
- toggleItemOffOrNoBase64Value("Toggle.Items.OffOrNo.Item.Base64.Base64Value", "", true,
+ toggleItemOffOrNoBase64Value("toggle.items.offOrNo.item.base64.base64value", "", true,
new HashMap<>() {
{
put(T2C_LanguageEnum.german, List.of());
put(T2C_LanguageEnum.english, List.of());
}
}),
- toggleItemOffOrNoMaterial("Toggle.Items.OffOrNo.Item.Material", Main.legacy ? "WOOL,14" : T2C_ItemVersion.getRedWool().getType().toString(), true,
+ toggleItemOffOrNoMaterial("toggle.items.offOrNo.item.material", Main.legacy ? "WOOL,14" : T2C_ItemVersion.getRedWool().getType().toString(), true,
new HashMap<>() {
{
put(T2C_LanguageEnum.german, List.of());
put(T2C_LanguageEnum.english, List.of());
}
}),
- togglePermTrue("Toggle.Permission.Commands.True", "luckperms user [player] permission set [perm] true", true,
+ togglePermTrue("toggle.permission.commands.true", "luckperms user [player] permission set [perm] true", true,
new HashMap<>() {
{
put(T2C_LanguageEnum.german, List.of());
put(T2C_LanguageEnum.english, List.of());
}
}),
- togglePermFalse("Toggle.Permission.Commands.False", "luckperms user [player] permission set [perm] false", true,
+ togglePermFalse("toggle.permission.commands.false", "luckperms user [player] permission set [perm] false", true,
new HashMap<>() {
{
put(T2C_LanguageEnum.german, List.of());
put(T2C_LanguageEnum.english, List.of());
}
}),
- placeholderTrue("Placeholder.True", "&2true", true,
+ placeholderTrue("placeholder.true", "&2true", true,
new HashMap<>() {
{
put(T2C_LanguageEnum.german, List.of());
@@ -316,7 +317,7 @@ public class Config {
}
}),
- placeholderFalse("Placeholder.False", "&4false", true,
+ placeholderFalse("placeholder.false", "&4false", true,
new HashMap<>() {
{
put(T2C_LanguageEnum.german, List.of());
@@ -325,49 +326,49 @@ public class Config {
}),
- Sound_Enable("Sound.Enable", true, true,
+ soundEnable("sound.enable", true, true,
new HashMap<>() {
{
put(T2C_LanguageEnum.german, List.of());
put(T2C_LanguageEnum.english, List.of());
}
}),
- Sound_OpenInventory_Enable("Sound.OpenInventory.Enable", true, true,
+ soundOpenInventoryEnable("sound.openInventory.enable", true, true,
new HashMap<>() {
{
put(T2C_LanguageEnum.german, List.of());
put(T2C_LanguageEnum.english, List.of());
}
}),
- Sound_OpenInventory_input("Sound.OpenInventory.Sound", getSoundOpenInventory(), true,
+ soundOpenInventory("sound.openInventory.sound", getSoundOpenInventory(), true,
new HashMap<>() {
{
put(T2C_LanguageEnum.german, List.of());
put(T2C_LanguageEnum.english, List.of());
}
}),
- Sound_Click_Enable("Sound.Click.Enable", true, true,
+ soundClickEnable("sound.click.enable", true, true,
new HashMap<>() {
{
put(T2C_LanguageEnum.german, List.of());
put(T2C_LanguageEnum.english, List.of());
}
}),
- Sound_Click_input("Sound.Click.Sound", getSoundClick(), true,
+ soundClick("sound.click.sound", getSoundClick(), true,
new HashMap<>() {
{
put(T2C_LanguageEnum.german, List.of());
put(T2C_LanguageEnum.english, List.of());
}
}),
- Sound_NoMoney_Enable("Sound.NoMoney.Enable", true, true,
+ soundNoMoneyEnable("sound.noMoney.enable", true, true,
new HashMap<>() {
{
put(T2C_LanguageEnum.german, List.of());
put(T2C_LanguageEnum.english, List.of());
}
}),
- Sound_NoMoney_input("Sound.NoMoney.Sound", getSoundNoMoney(), true,
+ soundNoMoney("sound.noMoney.sound", getSoundNoMoney(), true,
new HashMap<>() {
{
put(T2C_LanguageEnum.german, List.of());
@@ -375,42 +376,42 @@ public class Config {
}
}),
- Sound_NoInventorySpace_Enable("Sound.NoInventorySpace.Enable", true, true,
+ soundNoInventorySpaceEnable("sound.noInventorySpace.enable", true, true,
new HashMap<>() {
{
put(T2C_LanguageEnum.german, List.of());
put(T2C_LanguageEnum.english, List.of());
}
}),
- Sound_NoInventorySpace_input("Sound.NoInventorySpace.Sound", getSoundNoInventorySpace(), true,
+ soundNoInventorySpace("sound.noInventorySpace.sound", getSoundNoInventorySpace(), true,
new HashMap<>() {
{
put(T2C_LanguageEnum.german, List.of());
put(T2C_LanguageEnum.english, List.of());
}
}),
- Sound_Give_Enable("Sound.Give.Enable", true, true,
+ soundGiveEnable("sound.give.enable", true, true,
new HashMap<>() {
{
put(T2C_LanguageEnum.german, List.of());
put(T2C_LanguageEnum.english, List.of());
}
}),
- Sound_Give_input("Sound.Give.Sound", getSoundGive(), true,
+ soundGive("sound.give.sound", getSoundGive(), true,
new HashMap<>() {
{
put(T2C_LanguageEnum.german, List.of());
put(T2C_LanguageEnum.english, List.of());
}
}),
- Sound_PlayerNotFound_Enable("Sound.PlayerNotFound.Enable", true, true,
+ soundPlayerNotFoundEnable("sound.playerNotFound.enable", true, true,
new HashMap<>() {
{
put(T2C_LanguageEnum.german, List.of());
put(T2C_LanguageEnum.english, List.of());
}
}),
- Sound_PlayerNotFound_input("Sound.PlayerNotFound.Sound", getSoundPlayerNotFound(), true,
+ soundPlayerNotFound("sound.playerNotFound.sound", getSoundPlayerNotFound(), true,
new HashMap<>() {
{
put(T2C_LanguageEnum.german, List.of());
@@ -419,35 +420,35 @@ public class Config {
}),
- UseItemGameModeChangeEnable("Advanced.UseItem.GameMode.Change.Enable", true, true,
+ useItemGameModeChangeEnable("advanced.useItem.gameMode.change.enable", true, true,
new HashMap<>() {
{
put(T2C_LanguageEnum.german, List.of());
put(T2C_LanguageEnum.english, List.of());
}
}),
- UseItemGameModeChangeDelayInTicks("Advanced.UseItem.GameMode.Change.DelayInTicks", 1, true,
+ useItemGameModeChangeDelayInTicks("advanced.useItem.gameMode.change.delayInTicks", 1, true,
new HashMap<>() {
{
put(T2C_LanguageEnum.german, List.of());
put(T2C_LanguageEnum.english, List.of());
}
}),
- UseItemGameModeProtection("Advanced.UseItem.GameMode.Protection.Enable", false, true,
+ useItemGameModeProtection("advanced.useItem.gameMode.protection.enable", false, true,
new HashMap<>() {
{
put(T2C_LanguageEnum.german, List.of());
put(T2C_LanguageEnum.english, List.of());
}
}),
- UseItemGameModeRemoveItemWhenItIsDisabled("Advanced.UseItem.GameMode.Protection.RemoveItemWhenItIsDisabled", false, true,
+ useItemGameModeRemoveItemWhenItIsDisabled("advanced.useItem.gameMode.protection.removeItemWhenItIsDisabled", false, true,
new HashMap<>() {
{
put(T2C_LanguageEnum.german, List.of());
put(T2C_LanguageEnum.english, List.of());
}
}),
- UseItemGameModeMode("Advanced.UseItem.GameMode.Protection.Mode", "blacklist", true,
+ useItemGameModeMode("advanced.useItem.gameMode.protection.mode", "blacklist", true,
new HashMap<>() {
{
put(T2C_LanguageEnum.german, List.of());
@@ -455,7 +456,7 @@ public class Config {
}
}),
- UseItemGameModeList("Advanced.UseItem.GameMode.Protection.List", List.of("CREATIVE", "SPECTATOR"), true,
+ useItemGameModeList("advanced.useItem.gameMode.protection.list", List.of("CREATIVE", "SPECTATOR"), true,
new HashMap<>() {
{
put(T2C_LanguageEnum.german, List.of());
@@ -463,42 +464,42 @@ public class Config {
}
}),
- UseItemWorldChangeEnable("Advanced.UseItem.World.Change.Enable", true, true,
+ useItemWorldChangeEnable("advanced.useItem.world.change.enable", true, true,
new HashMap<>() {
{
put(T2C_LanguageEnum.german, List.of());
put(T2C_LanguageEnum.english, List.of());
}
}),
- UseItemWorldChangeDelayInTicks("Advanced.UseItem.World.Change.DelayInTicks", 1, true,
+ useItemWorldChangeDelayInTicks("advanced.useItem.world.change.delayInTicks", 1, true,
new HashMap<>() {
{
put(T2C_LanguageEnum.german, List.of());
put(T2C_LanguageEnum.english, List.of());
}
}),
- UseItemWorldProtection("Advanced.UseItem.World.Protection.Enable", false, true,
+ useItemWorldProtection("advanced.useItem.world.protection.enable", false, true,
new HashMap<>() {
{
put(T2C_LanguageEnum.german, List.of());
put(T2C_LanguageEnum.english, List.of());
}
}),
- UseItemWorldRemoveItemWhenItIsDisabled("Advanced.UseItem.World.Protection.RemoveItemWhenItIsDisabled", false, true,
+ useItemWorldRemoveItemWhenItIsDisabled("advanced.useItem.world.protection.removeItemWhenItIsDisabled", false, true,
new HashMap<>() {
{
put(T2C_LanguageEnum.german, List.of());
put(T2C_LanguageEnum.english, List.of());
}
}),
- UseItemWorldMode("Advanced.UseItem.World.Protection.Mode", List.of("CREATIVE", "Spectator"), true,
+ useItemWorldMode("advanced.useItem.world.protection.mode", List.of("CREATIVE", "Spectator"), true,
new HashMap<>() {
{
put(T2C_LanguageEnum.german, List.of());
put(T2C_LanguageEnum.english, List.of());
}
}),
- UseItemWorldList("Advanced.UseItem.World.Protection.List", List.of("World1", "World2"), true,
+ useItemWorldList("advanced.useItem.world.protection.list", List.of("World1", "World2"), true,
new HashMap<>() {
{
put(T2C_LanguageEnum.german, List.of());
@@ -507,10 +508,10 @@ public class Config {
}),
- // if (yamlConfiguration.get("Advanced.UseItem.DisableInfoBySneak") != null) {
- // disableInfoBySneak = yamlConfiguration.getBoolean("Advanced.UseItem.DisableInfoBySneak");
- // }
- disableInfoBySneak("Advanced.UseItem.DisableInfoBySneak", null, true,
+ // if (yamlConfiguration.get("advanced.UseItem.DisableInfoBySneak") != null) {
+ // disableInfoBySneak = yamlConfiguration.getBoolean("advanced.UseItem.DisableInfoBySneak");
+ // }
+ disableInfoBySneak("advanced.useItem.disableInfoBySneak", null, true,
new HashMap<>() {
{
put(T2C_LanguageEnum.german, List.of());
@@ -518,7 +519,7 @@ public class Config {
}
}),
- UseItemItemBlockBlacklist("Advanced.UseItem.ItemBlockBlacklist", getItemBlockBlacklist(), true,
+ useItemItemBlockBlacklist("advanced.useItem.itemBlockBlacklist", getItemBlockBlacklist(), true,
new HashMap<>() {
{
put(T2C_LanguageEnum.german, List.of());
@@ -572,9 +573,13 @@ public class Config {
public static void set(boolean isReload) {
T2C_ConfigWriter.createConfig(Util.getPrefix(), new File(Main.getPath(), "config.yml"), VALUES.values(), isReload, Util.getConfigLogo());
+ Util.replace(VALUES.prefix);
+ Util.replace(VALUES.useItemName);
+ Util.replace(VALUES.useItemLore);
+ Util.replace(VALUES.placeholderFalse);
+ Util.replace(VALUES.placeholderTrue);
}
-
private static boolean isHead() {
if (!(T2C_McVersion.isMc1_8() || T2C_McVersion.isMc1_9() || T2C_McVersion.isMc1_10() || T2C_McVersion.isMc1_11() || T2C_McVersion.isMc1_12())) {
return true;
@@ -650,20 +655,20 @@ public class Config {
return materialBlacklist;
}
- private static void checkSounds() {
- checkSound(VALUES.Sound_OpenInventory_input, getSoundOpenInventory());
- checkSound(VALUES.Sound_Click_input, getSoundOpenInventory());
- checkSound(VALUES.Sound_NoMoney_input, getSoundOpenInventory());
- checkSound(VALUES.Sound_NoInventorySpace_input, getSoundOpenInventory());
- checkSound(VALUES.Sound_Give_input, getSoundOpenInventory());
- checkSound(VALUES.Sound_PlayerNotFound_input, getSoundOpenInventory());
+ public static void checkSounds() {
+ checkSound(VALUES.soundOpenInventory, getSoundOpenInventory());
+ checkSound(VALUES.soundClick, getSoundOpenInventory());
+ checkSound(VALUES.soundNoMoney, getSoundOpenInventory());
+ checkSound(VALUES.soundNoInventorySpace, getSoundOpenInventory());
+ checkSound(VALUES.soundGive, getSoundOpenInventory());
+ checkSound(VALUES.soundPlayerNotFound, getSoundOpenInventory());
}
- private static void checkSound(VALUES item, String defaultSound) {
+ public static void checkSound(VALUES item, String defaultSound) {
try {
item.setValue(Sound.valueOf(item.value.toString()).toString());
} catch (Exception e) {
- T2C_Send.console("§4\n§4\n§4\n" + SelectMessages.SoundNotFound.replace("[prefix]", Util.getPrefix())
+ T2C_Send.console("§4\n§4\n§4\n" + Languages.VALUES.SoundNotFound.getValue().toString().replace("[prefix]", Util.getPrefix())
.replace("[sound]", "§8" + item.getPath() + item.value.toString()) + "§4\n§4\n§4\n");
item.setValue(Sound.valueOf(defaultSound).toString());
}
diff --git a/CommandGUI V2/src/main/java/net/t2code/commandguiv2/Spigot/config/config/ConfigCreate.java b/CommandGUI V2/src/main/java/net/t2code/commandguiv2/Spigot/config/config/ConfigCreate.java
deleted file mode 100644
index 6362226..0000000
--- a/CommandGUI V2/src/main/java/net/t2code/commandguiv2/Spigot/config/config/ConfigCreate.java
+++ /dev/null
@@ -1,191 +0,0 @@
-package net.t2code.commandguiv2.Spigot.config.config;
-
-import net.t2code.commandguiv2.Spigot.Main;
-import net.t2code.commandguiv2.Spigot.config.languages.SelectMessages;
-import net.t2code.commandguiv2.Util;
-import net.t2code.t2codelib.SPIGOT.api.items.T2C_ItemVersion;
-import net.t2code.t2codelib.SPIGOT.api.messages.T2C_Replace;
-import net.t2code.t2codelib.SPIGOT.api.messages.T2C_Send;
-import net.t2code.t2codelib.SPIGOT.api.minecraftVersion.T2C_McVersion;
-import net.t2code.t2codelib.SPIGOT.api.yaml.T2C_ConfigWriter;
-import net.t2code.t2codelib.SPIGOT.api.yaml.T2Cconfig;
-import net.t2code.t2codelib.util.T2C_ConfigItem;
-import net.t2code.t2codelib.util.T2C_LanguageEnum;
-import org.bukkit.Material;
-import org.bukkit.Sound;
-import org.bukkit.configuration.file.YamlConfiguration;
-
-import java.io.File;
-import java.io.IOException;
-import java.util.*;
-
-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")) T2C_Send.console(Util.getPrefix() + " §5DEBUG: §6" + " §4config.yml are created / updated...");
- } else T2C_Send.console(Util.getPrefix() + " §4config.yml are created...");
-
- File config = new File(Main.getPath(), "config.yml");
- YamlConfiguration yamlConfiguration = YamlConfiguration.loadConfiguration(config);
-
- T2Cconfig.set("Plugin.Debug", false, yamlConfiguration);
- T2Cconfig.set("Plugin.updateCheck.onJoin", true, yamlConfiguration);
- T2Cconfig.set("Plugin.updateCheck.seePreReleaseUpdates", true, yamlConfiguration);
- T2Cconfig.set("Plugin.updateCheck.timeInterval", 60, 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);
- T2Cconfig.set("Plugin.Prefix", "&8[&4C&9GUI&8]", yamlConfiguration);
-
- if (Main.legacy) {
- 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);
-
- 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);
-
- T2Cconfig.set("UseItem.InventorySlot.Slot", 1, yamlConfiguration);
- T2Cconfig.set("UseItem.InventorySlot.SlotEnforce", false, yamlConfiguration);
- T2Cconfig.set("UseItem.InventorySlot.FreeSlot", false, yamlConfiguration);
-
- T2Cconfig.set("UseItem.Item.Material", "paper", yamlConfiguration);
- if (!(T2C_McVersion.isMc1_8() || T2C_McVersion.isMc1_9() || T2C_McVersion.isMc1_10() || T2C_McVersion.isMc1_11() || T2C_McVersion.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);
- }
- 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")) {
- 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")) {
- 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")) {
- 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);
- }
-
- 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);
-
- T2Cconfig.set("Toggle.Items.OnOrYes.Item.Base64.Enable", false, yamlConfiguration);
- T2Cconfig.set("Toggle.Items.OnOrYes.Item.Base64.Base64Value", "", yamlConfiguration);
- if (Main.legacy) {
- T2Cconfig.set("Toggle.Items.OnOrYes.Item.Material", "WOOL,5", yamlConfiguration);
- } else T2Cconfig.set("Toggle.Items.OnOrYes.Item.Material", T2C_ItemVersion.getGreenWool().getType().toString(), yamlConfiguration);
-
- T2Cconfig.set("Toggle.Items.OffOrNo.Item.Base64.Enable", false, yamlConfiguration);
- T2Cconfig.set("Toggle.Items.OffOrNo.Item.Base64.Base64Value", "", yamlConfiguration);
- if (Main.legacy) {
- T2Cconfig.set("Toggle.Items.OffOrNo.Item.Material", "WOOL,14", yamlConfiguration);
- } else T2Cconfig.set("Toggle.Items.OffOrNo.Item.Material", T2C_ItemVersion.getRedWool().getType().toString(), 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);
-
- T2Cconfig.set("Placeholder.True", "&2true", yamlConfiguration);
- T2Cconfig.set("Placeholder.False", "&4false", yamlConfiguration);
-
- T2Cconfig.set("Sound.Enable", true, yamlConfiguration);
-
- T2Cconfig.set("Sound.OpenInventory.Enable", true, yamlConfiguration);
- if (T2C_McVersion.isMc1_8()) {
- T2Cconfig.set("Sound.OpenInventory.Sound", "CHEST_OPEN", yamlConfiguration);
- } else T2Cconfig.set("Sound.OpenInventory.Sound", "BLOCK_CHEST_OPEN", yamlConfiguration);
-
- T2Cconfig.set("Sound.Click.Enable", true, yamlConfiguration);
- if (T2C_McVersion.isMc1_8()) {
- T2Cconfig.set("Sound.Click.Sound", "NOTE_STICKS", yamlConfiguration);
- } else if (T2C_McVersion.isMc1_9() || T2C_McVersion.isMc1_10() || T2C_McVersion.isMc1_11() || T2C_McVersion.isMc1_12()) {
- T2Cconfig.set("Sound.Click.Sound", "BLOCK_NOTE_HAT", yamlConfiguration);
- } else T2Cconfig.set("Sound.Click.Sound", "BLOCK_NOTE_BLOCK_HAT", yamlConfiguration);
-
- T2Cconfig.set("Sound.NoMoney.Enable", true, yamlConfiguration);
- if (T2C_McVersion.isMc1_8()) {
- T2Cconfig.set("Sound.NoMoney.Sound", "NOTE_PIANO", yamlConfiguration);
- } else if (T2C_McVersion.isMc1_9() || T2C_McVersion.isMc1_10() || T2C_McVersion.isMc1_11() || T2C_McVersion.isMc1_12()) {
- T2Cconfig.set("Sound.NoMoney.Sound", "BLOCK_NOTE_HARP", yamlConfiguration);
- } else T2Cconfig.set("Sound.NoMoney.Sound", "BLOCK_NOTE_BLOCK_HARP", yamlConfiguration);
-
- T2Cconfig.set("Sound.NoInventorySpace.Enable", true, yamlConfiguration);
- if (T2C_McVersion.isMc1_8()) {
- T2Cconfig.set("Sound.NoInventorySpace.Sound", "NOTE_PIANO", yamlConfiguration);
- } else if (T2C_McVersion.isMc1_9() || T2C_McVersion.isMc1_10() || T2C_McVersion.isMc1_11() || T2C_McVersion.isMc1_12()) {
- T2Cconfig.set("Sound.NoInventorySpace.Sound", "BLOCK_NOTE_HARP", yamlConfiguration);
- } else T2Cconfig.set("Sound.NoInventorySpace.Sound", "BLOCK_NOTE_BLOCK_HARP", yamlConfiguration);
-
- T2Cconfig.set("Sound.Give.Enable", true, yamlConfiguration);
- if (T2C_McVersion.isMc1_8()) {
- T2Cconfig.set("Sound.Give.Sound", "LEVEL_UP", yamlConfiguration);
- } else T2Cconfig.set("Sound.Give.Sound", "ENTITY_PLAYER_LEVELUP", yamlConfiguration);
-
- T2Cconfig.set("Sound.PlayerNotFound.Enable", true, yamlConfiguration);
- if (T2C_McVersion.isMc1_8()) {
- T2Cconfig.set("Sound.PlayerNotFound.Sound", "NOTE_PIANO", yamlConfiguration);
- } else if (T2C_McVersion.isMc1_9() || T2C_McVersion.isMc1_10() || T2C_McVersion.isMc1_11() || T2C_McVersion.isMc1_12()) {
- T2Cconfig.set("Sound.PlayerNotFound.Sound", "BLOCK_NOTE_HARP", yamlConfiguration);
- } else T2Cconfig.set("Sound.PlayerNotFound.Sound", "BLOCK_NOTE_BLOCK_HARP", 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);
-
- 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", Arrays.asList("CREATIVE", "Spectator"), yamlConfiguration);
- T2Cconfig.set("Advanced.UseItem.World.Protection.List", Arrays.asList("World1", "World2"), yamlConfiguration);
-
- if (!yamlConfiguration.contains("Advanced.UseItem.ItemBlockBlacklist")) {
- List materialList = Arrays.asList("BUTTON", "DOOR", "FENCE", "CHEST", "FURNACE", "NOTE_BLOCK", "CRAFTING_TABLE", "WORKBENCH",
- "ANVIL", "LOOM", "COMPOSTER", "BARREL", "SMOKER", "BLAST_FURNACE", "CARTOGRAPHY_TABLE", "FLETCHING_TABLE", "GRINDSTONE",
- "SMITHING_TABLE", "STONECUTTER", "HOPPER", "DISPENSER", "DROPPER", "REPEATER", "COMPARATOR", "LEVER", "DAYLIGHT_DETECTOR", "BREWING_STAND", "TRAPDOOR", "BEACON"
- );
-
- List materialBlacklist = new ArrayList<>();
- for (Material material : Material.values()) {
- for (String target : materialList) {
- if (material.toString().contains(target)) materialBlacklist.add(material.toString());
- }
- }
- T2Cconfig.set("Advanced.UseItem.ItemBlockBlacklist", materialBlacklist, yamlConfiguration);
- }
-
- try {
- yamlConfiguration.save(config);
- } catch (IOException e) {
- e.printStackTrace();
- }
- T2C_Send.console(Util.getPrefix() + " §2config.yml were successfully created / updated." + " §7- §e" + (System.currentTimeMillis() - long_) + "ms");
- }
-}
diff --git a/CommandGUI V2/src/main/java/net/t2code/commandguiv2/Spigot/config/config/SelectConfig.java b/CommandGUI V2/src/main/java/net/t2code/commandguiv2/Spigot/config/config/SelectConfig.java
deleted file mode 100644
index ee96b63..0000000
--- a/CommandGUI V2/src/main/java/net/t2code/commandguiv2/Spigot/config/config/SelectConfig.java
+++ /dev/null
@@ -1,707 +0,0 @@
-package net.t2code.commandguiv2.Spigot.config.config;
-
-import net.t2code.commandguiv2.Spigot.Main;
-import net.t2code.commandguiv2.Spigot.config.configConverter.ConfigConverter;
-import net.t2code.commandguiv2.Spigot.config.languages.SelectMessages;
-import net.t2code.commandguiv2.Util;
-import net.t2code.t2codelib.SPIGOT.api.debug.T2Cdebug;
-import net.t2code.t2codelib.SPIGOT.api.messages.T2C_Replace;
-import net.t2code.t2codelib.SPIGOT.api.messages.T2C_Send;
-import net.t2code.t2codelib.SPIGOT.api.minecraftVersion.T2C_McVersion;
-import org.bukkit.Sound;
-import org.bukkit.configuration.file.YamlConfiguration;
-
-import java.io.File;
-import java.io.IOException;
-import java.util.ArrayList;
-import java.util.List;
-import java.util.Objects;
-
-public class SelectConfig {
- public static void onSelect() {
- File config = new File(Main.getPath(), "config.yml");
- YamlConfiguration yamlConfiguration = YamlConfiguration.loadConfiguration(config);
-
- if (yamlConfiguration.getInt("ConfigVersion") < Util.getConfigVersion() && new File(Main.getPath(), "config.yml").exists()) {
- T2C_Send.console(Util.getPrefix() + " §4----------------------");
- T2C_Send.console(Util.getPrefix() + " ");
- T2C_Send.console(Util.getPrefix() + " §6New features have been added to CommandGUI. The Config is adapted!");
- T2C_Send.console(Util.getPrefix() + " ");
- T2C_Send.console(Util.getPrefix() + " §4----------------------");
- if (yamlConfiguration.getInt("ConfigVersion") < 5) {
- ConfigConverter.convert();
- }
- if (yamlConfiguration.getInt("ConfigVersion") < 6) {
- ConfigConverter.removeBungeeOption();
- }
- if (yamlConfiguration.getInt("ConfigVersion") < 7) {
- ConfigConverter.convert7();
- }
- }
-
- Debug = yamlConfiguration.getBoolean("Plugin.Debug");
- updateCheckOnJoin = yamlConfiguration.getBoolean("Plugin.updateCheck.onJoin");
- updateCheckSeePreReleaseUpdates = yamlConfiguration.getBoolean("Plugin.updateCheck.seePreReleaseUpdates");
- updateCheckTimeInterval = yamlConfiguration.getInt("Plugin.updateCheck.timeInterval");
- HelpAlias = yamlConfiguration.getBoolean("Plugin.HelpAlias");
- adminSubCommand = yamlConfiguration.getString("Plugin.AdminSubCommand").toLowerCase();
- language = yamlConfiguration.getString("Plugin.language");
- Currency = yamlConfiguration.getString("Plugin.Currency");
- DefaultGUI = yamlConfiguration.getString("Plugin.DefaultGUI");
- prefix = T2C_Replace.replace("", Objects.requireNonNull(yamlConfiguration.getString("Plugin.Prefix")));
-
- storage = yamlConfiguration.getString("Storage.Type").toUpperCase();
-
- mysqlIp = yamlConfiguration.getString("Storage.MySQL.IP");
- mysqlPort = yamlConfiguration.getInt("Storage.MySQL.Port");
- mysqlDatabase = yamlConfiguration.getString("Storage.MySQL.Database");
- mysqlUser = yamlConfiguration.getString("Storage.MySQL.User");
- mysqlPassword = yamlConfiguration.getString("Storage.MySQL.Password");
- mysqlSSL = yamlConfiguration.getBoolean("Storage.MySQL.SSL");
-
- 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 = T2C_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");
-
- toggleItemOnOrYesBase64 = yamlConfiguration.getBoolean("Toggle.Items.OnOrYes.Item.Base64.Enable");
- toggleItemOnOrYesBase64Value = yamlConfiguration.getString("Toggle.Items.OnOrYes.Item.Base64.Base64Value");
- toggleItemOnOrYesMaterial = yamlConfiguration.getString("Toggle.Items.OnOrYes.Item.Material");
-
- toggleItemOffOrNoBase64 = yamlConfiguration.getBoolean("Toggle.Items.OffOrNo.Item.Base64.Enable");
- toggleItemOffOrNoBase64Value = yamlConfiguration.getString("Toggle.Items.OffOrNo.Item.Base64.Base64Value");
- toggleItemOffOrNoMaterial = yamlConfiguration.getString("Toggle.Items.OffOrNo.Item.Material");
-
- togglePermTrue = yamlConfiguration.getString("Toggle.Permission.Commands.True");
- togglePermFalse = yamlConfiguration.getString("Toggle.Permission.Commands.False");
-
- placeholderTrue = yamlConfiguration.getString("Placeholder.True");
- placeholderFalse = yamlConfiguration.getString("Placeholder.False");
-
-
-
- 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_Click_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(".", "_"));
-
-
- //todo noch zu neu config
- UseItemGameModeChangeEnable = yamlConfiguration.getBoolean("Advanced.UseItem.GameMode.Change.Enable");
- UseItemGameModeChangeDelayInTicks = yamlConfiguration.getInt("Advanced.UseItem.GameMode.Change.DelayInTicks");
- UseItemGameModeProtection = yamlConfiguration.getBoolean("Advanced.UseItem.GameMode.Protection.Enable");
- UseItemGameModeRemoveItemWhenItIsDisabled = yamlConfiguration.getBoolean("Advanced.UseItem.GameMode.Protection.RemoveItemWhenItIsDisabled");
- UseItemGameModeMode = yamlConfiguration.getString("Advanced.UseItem.GameMode.Protection.Mode");
-
- UseItemGameModeList = yamlConfiguration.getStringList("Advanced.UseItem.GameMode.Protection.List");
-
- UseItemWorldChangeEnable = yamlConfiguration.getBoolean("Advanced.UseItem.World.Change.Enable");
- UseItemWorldChangeDelayInTicks = yamlConfiguration.getInt("Advanced.UseItem.World.Change.DelayInTicks");
- UseItemWorldProtection = yamlConfiguration.getBoolean("Advanced.UseItem.World.Protection.Enable");
- UseItemWorldRemoveItemWhenItIsDisabled = yamlConfiguration.getBoolean("Advanced.UseItem.World.Protection.RemoveItemWhenItIsDisabled");
- UseItemWorldMode = yamlConfiguration.getString("Advanced.UseItem.World.Protection.Mode");
- UseItemWorldList = yamlConfiguration.getStringList("Advanced.UseItem.World.Protection.List");
-
-
- if (yamlConfiguration.get("Advanced.UseItem.DisableInfoBySneak") != null) {
- disableInfoBySneak = yamlConfiguration.getBoolean("Advanced.UseItem.DisableInfoBySneak");
- }
-
- UseItemItemBlockBlacklist = yamlConfiguration.getStringList("Advanced.UseItem.ItemBlockBlacklist");
- }
-
-
- public static void sound(String Prefix) {
- String soundOpenInventory;
- if (T2C_McVersion.isMc1_8()) {
- soundOpenInventory = "CHEST_OPEN";
- } else {
- soundOpenInventory = "BLOCK_CHEST_OPEN";
- }
-
- String soundClick;
- if (T2C_McVersion.isMc1_8()) {
- soundClick = "NOTE_STICKS";
- } else if (T2C_McVersion.isMc1_9() || T2C_McVersion.isMc1_10() || T2C_McVersion.isMc1_11() || T2C_McVersion.isMc1_12()) {
- soundClick = "BLOCK_NOTE_HAT";
- } else {
- soundClick = "BLOCK_NOTE_BLOCK_HAT";
- }
-
- String soundNoMoney;
- if (T2C_McVersion.isMc1_8()) {
- soundNoMoney = "NOTE_PIANO";
- } else if (T2C_McVersion.isMc1_9() || T2C_McVersion.isMc1_10() || T2C_McVersion.isMc1_11() || T2C_McVersion.isMc1_12()) {
- soundNoMoney = "BLOCK_NOTE_HARP";
- } else {
- soundNoMoney = "BLOCK_NOTE_BLOCK_HARP";
- }
-
- String soundNoInventorySpace;
- if (T2C_McVersion.isMc1_8()) {
- soundNoInventorySpace = "NOTE_PIANO";
- } else if (T2C_McVersion.isMc1_9() || T2C_McVersion.isMc1_10() || T2C_McVersion.isMc1_11() || T2C_McVersion.isMc1_12()) {
- soundNoInventorySpace = "BLOCK_NOTE_BASS";
- } else {
- soundNoInventorySpace = "BLOCK_NOTE_BLOCK_GUITAR";
- }
-
- String soundGive;
- if (T2C_McVersion.isMc1_8()) {
- soundGive = "LEVEL_UP";
- } else {
- soundGive = "ENTITY_PLAYER_LEVELUP";
- }
-
- String soundPlayerNotFound;
- if (T2C_McVersion.isMc1_8()) {
- soundPlayerNotFound = "NOTE_PIANO";
- } else if (T2C_McVersion.isMc1_9() || T2C_McVersion.isMc1_10() || T2C_McVersion.isMc1_11() || T2C_McVersion.isMc1_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) {
- T2C_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) {
- T2C_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) {
- T2C_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) {
- T2C_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) {
- T2C_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_PlayerNotFound = Sound.valueOf(Sound_PlayerNotFound_input);
- } catch (Exception e) {
- T2C_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);
- }
-
- }
-
- public static void setConfigVersion() {
- File config = new File(Main.getPath(), "config.yml");
- YamlConfiguration yamlConfiguration = YamlConfiguration.loadConfiguration(config);
- yamlConfiguration.set("ConfigVersion", Util.getConfigVersion());
- try {
- yamlConfiguration.save(config);
- } catch (IOException e) {
- e.printStackTrace();
- }
- }
-
- private static Boolean Debug;
-
- private static Boolean updateCheckOnJoin;
- private static Boolean updateCheckSeePreReleaseUpdates;
- private static Integer updateCheckTimeInterval;
- private static Boolean HelpAlias;
- private static String adminSubCommand;
- private static String language;
- private static String Currency;
-
- private static String storage;
-
- private static String mysqlIp;
- private static Integer mysqlPort;
- private static String mysqlDatabase;
- private static String mysqlUser;
- private static String mysqlPassword;
- private static Boolean mysqlSSL;
-
- private static String DefaultGUI;
- private static String prefix;
-
- private static Boolean UseItem_Enable;
- private static Boolean UseItem_AllowToggle;
- private static Boolean UseItem_AllowSetSlot;
- private static Boolean UseItem_GiveOnEveryJoin;
- private static Boolean UseItem_GiveOnlyOnFirstJoin;
- private static Boolean UseItem_ServerChange;
- private static Boolean Cursor_ToGUIItem_OnLogin;
- private static Boolean Cursor_ToGUIItem_OnlyOnFirstLogin;
- private static Boolean UseItem_BlockMoveAndDrop;
- private static String UseItem_OpenGUI;
- private static Boolean UseItem_Permission;
- private static Boolean UseItem_KeepAtCommandClear;
-
- private static Boolean UseItemGameModeChangeEnable;
- private static int UseItemGameModeChangeDelayInTicks;
- private static Boolean UseItemGameModeProtection;
- private static Boolean UseItemGameModeRemoveItemWhenItIsDisabled;
- private static String UseItemGameModeMode;
- private static List UseItemGameModeList;
-
- private static Boolean UseItemWorldChangeEnable;
- private static int UseItemWorldChangeDelayInTicks;
- private static Boolean UseItemWorldProtection;
- private static Boolean UseItemWorldRemoveItemWhenItIsDisabled;
- private static String UseItemWorldMode;
- private static List UseItemWorldList;
- private static List UseItemItemBlockBlacklist;
-
- private static Boolean disableInfoBySneak = false;
-
- private static Boolean UseItem_InventorySlot_FreeSlot;
- private static Integer UseItem_InventorySlot;
- private static Boolean UseItem_InventorySlotEnforce;
- private static String UseItem_Material;
- private static Boolean UseItem_PlayerHead_Enable;
- private static Boolean UseItem_Base64_Enable;
- private static String UseItem_Base64value;
- private static Boolean UseItem_PlayerWhoHasOpenedTheGUI;
- private static String UseItem_PlayerName;
- private static String UseItem_Name;
- private static List UseItem_Lore;
-
- private static Boolean toggleItemOnOrYesBase64;
- private static String toggleItemOnOrYesBase64Value;
- private static String toggleItemOnOrYesMaterial;
-
- private static Boolean toggleItemOffOrNoBase64;
- private static String toggleItemOffOrNoBase64Value;
- private static String toggleItemOffOrNoMaterial;
-
- private static String togglePermTrue;
- private static String togglePermFalse;
-
- private static String placeholderTrue;
- private static String placeholderFalse;
-
- private static Boolean Sound_Enable = true;
-
- private static Boolean Sound_OpenInventory_Enable = true;
- private static Sound Sound_OpenInventory;
- private static String Sound_OpenInventory_input;
-
- private static Boolean Sound_Click_Enable = true;
- private static Sound Sound_Click;
- private static String Sound_Click_input;
-
- private static Boolean Sound_NoMoney_Enable = true;
- private static Sound Sound_NoMoney;
- private static String Sound_NoMoney_input;
-
- private static Boolean Sound_NoInventorySpace_Enable = true;
- private static Sound Sound_NoInventorySpace;
- private static String Sound_NoInventorySpace_input;
-
- private static Boolean Sound_Give_Enable = true;
- private static Sound Sound_Give;
- private static String Sound_Give_input;
-
- private static Boolean Sound_PlayerNotFound_Enable = true;
- private static Sound Sound_PlayerNotFound;
- private static String Sound_PlayerNotFound_input;
-
- public static Boolean getDebug() {
- return Debug;
- }
-
- public static Boolean getUpdateCheckOnJoin() {
- return updateCheckOnJoin;
- }
-
- public static Boolean getUpdateCheckSeePreReleaseUpdates() {
- return updateCheckSeePreReleaseUpdates;
- }
-
- public static Integer getUpdateCheckTimeInterval() {
- return updateCheckTimeInterval;
- }
-
- public static Boolean getHelpAlias() {
- return HelpAlias;
- }
-
- public static String getAdminSubCommand() {
- return adminSubCommand;
- }
-
- public static String getLanguage() {
- return language;
- }
-
- public static String getCurrency() {
- return Currency;
- }
-
- public static String getStorage() {
- return storage;
- }
-
- public static String getMysqlIp() {
- return mysqlIp;
- }
-
- public static Integer getMysqlPort() {
- return mysqlPort;
- }
-
- public static String getMysqlDatabase() {
- return mysqlDatabase;
- }
-
- public static String getMysqlUser() {
- return mysqlUser;
- }
-
- public static String getMysqlPassword() {
- return mysqlPassword;
- }
-
- public static Boolean getMysqlSSL() {
- return mysqlSSL;
- }
-
- public static String getDefaultGUI() {
- return DefaultGUI;
- }
-
- public static String getPrefix() {
- return prefix;
- }
-
- public static Boolean getUseItem_Enable() {
- return UseItem_Enable;
- }
-
- public static Boolean getUseItem_AllowToggle() {
- return UseItem_AllowToggle;
- }
-
- public static Boolean getUseItem_AllowSetSlot() {
- return UseItem_AllowSetSlot;
- }
-
- public static Boolean getUseItem_GiveOnEveryJoin() {
- return UseItem_GiveOnEveryJoin;
- }
-
- public static Boolean getUseItem_GiveOnlyOnFirstJoin() {
- return UseItem_GiveOnlyOnFirstJoin;
- }
-
- public static Boolean getUseItem_ServerChange() {
- return UseItem_ServerChange;
- }
-
- public static Boolean getCursor_ToGUIItem_OnLogin() {
- return Cursor_ToGUIItem_OnLogin;
- }
-
- public static Boolean getCursor_ToGUIItem_OnlyOnFirstLogin() {
- return Cursor_ToGUIItem_OnlyOnFirstLogin;
- }
-
- public static Boolean getUseItem_BlockMoveAndDrop() {
- return UseItem_BlockMoveAndDrop;
- }
-
- public static String getUseItem_OpenGUI() {
- return UseItem_OpenGUI;
- }
-
- public static Boolean getUseItem_Permission() {
- return UseItem_Permission;
- }
-
- public static Boolean getUseItem_KeepAtCommandClear() {
- return UseItem_KeepAtCommandClear;
- }
-
- public static Boolean getUseItemGameModeChangeEnable() {
- return UseItemGameModeChangeEnable;
- }
-
- public static int getUseItemGameModeChangeDelayInTicks() {
- return UseItemGameModeChangeDelayInTicks;
- }
-
- public static Boolean getUseItemGameModeProtection() {
- return UseItemGameModeProtection;
- }
-
- public static Boolean getUseItemGameModeRemoveItemWhenItIsDisabled() {
- return UseItemGameModeRemoveItemWhenItIsDisabled;
- }
-
- public static String getUseItemGameModeMode() {
- return UseItemGameModeMode;
- }
-
- public static List getUseItemGameModeList() {
- return UseItemGameModeList;
- }
-
- public static Boolean getUseItemWorldChangeEnable() {
- return UseItemWorldChangeEnable;
- }
-
- public static int getUseItemWorldChangeDelayInTicks() {
- return UseItemWorldChangeDelayInTicks;
- }
-
- public static Boolean getUseItemWorldProtection() {
- return UseItemWorldProtection;
- }
-
- public static Boolean getUseItemWorldRemoveItemWhenItIsDisabled() {
- return UseItemWorldRemoveItemWhenItIsDisabled;
- }
-
- public static String getUseItemWorldMode() {
- return UseItemWorldMode;
- }
-
- public static List getUseItemWorldList() {
- return UseItemWorldList;
- }
-
- public static List getUseItemItemBlockBlacklist() {
- return UseItemItemBlockBlacklist;
- }
-
- public static Boolean getDisableInfoBySneak() {
- return disableInfoBySneak;
- }
-
- public static Boolean getUseItem_InventorySlot_FreeSlot() {
- return UseItem_InventorySlot_FreeSlot;
- }
-
- public static Integer getUseItem_InventorySlot() {
- return UseItem_InventorySlot;
- }
-
- public static Boolean getUseItem_InventorySlotEnforce() {
- return UseItem_InventorySlotEnforce;
- }
-
- public static String getUseItem_Material() {
- return UseItem_Material;
- }
-
- public static Boolean getUseItem_PlayerHead_Enable() {
- return UseItem_PlayerHead_Enable;
- }
-
- public static Boolean getUseItem_Base64_Enable() {
- return UseItem_Base64_Enable;
- }
-
- public static String getUseItem_Base64value() {
- return UseItem_Base64value;
- }
-
- public static Boolean getUseItem_PlayerWhoHasOpenedTheGUI() {
- return UseItem_PlayerWhoHasOpenedTheGUI;
- }
-
- public static String getUseItem_PlayerName() {
- return UseItem_PlayerName;
- }
-
- public static String getUseItem_Name() {
- return UseItem_Name;
- }
-
- public static List getUseItem_Lore() {
- return UseItem_Lore;
- }
-
- public static Boolean getToggleItemOnOrYesBase64() {
- return toggleItemOnOrYesBase64;
- }
-
- public static String getToggleItemOnOrYesBase64Value() {
- return toggleItemOnOrYesBase64Value;
- }
-
- public static String getToggleItemOnOrYesMaterial() {
- return toggleItemOnOrYesMaterial;
- }
-
- public static Boolean getToggleItemOffOrNoBase64() {
- return toggleItemOffOrNoBase64;
- }
-
- public static String getToggleItemOffOrNoBase64Value() {
- return toggleItemOffOrNoBase64Value;
- }
-
- public static String getToggleItemOffOrNoMaterial() {
- return toggleItemOffOrNoMaterial;
- }
-
- public static String getTogglePermTrue() {
- return togglePermTrue;
- }
-
- public static String getTogglePermFalse() {
- return togglePermFalse;
- }
-
- public static String getPlaceholderTrue() {
- return placeholderTrue;
- }
-
- public static String getPlaceholderFalse() {
- return placeholderFalse;
- }
-
- public static Boolean getSound_Enable() {
- return Sound_Enable;
- }
-
- public static Boolean getSound_OpenInventory_Enable() {
- return Sound_OpenInventory_Enable;
- }
-
- public static Sound getSound_OpenInventory() {
- return Sound_OpenInventory;
- }
-
- public static String getSound_OpenInventory_input() {
- return Sound_OpenInventory_input;
- }
-
- public static Boolean getSound_Click_Enable() {
- return Sound_Click_Enable;
- }
-
- public static Sound getSound_Click() {
- return Sound_Click;
- }
-
- public static String getSound_Click_input() {
- return Sound_Click_input;
- }
-
- public static Boolean getSound_NoMoney_Enable() {
- return Sound_NoMoney_Enable;
- }
-
- public static Sound getSound_NoMoney() {
- return Sound_NoMoney;
- }
-
- public static String getSound_NoMoney_input() {
- return Sound_NoMoney_input;
- }
-
- public static Boolean getSound_NoInventorySpace_Enable() {
- return Sound_NoInventorySpace_Enable;
- }
-
- public static Sound getSound_NoInventorySpace() {
- return Sound_NoInventorySpace;
- }
-
- public static String getSound_NoInventorySpace_input() {
- return Sound_NoInventorySpace_input;
- }
-
- public static Boolean getSound_Give_Enable() {
- return Sound_Give_Enable;
- }
-
- public static Sound getSound_Give() {
- return Sound_Give;
- }
-
- public static String getSound_Give_input() {
- return Sound_Give_input;
- }
-
- public static Boolean getSound_PlayerNotFound_Enable() {
- return Sound_PlayerNotFound_Enable;
- }
-
- public static Sound getSound_PlayerNotFound() {
- return Sound_PlayerNotFound;
- }
-
- public static String getSound_PlayerNotFound_input() {
- return Sound_PlayerNotFound_input;
- }
-}
diff --git a/CommandGUI V2/src/main/java/net/t2code/commandguiv2/Spigot/config/configConverter/ConfigConverter.java b/CommandGUI V2/src/main/java/net/t2code/commandguiv2/Spigot/config/configConverter/ConfigConverter.java
deleted file mode 100644
index e55cc7d..0000000
--- a/CommandGUI V2/src/main/java/net/t2code/commandguiv2/Spigot/config/configConverter/ConfigConverter.java
+++ /dev/null
@@ -1,271 +0,0 @@
-package net.t2code.commandguiv2.Spigot.config.configConverter;
-
-import com.sun.org.apache.xpath.internal.operations.Bool;
-import net.t2code.commandguiv2.Spigot.Main;
-import net.t2code.commandguiv2.Spigot.config.functions.CreateFunctions;
-import net.t2code.commandguiv2.Spigot.enums.FunctionItemEnum;
-import net.t2code.commandguiv2.Spigot.enums.FunctionVoteEnum;
-import net.t2code.commandguiv2.Util;
-import net.t2code.t2codelib.SPIGOT.api.messages.T2C_Send;
-import net.t2code.t2codelib.SPIGOT.api.minecraftVersion.T2C_McVersion;
-import org.apache.commons.io.FileUtils;
-import org.bukkit.configuration.file.YamlConfiguration;
-
-import java.io.File;
-import java.io.IOException;
-import java.util.Arrays;
-import java.util.List;
-
-public class ConfigConverter {
-
- public static void removeBungeeOption() {
- File config = new File(Main.getPath(), "config.yml");
- YamlConfiguration yamlConfiguration = YamlConfiguration.loadConfiguration(config);
-
- yamlConfiguration.set("BungeeCord", null);
-
- try {
- yamlConfiguration.save(config);
- } catch (IOException e) {
- e.printStackTrace();
- }
-
- }
-
- public static void renameMainFolder() {
- if (new File("plugins/CommandGUI").exists() && !Main.getPath().exists()) {
- File oldF = new File("plugins/CommandGUI");
- File newF = new File("plugins/T2C-CommandGUI");
-
- if (oldF.renameTo(newF)) {
- T2C_Send.error(Main.getPlugin(), "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!");
- T2C_Send.error(Main.getPlugin(), "");
- T2C_Send.warning(Main.getPlugin(), "File renamed successfully");
- T2C_Send.warning(Main.getPlugin(), "The plugin folder has been renamed from 'CommandGUI' to 'T2C-CommandGUI");
- T2C_Send.error(Main.getPlugin(), "");
- T2C_Send.error(Main.getPlugin(), "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!");
- } else {
- T2C_Send.error(Main.getPlugin(), "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!");
- T2C_Send.error(Main.getPlugin(), "");
- T2C_Send.error(Main.getPlugin(), "Failed to rename file");
- T2C_Send.error(Main.getPlugin(), "An error occurred while renaming the plugin folder from 'CommandGUI' to 'T2C-CommandGUI'! Please report on our Discord: " + Util.getDiscord());
- T2C_Send.error(Main.getPlugin(), "");
- T2C_Send.error(Main.getPlugin(), "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!");
- }
- }
- }
-
- public static void noPermLore(YamlConfiguration yamlConfiguration, File config) {
- yamlConfiguration.set("Slots.Function.NoPermission.Message.Enable", true);
- yamlConfiguration.set("Slots.Function.NoPermission.Message.CustomNoPermMessage", "");
- yamlConfiguration.set("Slots.Function.NoPermission.Item.Lore.Enable", true);
- yamlConfiguration.set("Slots.Function.NoPermission.Item.Lore.Lore", Arrays.asList("&8-----------------", "&4No Permission for this Function", "&8-----------------"));
- try {
- yamlConfiguration.save(config);
- } catch (IOException e) {
- e.printStackTrace();
- }
- T2C_Send.error(Main.getPlugin(), "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!");
- T2C_Send.error(Main.getPlugin(), "");
- T2C_Send.warning(Main.getPlugin(), "'Slots.Function.NoPermission.Message.Enable' was added to the function " + config.getName() + "!");
- T2C_Send.warning(Main.getPlugin(), "'Slots.Function.NoPermission.Message.CustomNoPermMessage' was added to the function " + config.getName() + "!");
- T2C_Send.warning(Main.getPlugin(), "'Slots.Function.NoPermission.Item.Lore.Enable' was added to the function " + config.getName() + "!");
- T2C_Send.warning(Main.getPlugin(), "'Slots.Function.NoPermission.Item.Lore.Lore' was added to the function " + config.getName() + "!");
- T2C_Send.error(Main.getPlugin(), "");
- T2C_Send.error(Main.getPlugin(), "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!");
- }
-
- public static void convert() {
- renameFolder();
- T2C_Send.console(Util.getPrefix() + " §7[§5ConfigConvert§7] §4----------------------");
- T2C_Send.console(Util.getPrefix() + " §7[§5ConfigConvert§7]");
- T2C_Send.console(Util.getPrefix() + " §7[§5ConfigConvert§7] §4Config conversion to the new config structure starts!");
- T2C_Send.console(Util.getPrefix() + " §7[§5ConfigConvert§7]");
- T2C_Send.console(Util.getPrefix() + " §7[§5ConfigConvert§7] §4----------------------");
- File f = new File(Main.getPath() + "/OldConfig/GUIs/Version4");
- File[] fileArray = f.listFiles();
-
- for (File configOld : fileArray) {
- String sub = configOld.getName().substring(configOld.getName().length() - 4);
- if (sub.equals(".yml")) {
- YamlConfiguration yamlConfigurationOld = YamlConfiguration.loadConfiguration(configOld);
-
- File config = new File(Main.getPath(), "GUIs/" + configOld.getName().replace(".yml", "") + ".yml");
- YamlConfiguration yamlConfiguration = YamlConfiguration.loadConfiguration(config);
-
- Boolean enable = yamlConfigurationOld.getBoolean("GUI.Enable");
- Integer lines = yamlConfigurationOld.getInt("GUI.Lines");
-
- String name = yamlConfigurationOld.getString("GUI.Name");
- Boolean fillItemEnable = yamlConfigurationOld.getBoolean("GUI.FillItem.Enable");
- String fillItem;
- if (T2C_McVersion.isMc1_8() || T2C_McVersion.isMc1_9() || T2C_McVersion.isMc1_10() || T2C_McVersion.isMc1_11() || T2C_McVersion.isMc1_12()) {
- fillItem = yamlConfigurationOld.getString("GUI.FillItem.GlassPaneColor");
- } else fillItem = yamlConfigurationOld.getString("GUI.FillItem.Item");
-
- Boolean alias = yamlConfigurationOld.getBoolean("Command.Alias");
- Boolean aliasPerm = yamlConfigurationOld.getBoolean("Command.Permission.Required");
-
- setNew(enable, lines, name, fillItemEnable, fillItem, alias, aliasPerm, yamlConfiguration);
-
- for (String key : yamlConfigurationOld.getConfigurationSection("Slots").getKeys(false)) {
- Integer slotNumber = yamlConfigurationOld.getInt("Slots." + key + ".Slot");
- Boolean slotEnable = yamlConfigurationOld.getBoolean("Slots." + key + ".Enable");
- Boolean permRequired = yamlConfigurationOld.getBoolean("Slots." + key + ".Permission.Required");
-
- Boolean empty = yamlConfigurationOld.getBoolean("Slots." + key + ".Item.Empty");
- Integer itemAmount = yamlConfigurationOld.getInt("Slots." + key + ".Item.Amount");
- Boolean playerHeadEnable = yamlConfigurationOld.getBoolean("Slots." + key + ".Item.PlayerHead.Enable");
- Boolean base64Enable = yamlConfigurationOld.getBoolean("Slots." + key + ".Item.PlayerHead.Base64.Enable");
- String base64Value = yamlConfigurationOld.getString("Slots." + key + ".Item.PlayerHead.Base64.Base64Value");
- Boolean playerWhoHasOpenedTheGUI = yamlConfigurationOld.getBoolean("Slots." + key + ".Item.PlayerHead.PlayerWhoHasOpenedTheGUI");
- String playerName = yamlConfigurationOld.getString("Slots." + key + ".Item.PlayerHead.PlayerName");
- String itemMaterial = yamlConfigurationOld.getString("Slots." + key + ".Item.Material");
- String itemName = yamlConfigurationOld.getString("Slots." + key + ".Item.Name");
- List lore = yamlConfigurationOld.getStringList("Slots." + key + ".Item.Lore");
- Boolean customSoundEnable = yamlConfigurationOld.getBoolean("Slots." + key + ".CustomSound.Enable");
- Boolean customSoundNoSound = yamlConfigurationOld.getBoolean("Slots." + key + ".CustomSound.NoSound");
- String customSoundSound = yamlConfigurationOld.getString("Slots." + key + ".CustomSound.Sound");
- Boolean costEnable = yamlConfigurationOld.getBoolean("Slots." + key + ".Cost.Enable");
- Double price = yamlConfigurationOld.getDouble("Slots." + key + ".Cost.Price");
- Boolean commandEnable = yamlConfigurationOld.getBoolean("Slots." + key + ".Command.Enable");
- Boolean commandBungeeCommand = yamlConfigurationOld.getBoolean("Slots." + key + ".Command.BungeeCommand");
- Boolean commandAsConsole = yamlConfigurationOld.getBoolean("Slots." + key + ".Command.CommandAsConsole");
- List command = yamlConfigurationOld.getStringList("Slots." + key + ".Command.Command");
- Boolean serverChange = yamlConfigurationOld.getBoolean("Slots." + key + ".ServerChange.Enable");
- String serverChangeServer = yamlConfigurationOld.getString("Slots." + key + ".ServerChange.Server");
- Boolean openGUIEnable = yamlConfigurationOld.getBoolean("Slots." + key + ".OpenGUI.Enable");
- String openGUI = yamlConfigurationOld.getString("Slots." + key + ".OpenGUI.GUI");
- Boolean closeGUI = yamlConfiguration.getBoolean("Slots.Function.CloseGUI.Enable");
- Boolean togglePermission = yamlConfigurationOld.getBoolean("Slots." + key + ".Toggle.Permission.Enable");
- String togglePermissionPerm = yamlConfigurationOld.getString("Slots." + key + ".Toggle.Permission.Permission");
- Boolean toggleUseItem = yamlConfigurationOld.getBoolean("Slots." + key + ".Toggle.UseItem.Enable");
- Boolean messageEnable = yamlConfigurationOld.getBoolean("Slots." + key + ".Message.Enable");
- List message = yamlConfigurationOld.getStringList("Slots." + key + ".Message.Message");
- Boolean setConfigEnable = yamlConfigurationOld.getBoolean("Slots." + key + ".SetConfig.Enable");
- String configFilePath = yamlConfigurationOld.getString("Slots." + key + ".SetConfig.File.Path");
- String configOptionPath = yamlConfigurationOld.getString("Slots." + key + ".SetConfig.Option.Path");
- String configOptionPremat = yamlConfigurationOld.getString("Slots." + key + ".SetConfig.Option.Premat");
-
- String configStringValueLeft = yamlConfigurationOld.getString("Slots." + key + ".SetConfig.Value.LeftClick.String");
- Boolean configBooleanValueLeft = yamlConfigurationOld.getBoolean("Slots." + key + ".SetConfig.Value.LeftClick.Boolean");
- Integer configIntegerValueLeft = yamlConfigurationOld.getInt("Slots." + key + ".SetConfig.Value.LeftClick.Integer");
- Double configDoubleValueLeft = yamlConfigurationOld.getDouble("Slots." + key + ".SetConfig.Value.LeftClick.Double");
- List configListValueLeft = yamlConfigurationOld.getStringList("Slots." + key + ".SetConfig.Value.LeftClick.List");
-
- String configStringValueRight = yamlConfigurationOld.getString("Slots." + key + ".SetConfig.Value.RightClick.String");
- Boolean configBooleanValueRight = yamlConfigurationOld.getBoolean("Slots." + key + ".SetConfig.Value.RightClick.Boolean");
- Integer configIntegerValueRight = yamlConfigurationOld.getInt("Slots." + key + ".SetConfig.Value.RightClick.Integer");
- Double configDoubleValueRight = yamlConfigurationOld.getDouble("Slots." + key + ".SetConfig.Value.RightClick.Double");
- List configListValueRight = yamlConfigurationOld.getStringList("Slots." + key + ".SetConfig.RightClick.Value.List");
-
- Boolean pluginReloadEnable = yamlConfigurationOld.getBoolean("Slots." + key + ".SetConfig.PluginReload.Enable");
- String pluginReloadCommand = yamlConfigurationOld.getString("Slots." + key + ".SetConfig.PluginReload.Command");
-
- setNew(key, slotNumber, slotEnable, key, permRequired, yamlConfiguration);
- CreateFunctions.createFunction(key, empty, itemAmount, playerHeadEnable, base64Enable, base64Value, playerWhoHasOpenedTheGUI, playerName, itemMaterial, itemName, lore,
- true, "", true, Arrays.asList("&8-----------------", "&4No Permission for this Function", "&8-----------------"),
- customSoundEnable, customSoundNoSound, customSoundSound, costEnable, "vault", "DIRT;5", 0, price, commandEnable, commandBungeeCommand, commandAsConsole, command, serverChange,
- serverChangeServer, openGUIEnable, openGUI,closeGUI, togglePermission, togglePermissionPerm, toggleUseItem, messageEnable, message, setConfigEnable, configFilePath,
- configOptionPath, configOptionPremat, configStringValueLeft, configBooleanValueLeft, configIntegerValueLeft, configDoubleValueLeft, configListValueLeft,
- configStringValueRight, configBooleanValueRight, configIntegerValueRight, configDoubleValueRight, configListValueRight, pluginReloadEnable, pluginReloadCommand,
- false, FunctionVoteEnum.ADD, 0, false, FunctionItemEnum.REMOVE, "DIRT;5");
- }
-
- try {
- yamlConfiguration.save(config);
- } catch (IOException e) {
- e.printStackTrace();
- }
- }
- }
- T2C_Send.console(Util.getPrefix() + " §7[§5ConfigConvert§7] §4----------------------");
- T2C_Send.console(Util.getPrefix() + " §7[§5ConfigConvert§7]");
- T2C_Send.console(Util.getPrefix() + " §7[§5ConfigConvert§7] §4The conversion to the new config structure is completed!");
- T2C_Send.console(Util.getPrefix() + " §7[§5ConfigConvert§7]");
- T2C_Send.console(Util.getPrefix() + " §7[§5ConfigConvert§7] §4----------------------");
- }
-
- private static void renameFolder() {
- File dir = new File(Main.getPath() + "/GUIs");
- File newDir = new File(Main.getPath() + "/OldConfig/GUIs/Version4");
-
- try {
- FileUtils.moveDirectory(dir, newDir);
- } catch (IOException e) {
- e.printStackTrace();
- }
- }
-
- private static void setNew(Boolean enable, Integer lines, String name, Boolean fillItemEnable, String fillItem, Boolean alias, Boolean aliasPerm, YamlConfiguration yamlConfiguration) {
- set("GUI.Enable", enable, yamlConfiguration);
- set("GUI.Lines", lines, yamlConfiguration);
- set("GUI.Name", name, yamlConfiguration);
- set("GUI.FillItem.Enable", fillItemEnable, yamlConfiguration);
- if (T2C_McVersion.isMc1_8() || T2C_McVersion.isMc1_9() || T2C_McVersion.isMc1_10() || T2C_McVersion.isMc1_11() || T2C_McVersion.isMc1_12()) {
- set("GUI.FillItem.GlassPaneColor", fillItem, yamlConfiguration);
- } else set("GUI.FillItem.Item", fillItem, yamlConfiguration);
-
- set("Command.Alias", alias, yamlConfiguration);
- set("Command.Permission.Required", aliasPerm, yamlConfiguration);
- }
-
- private static void setNew(String key, Integer slotNumber, Boolean slotEnable, String function, Boolean permRequired, YamlConfiguration yamlConfiguration) {
- set("Slots." + key + ".Slot", slotNumber, yamlConfiguration);
- set("Slots." + key + ".Enable", slotEnable, yamlConfiguration);
- set("Slots." + key + ".Function", function, yamlConfiguration);
- set("Slots." + key + ".Permission.Required", permRequired, yamlConfiguration);
- set("Slots." + key + ".Permission.See", "commandgui.gui.[function].slot.[slot].see", yamlConfiguration);
- set("Slots." + key + ".Permission.Use", "commandgui.gui.[function].slot.[slot].use", yamlConfiguration);
- }
-
- 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);
- }
- }
-
- public static void convert7() {
- T2C_Send.console(Util.getPrefix() + " §7[§5ConfigConvert§7] §4----------------------");
- T2C_Send.console(Util.getPrefix() + " §7[§5ConfigConvert§7]");
- T2C_Send.console(Util.getPrefix() + " §7[§5ConfigConvert§7] §4Config conversion to the new config structure starts!");
- T2C_Send.console(Util.getPrefix() + " §7[§5ConfigConvert§7]");
- T2C_Send.console(Util.getPrefix() + " §7[§5ConfigConvert§7] §4----------------------");
-
- File f = new File(Main.getPath() + "/Functions/");
- File[] fileArray = f.listFiles();
-
- for (File config : fileArray) {
- if (config.getName().equals("functionDeclaration.yml")) continue;
- String sub = config.getName().substring(config.getName().length() - 4);
- if (sub.equals(".yml")) {
- YamlConfiguration yamlConfiguration = YamlConfiguration.loadConfiguration(config);
-
- yamlConfiguration.set("Slots.Function.CloseGUI.Enable",false);
-
- try {
- yamlConfiguration.save(config);
- } catch (IOException e) {
- e.printStackTrace();
- }
- }
- }
- T2C_Send.console(Util.getPrefix() + " §7[§5ConfigConvert§7] §4----------------------");
- T2C_Send.console(Util.getPrefix() + " §7[§5ConfigConvert§7]");
- T2C_Send.console(Util.getPrefix() + " §7[§5ConfigConvert§7] §4The conversion to the new config structure is completed!");
- T2C_Send.console(Util.getPrefix() + " §7[§5ConfigConvert§7]");
- T2C_Send.console(Util.getPrefix() + " §7[§5ConfigConvert§7] §4----------------------");
- }
-}
diff --git a/CommandGUI V2/src/main/java/net/t2code/commandguiv2/Spigot/config/functions/CreateFunctions.java b/CommandGUI V2/src/main/java/net/t2code/commandguiv2/Spigot/config/functions/CreateFunctions.java
deleted file mode 100644
index 004c7ce..0000000
--- a/CommandGUI V2/src/main/java/net/t2code/commandguiv2/Spigot/config/functions/CreateFunctions.java
+++ /dev/null
@@ -1,176 +0,0 @@
-package net.t2code.commandguiv2.Spigot.config.functions;
-
-import net.t2code.commandguiv2.Spigot.Main;
-import net.t2code.commandguiv2.Spigot.enums.FunctionItemEnum;
-import net.t2code.commandguiv2.Spigot.enums.FunctionVoteEnum;
-import net.t2code.commandguiv2.Util;
-import net.t2code.t2codelib.SPIGOT.api.messages.T2C_Send;
-import net.t2code.t2codelib.SPIGOT.system.T2CodeLibMain;
-import org.bukkit.configuration.file.YamlConfiguration;
-
-import java.io.File;
-import java.io.IOException;
-import java.util.Arrays;
-import java.util.List;
-
-public class CreateFunctions {
- public static void create() {
- createFunction("UseItem", false, 1, false, false, "", false, "", "",
- "&6Toggle UseItem", Arrays.asList("&bYou currently have the UseItem set to: %commandgui_useitem%"), true, "", true,
- Arrays.asList("&8-----------------", "&4No Permission for this Function", "&8-----------------"), false, false,
- "", false, "VAULT", "DIRT;5", 0, 0.0, false, false, false, Arrays.asList(), false,
- "", false, "", false, false, "", true, true,
- Arrays.asList("&bYour UseItem was set to: %commandgui_useitem%&b."), false, "", "", "String",
- "", false, 0, 0.0, Arrays.asList(), "", false,
- 0, 0.0, Arrays.asList(), false, "",
- false, FunctionVoteEnum.ADD, 0, false, FunctionItemEnum.REMOVE, "DIRT;5");
-
-
- List dclist;
- if (T2CodeLibMain.getMmIsLoad()) {
- dclist = Arrays.asList("[T2Code] http://dc.t2code.net'>You can find more information on Discord");
- } else dclist = Arrays.asList("&6You can find more information on Discord: &ehttp://dc.t2code.net");
-
-
- createFunction("SupportDiscord", false, 1, true, true, "eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvNzg3M2MxMmJmZmI1MjUxYTBiODhkNWFlNzVjNzI0N2NiMzlhNzVmZjFhODFjYmU0YzhhMzliMzExZGRlZGEifX19",
- false, "", "",
- "&3Support Discord", 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"),
- true, "", true, Arrays.asList("&8-----------------", "&4No Permission for this Function", "&8-----------------"),
- false, false, "", false, "VAULT", "DIRT;5", 0, 0.0, false, false,
- false, Arrays.asList(), false, "", false, "", false, false, "",
- false, true, dclist, false, "",
- "", "String", "", false, 0, 0.0, Arrays.asList(),
- "", false, 0, 0.0, Arrays.asList(), false, "",
- false, FunctionVoteEnum.ADD, 0, false, FunctionItemEnum.REMOVE, "DIRT;5");
- }
-
- public static void createFunction(String fileName, Boolean empty, Integer itemAmount, Boolean playerHeadEnable, Boolean base64Enable, String base64Value, Boolean playerWhoHasOpenedTheGUI,
- String playerName, String itemMaterial, String name, List lore, Boolean noPermMessageEnable, String customNoPermMessage, Boolean noPermLoreEnable, List noPermLore, Boolean customSoundEnable, Boolean customSoundNoSound, String customSoundSound,
- Boolean costEnable, String ecoModule, String ecoItem, Integer ecoVotePoints, Double ecoPrice, Boolean commandEnable, Boolean commandBungeeCommand,
- Boolean commandAsConsole, List command, Boolean serverChange, String serverChangeServer, Boolean openGUIEnable, String openGUI, Boolean closeGUI,
- Boolean togglePermission, String togglePermissionPerm, Boolean toggleUseItem, Boolean messageEnable, List message, Boolean setConfigEnable,
- String configFilePath, String configOptionPath, String configOptionPremat, String configStringValueLeft, Boolean configBooleanValueLeft,
- Integer configIntegerValueLeft, Double configDoubleValueLeft, List configListValueLeft, String configStringValueRight,
- Boolean configBooleanValueRight, Integer configIntegerValueRight, Double configDoubleValueRight, List configListValueRight,
- Boolean pluginReloadEnable, String pluginReloadCommand, Boolean functionVotePoints, FunctionVoteEnum functionVotePointsMode,
- Integer functionVotePointsAmount, Boolean functionItem, FunctionItemEnum functionItemMode, String functionItemItem) {
- long long_ = System.currentTimeMillis();
-
- File config = new File(Main.getPath(), "Functions/" + fileName + ".yml");
- int i = 1;
- while (config.exists()) {
- config = new File(Main.getPath(), "Functions/" + fileName + "-" + i + ".yml");
- i++;
- }
-
- T2C_Send.console(Util.getPrefix() + " §4Function GUI file (Functions/" + config.getName() + ") is loaded...");
-
- YamlConfiguration yamlConfiguration = YamlConfiguration.loadConfiguration(config);
-
- set("Slots.Function.Item.Empty", empty, yamlConfiguration);
- set("Slots.Function.Item.Amount", itemAmount, yamlConfiguration);
- // if (!(MCVersion.minecraft1_8 || MCVersion.minecraft1_9 || MCVersion.minecraft1_10 || MCVersion.minecraft1_11 || MCVersion.minecraft1_12)) {
- set("Slots.Function.Item.PlayerHead.Enable", playerHeadEnable, yamlConfiguration);
- set("Slots.Function.Item.PlayerHead.Base64.Enable", base64Enable, yamlConfiguration);
- set("Slots.Function.Item.PlayerHead.Base64.Base64Value", base64Value, yamlConfiguration);
- set("Slots.Function.Item.PlayerHead.PlayerWhoHasOpenedTheGUI", playerWhoHasOpenedTheGUI, yamlConfiguration);
- set("Slots.Function.Item.PlayerHead.PlayerName", playerName, yamlConfiguration);
- // }
- set("Slots.Function.Item.Material", itemMaterial == null ? "" : itemMaterial, yamlConfiguration);
- set("Slots.Function.Item.Name", name == null ? "" : name, yamlConfiguration);
- set("Slots.Function.Item.Lore", lore, yamlConfiguration);
- set("Slots.Function.NoPermission.Message.Enable", noPermMessageEnable, yamlConfiguration);
- set("Slots.Function.NoPermission.Message.CustomNoPermMessage", customNoPermMessage, yamlConfiguration);
- set("Slots.Function.NoPermission.Item.Lore.Enable", noPermLoreEnable, yamlConfiguration);
- set("Slots.Function.NoPermission.Item.Lore.Lore", noPermLore, yamlConfiguration);
- set("Slots.Function.CustomSound.Enable", customSoundEnable, yamlConfiguration);
- set("Slots.Function.CustomSound.NoSound", customSoundNoSound, yamlConfiguration);
- set("Slots.Function.CustomSound.Sound", customSoundSound == null ? "" : customSoundSound, yamlConfiguration);
- set("Slots.Function.Cost.Enable", costEnable, yamlConfiguration);
- set("Slots.Function.Cost.EcoModule", ecoModule, yamlConfiguration);
- set("Slots.Function.Cost.Item", ecoItem, yamlConfiguration);
- set("Slots.Function.Cost.VotePoints", ecoVotePoints, yamlConfiguration);
- set("Slots.Function.Cost.Price", ecoPrice, yamlConfiguration);
- set("Slots.Function.Command.Enable", commandEnable, yamlConfiguration);
- set("Slots.Function.Command.BungeeCommand", commandBungeeCommand, yamlConfiguration);
- set("Slots.Function.Command.CommandAsConsole", commandAsConsole, yamlConfiguration);
- set("Slots.Function.Command.Command", command, yamlConfiguration);
- set("Slots.Function.ServerChange.Enable", serverChange, yamlConfiguration);
- set("Slots.Function.ServerChange.Server", serverChangeServer == null ? "" : serverChangeServer, yamlConfiguration);
- set("Slots.Function.OpenGUI.Enable", openGUIEnable, yamlConfiguration);
- set("Slots.Function.OpenGUI.GUI", openGUI == null ? "" : openGUI, yamlConfiguration);
- set("Slots.Function.CloseGUI.Enable", closeGUI, yamlConfiguration);
-
- set("Slots.Function.Toggle.Permission.Enable", togglePermission, yamlConfiguration);
- set("Slots.Function.Toggle.Permission.Permission", togglePermissionPerm == null ? "" : togglePermissionPerm, yamlConfiguration);
- set("Slots.Function.Toggle.UseItem.Enable", toggleUseItem, yamlConfiguration);
-
- set("Slots.Function.Message.Enable", messageEnable, yamlConfiguration);
- set("Slots.Function.Message.Message", message, yamlConfiguration);
-
- set("Slots.Function.SetConfig.Enable", setConfigEnable, yamlConfiguration);
- set("Slots.Function.SetConfig.File.Path", configFilePath == null ? "" : configFilePath, yamlConfiguration);
- set("Slots.Function.SetConfig.Option.Path", configOptionPath == null ? "" : configOptionPath, yamlConfiguration);
- set("Slots.Function.SetConfig.Option.Premat", configOptionPremat == null ? "" : configOptionPremat, yamlConfiguration);
- set("Slots.Function.SetConfig.Value.LeftClick.String", configStringValueLeft == null ? "" : configStringValueLeft, yamlConfiguration);
- set("Slots.Function.SetConfig.Value.LeftClick.Boolean", configBooleanValueLeft, yamlConfiguration);
- set("Slots.Function.SetConfig.Value.LeftClick.Integer", configIntegerValueLeft, yamlConfiguration);
- set("Slots.Function.SetConfig.Value.LeftClick.Double", configDoubleValueLeft, yamlConfiguration);
- set("Slots.Function.SetConfig.Value.LeftClick.List", configListValueLeft, yamlConfiguration);
- set("Slots.Function.SetConfig.Value.RightClick.String", configStringValueRight == null ? "" : configStringValueRight, yamlConfiguration);
- set("Slots.Function.SetConfig.Value.RightClick.Boolean", configBooleanValueRight, yamlConfiguration);
- set("Slots.Function.SetConfig.Value.RightClick.Integer", configIntegerValueRight, yamlConfiguration);
- set("Slots.Function.SetConfig.Value.RightClick.Double", configDoubleValueRight, yamlConfiguration);
- set("Slots.Function.SetConfig.Value.RightClick.List", configListValueRight, yamlConfiguration);
- set("Slots.Function.SetConfig.PluginReload.Enable", pluginReloadEnable, yamlConfiguration);
- set("Slots.Function.SetConfig.PluginReload.Command", pluginReloadCommand == null ? "" : pluginReloadCommand, yamlConfiguration);
-
- set("Slots.Function.FunctionVotePoints.Enable", functionVotePoints, yamlConfiguration);
- set("Slots.Function.FunctionVotePoints.Mode", functionVotePointsMode.toString(), yamlConfiguration);
- set("Slots.Function.FunctionVotePoints.Amount", functionVotePointsAmount, yamlConfiguration);
-
- set("Slots.Function.FunctionItem.Enable", functionItem, yamlConfiguration);
- set("Slots.Function.FunctionItem.Mode", functionItemMode.toString(), yamlConfiguration);
- set("Slots.Function.FunctionItem.Item", functionItemItem, yamlConfiguration);
-
- try {
- yamlConfiguration.save(config);
- } catch (IOException e) {
- e.printStackTrace();
- }
- T2C_Send.console(Util.getPrefix() + " §2Function file (Functions/" + config.getName() + ") was loaded." + " §7- §e" + (System.currentTimeMillis() - long_) + "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);
- }
- }
-}
diff --git a/CommandGUI V2/src/main/java/net/t2code/commandguiv2/Spigot/config/functions/FunctionsFile.java b/CommandGUI V2/src/main/java/net/t2code/commandguiv2/Spigot/config/functions/FunctionsFile.java
new file mode 100644
index 0000000..ed5e66d
--- /dev/null
+++ b/CommandGUI V2/src/main/java/net/t2code/commandguiv2/Spigot/config/functions/FunctionsFile.java
@@ -0,0 +1,676 @@
+// This class was created by JaTiTV.
+
+package net.t2code.commandguiv2.Spigot.config.functions;
+
+import net.t2code.commandguiv2.Spigot.Main;
+import net.t2code.commandguiv2.Spigot.config.config.Config;
+import net.t2code.commandguiv2.Spigot.enums.EcoEnum;
+import net.t2code.commandguiv2.Spigot.enums.FunctionItemEnum;
+import net.t2code.commandguiv2.Spigot.enums.FunctionVoteEnum;
+import net.t2code.commandguiv2.Spigot.objects.Function;
+import net.t2code.commandguiv2.Util;
+import net.t2code.t2codelib.SPIGOT.api.messages.T2C_Send;
+import net.t2code.t2codelib.SPIGOT.api.yaml.T2C_ConfigWriter;
+import net.t2code.t2codelib.SPIGOT.system.T2C_Main;
+import net.t2code.t2codelib.util.T2C_ConfigItem;
+import net.t2code.t2codelib.util.T2C_LanguageEnum;
+
+import java.io.File;
+import java.util.Arrays;
+import java.util.HashMap;
+import java.util.List;
+
+public class FunctionsFile {
+ public enum VALUES implements T2C_ConfigItem {
+ empty("Slots.Function.Item.Empty", null, true,
+ new HashMap<>() {
+ {
+ put(T2C_LanguageEnum.german, List.of());
+ put(T2C_LanguageEnum.english, List.of());
+ }
+ }),
+ itemAmount("Slots.Function.Item.Amount", null, true,
+ new HashMap<>() {
+ {
+ put(T2C_LanguageEnum.german, List.of());
+ put(T2C_LanguageEnum.english, List.of());
+ }
+ }),
+ playerHeadEnable("Slots.Function.Item.PlayerHead.Enable", null, true,
+ new HashMap<>() {
+ {
+ put(T2C_LanguageEnum.german, List.of());
+ put(T2C_LanguageEnum.english, List.of());
+ }
+ }),
+ base64Enable("Slots.Function.Item.PlayerHead.Base64.Enable", null, true,
+ new HashMap<>() {
+ {
+ put(T2C_LanguageEnum.german, List.of());
+ put(T2C_LanguageEnum.english, List.of());
+ }
+ }),
+ base64Value("Slots.Function.Item.PlayerHead.Base64.Base64Value", null, true,
+ new HashMap<>() {
+ {
+ put(T2C_LanguageEnum.german, List.of());
+ put(T2C_LanguageEnum.english, List.of());
+ }
+ }),
+ playerWhoHasOpenedTheGUI("Slots.Function.Item.PlayerHead.PlayerWhoHasOpenedTheGUI", null, true,
+ new HashMap<>() {
+ {
+ put(T2C_LanguageEnum.german, List.of());
+ put(T2C_LanguageEnum.english, List.of());
+ }
+ }),
+ playerName("Slots.Function.Item.PlayerHead.PlayerName", null, true,
+ new HashMap<>() {
+ {
+ put(T2C_LanguageEnum.german, List.of());
+ put(T2C_LanguageEnum.english, List.of());
+ }
+ }),
+ itemMaterial("Slots.Function.Item.Material", null, true,
+ new HashMap<>() {
+ {
+ put(T2C_LanguageEnum.german, List.of());
+ put(T2C_LanguageEnum.english, List.of());
+ }
+ }),
+ name("Slots.Function.Item.Name", null, true,
+ new HashMap<>() {
+ {
+ put(T2C_LanguageEnum.german, List.of());
+ put(T2C_LanguageEnum.english, List.of());
+ }
+ }),
+ lore("Slots.Function.Item.Lore", null, true,
+ new HashMap<>() {
+ {
+ put(T2C_LanguageEnum.german, List.of());
+ put(T2C_LanguageEnum.english, List.of());
+ }
+ }),
+
+ noPermMessageEnable("Slots.Function.NoPermission.Message.Enable", null, true,
+ new HashMap<>() {
+ {
+ put(T2C_LanguageEnum.german, List.of());
+ put(T2C_LanguageEnum.english, List.of());
+ }
+ }),
+ customNoPermMessage("Slots.Function.NoPermission.Message.CustomNoPermMessage", null, true,
+ new HashMap<>() {
+ {
+ put(T2C_LanguageEnum.german, List.of());
+ put(T2C_LanguageEnum.english, List.of());
+ }
+ }),
+ noPermLoreEnable("Slots.Function.NoPermission.Item.Lore.Enable", null, true,
+ new HashMap<>() {
+ {
+ put(T2C_LanguageEnum.german, List.of());
+ put(T2C_LanguageEnum.english, List.of());
+ }
+ }),
+ noPermLore("Slots.Function.NoPermission.Item.Lore.Lore", null, true,
+ new HashMap<>() {
+ {
+ put(T2C_LanguageEnum.german, List.of());
+ put(T2C_LanguageEnum.english, List.of());
+ }
+ }),
+ customSoundEnable("Slots.Function.CustomSound.Enable", null, true,
+ new HashMap<>() {
+ {
+ put(T2C_LanguageEnum.german, List.of());
+ put(T2C_LanguageEnum.english, List.of());
+ }
+ }),
+ customSoundNoSound("Slots.Function.CustomSound.NoSound", null, true,
+ new HashMap<>() {
+ {
+ put(T2C_LanguageEnum.german, List.of());
+ put(T2C_LanguageEnum.english, List.of());
+ }
+ }),
+ customSoundSound("Slots.Function.CustomSound.Sound", null, true,
+ new HashMap<>() {
+ {
+ put(T2C_LanguageEnum.german, List.of());
+ put(T2C_LanguageEnum.english, List.of());
+ }
+ }),
+ costEnable("Slots.Function.Cost.Enable", null, true,
+ new HashMap<>() {
+ {
+ put(T2C_LanguageEnum.german, List.of());
+ put(T2C_LanguageEnum.english, List.of());
+ }
+ }),
+ ecoModule("Slots.Function.Cost.EcoModule", null, true,
+ new HashMap<>() {
+ {
+ put(T2C_LanguageEnum.german, List.of());
+ put(T2C_LanguageEnum.english, List.of());
+ }
+ }),
+
+ ecoItem("Slots.Function.Cost.Item", null, true,
+ new HashMap<>() {
+ {
+ put(T2C_LanguageEnum.german, List.of());
+ put(T2C_LanguageEnum.english, List.of());
+ }
+ }),
+ ecoVotePoints("Slots.Function.Cost.VotePoints", null, true,
+ new HashMap<>() {
+ {
+ put(T2C_LanguageEnum.german, List.of());
+ put(T2C_LanguageEnum.english, List.of());
+ }
+ }),
+ ecoPrice("Slots.Function.Cost.Price", null, true,
+ new HashMap<>() {
+ {
+ put(T2C_LanguageEnum.german, List.of());
+ put(T2C_LanguageEnum.english, List.of());
+ }
+ }),
+ commandEnable("Slots.Function.Command.Enable", null, true,
+ new HashMap<>() {
+ {
+ put(T2C_LanguageEnum.german, List.of());
+ put(T2C_LanguageEnum.english, List.of());
+ }
+ }),
+ commandBungeeCommand("Slots.Function.Command.BungeeCommand", null, true,
+ new HashMap<>() {
+ {
+ put(T2C_LanguageEnum.german, List.of());
+ put(T2C_LanguageEnum.english, List.of());
+ }
+ }),
+ commandAsConsole("Slots.Function.Command.CommandAsConsole", null, true,
+ new HashMap<>() {
+ {
+ put(T2C_LanguageEnum.german, List.of());
+ put(T2C_LanguageEnum.english, List.of());
+ }
+ }),
+ command("Slots.Function.Command.Command", null, true,
+ new HashMap<>() {
+ {
+ put(T2C_LanguageEnum.german, List.of());
+ put(T2C_LanguageEnum.english, List.of());
+ }
+ }),
+ serverChange("Slots.Function.ServerChange.Enable", null, true,
+ new HashMap<>() {
+ {
+ put(T2C_LanguageEnum.german, List.of());
+ put(T2C_LanguageEnum.english, List.of());
+ }
+ }),
+ serverChangeServer("Slots.Function.ServerChange.Server", null, true,
+ new HashMap<>() {
+ {
+ put(T2C_LanguageEnum.german, List.of());
+ put(T2C_LanguageEnum.english, List.of());
+ }
+ }),
+ openGUIEnable("Slots.Function.OpenGUI.Enable", null, true,
+ new HashMap<>() {
+ {
+ put(T2C_LanguageEnum.german, List.of());
+ put(T2C_LanguageEnum.english, List.of());
+ }
+ }),
+ openGUI("Slots.Function.OpenGUI.GUI", null, true,
+ new HashMap<>() {
+ {
+ put(T2C_LanguageEnum.german, List.of());
+ put(T2C_LanguageEnum.english, List.of());
+ }
+ }),
+ closeGUI("Slots.Function.CloseGUI.Enable", null, true,
+ new HashMap<>() {
+ {
+ put(T2C_LanguageEnum.german, List.of());
+ put(T2C_LanguageEnum.english, List.of());
+ }
+ }),
+ togglePermission("Slots.Function.Toggle.Permission.Enable", null, true,
+ new HashMap<>() {
+ {
+ put(T2C_LanguageEnum.german, List.of());
+ put(T2C_LanguageEnum.english, List.of());
+ }
+ }),
+ togglePermissionPerm("Slots.Function.Toggle.Permission.Permission", null, true,
+ new HashMap<>() {
+ {
+ put(T2C_LanguageEnum.german, List.of());
+ put(T2C_LanguageEnum.english, List.of());
+ }
+ }),
+ toggleUseItem("Slots.Function.Toggle.UseItem.Enable", null, true,
+ new HashMap<>() {
+ {
+ put(T2C_LanguageEnum.german, List.of());
+ put(T2C_LanguageEnum.english, List.of());
+ }
+ }),
+ messageEnable("Slots.Function.Message.Enable", null, true,
+ new HashMap<>() {
+ {
+ put(T2C_LanguageEnum.german, List.of());
+ put(T2C_LanguageEnum.english, List.of());
+ }
+ }),
+ message("Slots.Function.Message.Message", null, true,
+ new HashMap<>() {
+ {
+ put(T2C_LanguageEnum.german, List.of());
+ put(T2C_LanguageEnum.english, List.of());
+ }
+ }),
+ setConfigEnable("Slots.Function.SetConfig.Enable", null, true,
+ new HashMap<>() {
+ {
+ put(T2C_LanguageEnum.german, List.of());
+ put(T2C_LanguageEnum.english, List.of());
+ }
+ }),
+ configFilePath("Slots.Function.SetConfig.File.Path", null, true,
+ new HashMap<>() {
+ {
+ put(T2C_LanguageEnum.german, List.of());
+ put(T2C_LanguageEnum.english, List.of());
+ }
+ }),
+ configOptionPath("Slots.Function.SetConfig.Option.Path", null, true,
+ new HashMap<>() {
+ {
+ put(T2C_LanguageEnum.german, List.of());
+ put(T2C_LanguageEnum.english, List.of());
+ }
+ }),
+ configOptionPremat("Slots.Function.SetConfig.Option.Premat", null, true,
+ new HashMap<>() {
+ {
+ put(T2C_LanguageEnum.german, List.of());
+ put(T2C_LanguageEnum.english, List.of());
+ }
+ }),
+
+
+ configStringValueLeft("Slots.Function.SetConfig.Value.LeftClick.String", null, true,
+ new HashMap<>() {
+ {
+ put(T2C_LanguageEnum.german, List.of());
+ put(T2C_LanguageEnum.english, List.of());
+ }
+ }),
+ configBooleanValueLeft("Slots.Function.SetConfig.Value.LeftClick.Boolean", null, true,
+ new HashMap<>() {
+ {
+ put(T2C_LanguageEnum.german, List.of());
+ put(T2C_LanguageEnum.english, List.of());
+ }
+ }),
+ configIntegerValueLeft("Slots.Function.SetConfig.Value.LeftClick.Integer", null, true,
+ new HashMap<>() {
+ {
+ put(T2C_LanguageEnum.german, List.of());
+ put(T2C_LanguageEnum.english, List.of());
+ }
+ }),
+ configDoubleValueLeft("Slots.Function.SetConfig.Value.LeftClick.Double", null, true,
+ new HashMap<>() {
+ {
+ put(T2C_LanguageEnum.german, List.of());
+ put(T2C_LanguageEnum.english, List.of());
+ }
+ }),
+ configListValueLeft("Slots.Function.SetConfig.Value.LeftClick.List", null, true,
+ new HashMap<>() {
+ {
+ put(T2C_LanguageEnum.german, List.of());
+ put(T2C_LanguageEnum.english, List.of());
+ }
+ }),
+
+ configStringValueRight("Slots.Function.SetConfig.Value.RightClick.String", null, true,
+ new HashMap<>() {
+ {
+ put(T2C_LanguageEnum.german, List.of());
+ put(T2C_LanguageEnum.english, List.of());
+ }
+ }),
+ configBooleanValueRight("Slots.Function.SetConfig.Value.RightClick.Boolean", null, true,
+ new HashMap<>() {
+ {
+ put(T2C_LanguageEnum.german, List.of());
+ put(T2C_LanguageEnum.english, List.of());
+ }
+ }),
+ configIntegerValueRight("Slots.Function.SetConfig.Value.RightClick.Integer", null, true,
+ new HashMap<>() {
+ {
+ put(T2C_LanguageEnum.german, List.of());
+ put(T2C_LanguageEnum.english, List.of());
+ }
+ }),
+ configDoubleValueRight("Slots.Function.SetConfig.Value.RightClick.Double", null, true,
+ new HashMap<>() {
+ {
+ put(T2C_LanguageEnum.german, List.of());
+ put(T2C_LanguageEnum.english, List.of());
+ }
+ }),
+ configListValueRight("Slots.Function.SetConfig.Value.RightClick.List", null, true,
+ new HashMap<>() {
+ {
+ put(T2C_LanguageEnum.german, List.of());
+ put(T2C_LanguageEnum.english, List.of());
+ }
+ }),
+
+
+ pluginReloadEnable("Slots.Function.SetConfig.PluginReload.Enable", null, true,
+ new HashMap<>() {
+ {
+ put(T2C_LanguageEnum.german, List.of());
+ put(T2C_LanguageEnum.english, List.of());
+ }
+ }),
+ pluginReloadCommand("Slots.Function.SetConfig.PluginReload.Command", null, true,
+ new HashMap<>() {
+ {
+ put(T2C_LanguageEnum.german, List.of());
+ put(T2C_LanguageEnum.english, List.of());
+ }
+ }),
+
+ functionVotePoints("Slots.Function.FunctionVotePoints.Enable", null, true,
+ new HashMap<>() {
+ {
+ put(T2C_LanguageEnum.german, List.of());
+ put(T2C_LanguageEnum.english, List.of());
+ }
+ }),
+
+
+ functionVotePointsMode("Slots.Function.FunctionVotePoints.Mode", null, true,
+ new HashMap<>() {
+ {
+ put(T2C_LanguageEnum.german, List.of());
+ put(T2C_LanguageEnum.english, List.of());
+ }
+ }),
+
+
+ functionVotePointsAmount("Slots.Function.FunctionVotePoints.Amount", null, true,
+ new HashMap<>() {
+ {
+ put(T2C_LanguageEnum.german, List.of());
+ put(T2C_LanguageEnum.english, List.of());
+ }
+ }),
+ functionItem("Slots.Function.FunctionItem.Enable", null, true,
+ new HashMap<>() {
+ {
+ put(T2C_LanguageEnum.german, List.of());
+ put(T2C_LanguageEnum.english, List.of());
+ }
+ }),
+
+
+ functionItemMode("Slots.Function.FunctionItem.Mode", null, true,
+ new HashMap<>() {
+ {
+ put(T2C_LanguageEnum.german, List.of());
+ put(T2C_LanguageEnum.english, List.of());
+ }
+ }),
+
+
+ functionItemItem("Slots.Function.FunctionItem.Item", null, true,
+ new HashMap<>() {
+ {
+ put(T2C_LanguageEnum.german, List.of());
+ put(T2C_LanguageEnum.english, List.of());
+ }
+ }),
+ ;
+
+
+ private final String path;
+ private Object value;
+ private final boolean forceSet;
+ private final HashMap> comments;
+
+ VALUES(String path, Object value, boolean forceSet, HashMap> comments) {
+ this.path = path;
+ this.value = value;
+ this.forceSet = forceSet;
+ this.comments = comments;
+ }
+
+ @Override
+ public String getPath() {
+ return path;
+ }
+
+ @Override
+ public Object getValue() {
+ return value;
+ }
+
+ @Override
+ public boolean getForceSet() {
+ return forceSet;
+ }
+
+ @Override
+ public HashMap> getComments() {
+ return comments;
+ }
+
+ @Override
+ public String getLanguagePath() {
+ return Config.VALUES.language.getValue().toString();
+ }
+
+ @Override
+ public void setValue(Object newValue) {
+ value = newValue;
+ }
+ }
+
+ public static void select(boolean isReload) {
+ Main.functionHashMap.clear();
+ File f = new File(Main.getPath() + "/Functions/");
+ File[] fileArray = f.listFiles();
+
+ assert fileArray != null;
+ for (File file : fileArray) {
+ String sub = file.getName().substring(file.getName().length() - 4);
+ if (sub.equals(".yml")) {
+
+ T2C_ConfigWriter.createConfig(Util.getPrefix(), file, VALUES.values(), isReload, Util.getConfigLogo());
+
+ EcoEnum ecoModule = null;
+ if (VALUES.ecoModule.value != null) {
+ try {
+ ecoModule = EcoEnum.valueOf(VALUES.ecoModule.value.toString().toUpperCase());
+ } catch (Exception ex) {
+ T2C_Send.error(Main.getPlugin(), "The EcoModule " + VALUES.ecoModule.value.toString().toUpperCase() + " in the function file "
+ + file.getName() + " does not exist. Please use one of the supported modules. (VAULT, ITEM, VOTEPOINTS)");
+ }
+ } else ecoModule = EcoEnum.VAULT;
+
+ FunctionVoteEnum functionVotePointsMode = null;
+ if (VALUES.functionVotePointsMode.value != null) {
+ try {
+ functionVotePointsMode = FunctionVoteEnum.valueOf(VALUES.functionVotePointsMode.value.toString().toUpperCase());
+ } catch (Exception ex) {
+ T2C_Send.error(Main.getPlugin(), "The VotePoints Mode " + VALUES.functionVotePointsMode.value.toString().toUpperCase() + " in the function file "
+ + file.getName() + " does not exist. Please use one of the supported modules. (ADD, REMOVE)");
+ }
+ }
+
+ FunctionItemEnum functionItemMode = null;
+ if (VALUES.functionItemMode.value != null) {
+ try {
+ functionItemMode = FunctionItemEnum.valueOf(VALUES.functionItemMode.value.toString().toUpperCase());
+ } catch (Exception ex) {
+ T2C_Send.error(Main.getPlugin(), "The Item Mode " + VALUES.functionItemMode.value.toString().toUpperCase() + " in the function file "
+ + f.getName() + " does not exist. Please use one of the supported modules. (ADD, REMOVE)");
+ }
+ }
+
+ Util.replace(VALUES.name);
+ Util.replace(VALUES.lore);
+ Util.replace(VALUES.noPermLore);
+ Util.replace(VALUES.message);
+
+ String key = file.getName().replace(".yml", "");
+ Function function = new Function(key, (boolean) VALUES.empty.value, (int) VALUES.itemAmount.value, (boolean) VALUES.playerHeadEnable.value, (boolean) VALUES.base64Enable.value,
+ VALUES.base64Value.value.toString(), (boolean) VALUES.playerWhoHasOpenedTheGUI.value, VALUES.playerName.value.toString(), VALUES.itemMaterial.value.toString(),
+ VALUES.name.value.toString(), (List) VALUES.lore.value, (boolean) VALUES.noPermMessageEnable.value, VALUES.customNoPermMessage.value.toString(),
+ (boolean) VALUES.noPermLoreEnable.value, (List) VALUES.noPermLore.value, (boolean) VALUES.customSoundEnable.value, (boolean) VALUES.customSoundNoSound.value,
+ VALUES.customSoundSound.value.toString(), (boolean) VALUES.costEnable.value, ecoModule, VALUES.ecoItem.value.toString(),
+ (int) VALUES.ecoVotePoints.value, (double) VALUES.ecoPrice.value, (boolean) VALUES.commandEnable.value, (boolean) VALUES.commandBungeeCommand.value,
+ (boolean) VALUES.commandAsConsole.value, (List) VALUES.command.value, (boolean) VALUES.serverChange.value, VALUES.serverChangeServer.value.toString(),
+ (boolean) VALUES.openGUIEnable.value, VALUES.openGUI.value.toString(), (boolean) VALUES.closeGUI.value, (boolean) VALUES.togglePermission.value,
+ VALUES.togglePermissionPerm.value.toString(), (boolean) VALUES.toggleUseItem.value, (boolean) VALUES.messageEnable.value, (List) VALUES.message.value,
+ (boolean) VALUES.setConfigEnable.value, VALUES.configFilePath.value.toString(), VALUES.configOptionPath.value.toString(), VALUES.configOptionPremat.value.toString(),
+ VALUES.configStringValueLeft.value.toString(), (boolean) VALUES.configBooleanValueLeft.value, (int) VALUES.configIntegerValueLeft.value, (double) VALUES.configDoubleValueLeft.value,
+ (List) VALUES.configListValueLeft.value, VALUES.configStringValueRight.value.toString(), (boolean) VALUES.configBooleanValueRight.value, (int) VALUES.configIntegerValueRight.value,
+ (double) VALUES.configDoubleValueRight.value, (List) VALUES.configListValueRight.value, (boolean) VALUES.pluginReloadEnable.value, VALUES.pluginReloadCommand.value.toString(),
+ (boolean) VALUES.functionVotePoints.value, functionVotePointsMode, (int) VALUES.functionVotePointsAmount.value, (boolean) VALUES.functionItem.value,
+ functionItemMode, VALUES.functionItemItem.value.toString());
+ Main.functionHashMap.put(key, function);
+ }
+ }
+ }
+
+
+ public static void createDefault(boolean isReload) {
+ createFunction("useItem", isReload,false, 1, false, false, "", false, "", "",
+ "&6Toggle UseItem", List.of("&bYou currently have the UseItem set to: %commandgui_useitem%"), true, "", true,
+ List.of("&8-----------------", "&4No Permission for this Function", "&8-----------------"), false, false,
+ "", false, "VAULT", "DIRT;5", 0, 0.0, false, false, false, List.of(), false,
+ "", false, "", false, false, "", true, true,
+ List.of("&bYour UseItem was set to: %commandgui_useitem%&b."), false, "", "", "String",
+ "", false, 0, 0.0, List.of(), "", false,
+ 0, 0.0, List.of(), false, "",
+ false, FunctionVoteEnum.ADD, 0, false, FunctionItemEnum.REMOVE, "DIRT;5");
+
+
+ List dclist;
+ if (T2C_Main.getMmIsLoad()) {
+ dclist = List.of("[T2Code] http://dc.t2code.net'>You can find more information on Discord");
+ } else dclist = List.of("&6You can find more information on Discord: &ehttp://dc.t2code.net");
+
+
+ createFunction("supportDiscord",isReload, false, 1, true, true, "eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvNzg3M2MxMmJmZmI1MjUxYTBiODhkNWFlNzVjNzI0N2NiMzlhNzVmZjFhODFjYmU0YzhhMzliMzExZGRlZGEifX19",
+ false, "", "",
+ "&3Support Discord", List.of("&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"),
+ true, "", true, Arrays.asList("&8-----------------", "&4No Permission for this Function", "&8-----------------"),
+ false, false, "", false, "VAULT", "DIRT;5", 0, 0.0, false, false,
+ false, List.of(), false, "", false, "", false, false, "",
+ false, true, dclist, false, "",
+ "", "String", "", false, 0, 0.0, List.of(),
+ "", false, 0, 0.0, List.of(), false, "",
+ false, FunctionVoteEnum.ADD, 0, false, FunctionItemEnum.REMOVE, "DIRT;5");
+ }
+
+ private static void createFunction(String fileName, boolean isReload,Boolean empty, Integer itemAmount, Boolean playerHeadEnable, Boolean base64Enable, String base64Value, Boolean playerWhoHasOpenedTheGUI,
+ String playerName, String itemMaterial, String name, List lore, Boolean noPermMessageEnable, String customNoPermMessage, Boolean noPermLoreEnable, List noPermLore, Boolean customSoundEnable, Boolean customSoundNoSound, String customSoundSound,
+ Boolean costEnable, String ecoModule, String ecoItem, Integer ecoVotePoints, Double ecoPrice, Boolean commandEnable, Boolean commandBungeeCommand,
+ Boolean commandAsConsole, List command, Boolean serverChange, String serverChangeServer, Boolean openGUIEnable, String openGUI, Boolean closeGUI,
+ Boolean togglePermission, String togglePermissionPerm, Boolean toggleUseItem, Boolean messageEnable, List message, Boolean setConfigEnable,
+ String configFilePath, String configOptionPath, String configOptionPremat, String configStringValueLeft, Boolean configBooleanValueLeft,
+ Integer configIntegerValueLeft, Double configDoubleValueLeft, List configListValueLeft, String configStringValueRight,
+ Boolean configBooleanValueRight, Integer configIntegerValueRight, Double configDoubleValueRight, List configListValueRight,
+ Boolean pluginReloadEnable, String pluginReloadCommand, Boolean functionVotePoints, FunctionVoteEnum functionVotePointsMode,
+ Integer functionVotePointsAmount, Boolean functionItem, FunctionItemEnum functionItemMode, String functionItemItem) {
+ VALUES.empty.setValue(empty);
+ VALUES.itemAmount.setValue(itemAmount);
+ VALUES.playerHeadEnable.setValue(playerHeadEnable);
+ VALUES.base64Enable.setValue(base64Enable);
+ VALUES.base64Value.setValue(base64Value);
+ VALUES.playerWhoHasOpenedTheGUI.setValue(playerWhoHasOpenedTheGUI);
+ VALUES.playerName.setValue(playerName);
+ // }
+ VALUES.itemMaterial.setValue(itemMaterial == null ? "" : itemMaterial);
+ VALUES.name.setValue(name == null ? "" : name);
+ VALUES.lore.setValue(lore);
+ VALUES.noPermMessageEnable.setValue(noPermMessageEnable);
+ VALUES.customNoPermMessage.setValue(customNoPermMessage);
+ VALUES.noPermLoreEnable.setValue(noPermLoreEnable);
+ VALUES.noPermLore.setValue(noPermLore);
+ VALUES.customSoundEnable.setValue(customSoundEnable);
+ VALUES.customSoundNoSound.setValue(customSoundNoSound);
+ VALUES.customSoundSound.setValue(customSoundSound == null ? "" : customSoundSound);
+ VALUES.costEnable.setValue(costEnable);
+ VALUES.ecoModule.setValue(ecoModule);
+ VALUES.ecoItem.setValue(ecoItem);
+ VALUES.ecoVotePoints.setValue(ecoVotePoints);
+ VALUES.ecoPrice.setValue(ecoPrice);
+ VALUES.commandEnable.setValue(commandEnable);
+ VALUES.commandBungeeCommand.setValue(commandBungeeCommand);
+ VALUES.commandAsConsole.setValue(commandAsConsole);
+ VALUES.command.setValue(command);
+ VALUES.serverChange.setValue(serverChange);
+ VALUES.serverChangeServer.setValue(serverChangeServer == null ? "" : serverChangeServer);
+ VALUES.openGUIEnable.setValue(openGUIEnable);
+ VALUES.openGUI.setValue(openGUI == null ? "" : openGUI);
+ VALUES.closeGUI.setValue(closeGUI);
+
+ VALUES.togglePermission.setValue(togglePermission);
+ VALUES.togglePermissionPerm.setValue(togglePermissionPerm == null ? "" : togglePermissionPerm);
+ VALUES.toggleUseItem.setValue(toggleUseItem);
+
+ VALUES.messageEnable.setValue(messageEnable);
+ VALUES.message.setValue(message);
+
+ VALUES.setConfigEnable.setValue(setConfigEnable);
+ VALUES.configFilePath.setValue(configFilePath == null ? "" : configFilePath);
+ VALUES.configOptionPath.setValue(configOptionPath == null ? "" : configOptionPath);
+ VALUES.configOptionPremat.setValue(configOptionPremat == null ? "" : configOptionPremat);
+ VALUES.configStringValueLeft.setValue(configStringValueLeft == null ? "" : configStringValueLeft);
+ VALUES.configBooleanValueLeft.setValue(configBooleanValueLeft);
+ VALUES.configIntegerValueLeft.setValue(configIntegerValueLeft);
+ VALUES.configDoubleValueLeft.setValue(configDoubleValueLeft);
+ VALUES.configListValueLeft.setValue(configListValueLeft);
+ VALUES.configStringValueRight.setValue(configStringValueRight == null ? "" : configStringValueRight);
+ VALUES.configBooleanValueRight.setValue(configBooleanValueRight);
+ VALUES.configIntegerValueRight.setValue(configIntegerValueRight);
+ VALUES.configDoubleValueRight.setValue(configDoubleValueRight);
+ VALUES.configListValueRight.setValue(configListValueRight);
+ VALUES.pluginReloadEnable.setValue(pluginReloadEnable);
+ VALUES.pluginReloadCommand.setValue(pluginReloadCommand == null ? "" : pluginReloadCommand);
+
+ VALUES.functionVotePoints.setValue(functionVotePoints);
+ VALUES.functionVotePointsMode.setValue(functionVotePointsMode.toString());
+ VALUES.functionVotePointsAmount.setValue(functionVotePointsAmount);
+
+ VALUES.functionItem.setValue(functionItem);
+ VALUES.functionItemMode.setValue(functionItemMode.toString());
+ VALUES.functionItemItem.setValue(functionItemItem);
+
+ File file = new File(Main.getPath(), "Functions/" + fileName + ".yml");
+ int i = 1;
+ while (file.exists()) {
+ file = new File(Main.getPath(), "Functions/" + fileName + "-" + i + ".yml");
+ i++;
+ }
+ T2C_ConfigWriter.createConfig(Util.getPrefix(), file, VALUES.values(), isReload, Util.getConfigLogo());
+ }
+}
diff --git a/CommandGUI V2/src/main/java/net/t2code/commandguiv2/Spigot/config/gui/CreateGUI.java b/CommandGUI V2/src/main/java/net/t2code/commandguiv2/Spigot/config/gui/CreateGUI.java
deleted file mode 100644
index f8b6217..0000000
--- a/CommandGUI V2/src/main/java/net/t2code/commandguiv2/Spigot/config/gui/CreateGUI.java
+++ /dev/null
@@ -1,71 +0,0 @@
-package net.t2code.commandguiv2.Spigot.config.gui;
-
-import net.t2code.commandguiv2.Spigot.Main;
-import net.t2code.commandguiv2.Util;
-import net.t2code.t2codelib.SPIGOT.api.messages.T2C_Send;
-import net.t2code.t2codelib.SPIGOT.api.minecraftVersion.T2C_McVersion;
-import org.bukkit.configuration.file.YamlConfiguration;
-
-import java.io.File;
-import java.io.IOException;
-
-
-public class CreateGUI {
- public static void configCreate() {
- long long_ = System.currentTimeMillis();
- T2C_Send.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);
-
- set("GUI.Enable", true, yamlConfiguration);
- set("GUI.Lines", 1, yamlConfiguration);
- set("GUI.Name", "&5default &9GUI", yamlConfiguration);
- set("GUI.FillItem.Enable", true, yamlConfiguration);
- if (T2C_McVersion.isMc1_8() || T2C_McVersion.isMc1_9() || T2C_McVersion.isMc1_10() || T2C_McVersion.isMc1_11() || T2C_McVersion.isMc1_12()) {
- set("GUI.FillItem.GlassPaneColor", 15, yamlConfiguration);
- } else set("GUI.FillItem.Item", "BLACK_STAINED_GLASS_PANE", yamlConfiguration);
-
- set("Command.Alias", true, yamlConfiguration);
- set("Command.Permission.Required", true, yamlConfiguration);
-
- set("Slots.SupportDiscord.Slot", 4, yamlConfiguration);
- set("Slots.SupportDiscord.Enable", true, yamlConfiguration);
- set("Slots.SupportDiscord.Function", "SupportDiscord", yamlConfiguration);
- set("Slots.SupportDiscord.Permission.Required", false, yamlConfiguration);
- set("Slots.SupportDiscord.Permission.See", "commandgui.gui.[function].slot.[slot].see", yamlConfiguration);
- set("Slots.SupportDiscord.Permission.Use", "commandgui.gui.[function].slot.[slot].use", yamlConfiguration);
-
- set("Slots.UseItem.Slot", 6, yamlConfiguration);
- set("Slots.UseItem.Enable", true, yamlConfiguration);
- set("Slots.UseItem.Function", "UseItem", yamlConfiguration);
- set("Slots.UseItem.Permission.Required", false, yamlConfiguration);
- set("Slots.UseItem.Permission.See", "commandgui.gui.[function].slot.[slot].see", yamlConfiguration);
- set("Slots.UseItem.Permission.Use", "commandgui.gui.[function].slot.[slot].use", yamlConfiguration);
-
-
- try {
- yamlConfiguration.save(config);
- } catch (IOException e) {
- e.printStackTrace();
- }
- T2C_Send.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) {
- 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);
- }
- }
-}
diff --git a/CommandGUI V2/src/main/java/net/t2code/commandguiv2/Spigot/config/gui/GuiFile.java b/CommandGUI V2/src/main/java/net/t2code/commandguiv2/Spigot/config/gui/GuiFile.java
new file mode 100644
index 0000000..e5b80e6
--- /dev/null
+++ b/CommandGUI V2/src/main/java/net/t2code/commandguiv2/Spigot/config/gui/GuiFile.java
@@ -0,0 +1,245 @@
+// This class was created by JaTiTV.
+
+package net.t2code.commandguiv2.Spigot.config.gui;
+
+import net.t2code.commandguiv2.Spigot.Main;
+import net.t2code.commandguiv2.Spigot.cmdManagement.CmdExecuter_GUI;
+import net.t2code.commandguiv2.Spigot.config.config.Config;
+import net.t2code.commandguiv2.Spigot.objects.Function;
+import net.t2code.commandguiv2.Spigot.objects.Gui;
+import net.t2code.commandguiv2.Spigot.objects.Slot;
+import net.t2code.commandguiv2.Util;
+import net.t2code.t2codelib.SPIGOT.api.messages.T2C_Send;
+import net.t2code.t2codelib.SPIGOT.api.minecraftVersion.T2C_McVersion;
+import net.t2code.t2codelib.SPIGOT.api.yaml.T2C_ConfigWriter;
+import net.t2code.t2codelib.util.T2C_ConfigItem;
+import net.t2code.t2codelib.util.T2C_LanguageEnum;
+import org.bukkit.configuration.file.YamlConfiguration;
+
+import java.io.File;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+
+public class GuiFile {
+
+ public enum VALUES implements T2C_ConfigItem {
+
+ guiEnable("GUI.Enable", true, true,
+ new HashMap<>() {{
+ put(T2C_LanguageEnum.german, List.of());
+ put(T2C_LanguageEnum.english, List.of());
+ }}),
+ guiLines("GUI.Lines", 1, true,
+ new HashMap<>() {{
+ put(T2C_LanguageEnum.german, List.of());
+ put(T2C_LanguageEnum.english, List.of());
+ }}),
+
+ guiName("GUI.Name", "&5default &9GUI", true,
+ new HashMap<>() {{
+ put(T2C_LanguageEnum.german, List.of());
+ put(T2C_LanguageEnum.english, List.of());
+ }}),
+ guiFillItemEnable("GUI.FillItem.Enable", true, true,
+ new HashMap<>() {{
+ put(T2C_LanguageEnum.german, List.of());
+ put(T2C_LanguageEnum.english, List.of());
+ }}),
+ guiFillItemItem(isGlassColor() ? "GUI.FillItem.GlassPaneColor" : "GUI.FillItem.Item", isGlassColor() ? 15 : "BLACK_STAINED_GLASS_PANE", true,
+ new HashMap<>() {{
+ put(T2C_LanguageEnum.german, List.of());
+ put(T2C_LanguageEnum.english, List.of());
+ }}),
+
+ commandAliasEnable("Command.Alias", true, true,
+ new HashMap<>() {{
+ put(T2C_LanguageEnum.german, List.of());
+ put(T2C_LanguageEnum.english, List.of());
+ }}),
+ commandPermission("Command.Permission.Required", true, true,
+ new HashMap<>() {{
+ put(T2C_LanguageEnum.german, List.of());
+ put(T2C_LanguageEnum.english, List.of());
+ }}),
+ slotSection("Slots", null, true,
+ new HashMap<>() {{
+ put(T2C_LanguageEnum.german, List.of());
+ put(T2C_LanguageEnum.english, List.of());
+ }}),
+
+ slotDiscordNumber("Slots.SupportDiscord.Slot", 4, false,
+ new HashMap<>() {{
+ put(T2C_LanguageEnum.german, List.of());
+ put(T2C_LanguageEnum.english, List.of());
+ }}),
+ slotDiscordEnable("Slots.SupportDiscord.Enable", true, false,
+ new HashMap<>() {{
+ put(T2C_LanguageEnum.german, List.of());
+ put(T2C_LanguageEnum.english, List.of());
+ }}),
+ slotDiscordFunction("Slots.SupportDiscord.Function", "supportDiscord", false,
+ new HashMap<>() {{
+ put(T2C_LanguageEnum.german, List.of());
+ put(T2C_LanguageEnum.english, List.of());
+ }}),
+ slotDiscordPermRequired("Slots.SupportDiscord.Permission.Required", false, false,
+ new HashMap<>() {{
+ put(T2C_LanguageEnum.german, List.of());
+ put(T2C_LanguageEnum.english, List.of());
+ }}),
+ slotDiscordPermSee("Slots.SupportDiscord.Permission.See", "commandgui.gui.[function].slot.[slot].see", false,
+ new HashMap<>() {{
+ put(T2C_LanguageEnum.german, List.of());
+ put(T2C_LanguageEnum.english, List.of());
+ }}),
+ slotDiscordPermUse("Slots.SupportDiscord.Permission.Use", "commandgui.gui.[function].slot.[slot].use", false,
+ new HashMap<>() {{
+ put(T2C_LanguageEnum.german, List.of());
+ put(T2C_LanguageEnum.english, List.of());
+ }}),
+ slotUseItemNumber("Slots.UseItem.Slot", 6, false,
+ new HashMap<>() {{
+ put(T2C_LanguageEnum.german, List.of());
+ put(T2C_LanguageEnum.english, List.of());
+ }}),
+ slotUseItemEnable("Slots.UseItem.Enable", true, false,
+ new HashMap<>() {{
+ put(T2C_LanguageEnum.german, List.of());
+ put(T2C_LanguageEnum.english, List.of());
+ }}),
+ slotUseItemFunction("Slots.UseItem.Function", "useItem", false,
+ new HashMap<>() {{
+ put(T2C_LanguageEnum.german, List.of());
+ put(T2C_LanguageEnum.english, List.of());
+ }}),
+ slotUseItemPermRequired("Slots.UseItem.Permission.Required", false, false,
+ new HashMap<>() {{
+ put(T2C_LanguageEnum.german, List.of());
+ put(T2C_LanguageEnum.english, List.of());
+ }}),
+ slotUseItemPermSee("Slots.UseItem.Permission.See", "commandgui.gui.[function].slot.[slot].see", false,
+ new HashMap<>() {{
+ put(T2C_LanguageEnum.german, List.of());
+ put(T2C_LanguageEnum.english, List.of());
+ }}),
+ slotUseItemPermUse("Slots.UseItem.Permission.Use", "commandgui.gui.[function].slot.[slot].use", false,
+ new HashMap<>() {{
+ put(T2C_LanguageEnum.german, List.of());
+ put(T2C_LanguageEnum.english, List.of());
+ }}),
+ ;
+
+ private final String path;
+ private Object value;
+ private final boolean forceSet;
+ private final HashMap> comments;
+
+ VALUES(String path, Object value, boolean forceSet, HashMap> comments) {
+ this.path = path;
+ this.value = value;
+ this.forceSet = forceSet;
+ this.comments = comments;
+ }
+
+ @Override
+ public String getPath() {
+ return path;
+ }
+
+ @Override
+ public Object getValue() {
+ return value;
+ }
+
+ @Override
+ public boolean getForceSet() {
+ return forceSet;
+ }
+
+ @Override
+ public HashMap> getComments() {
+ return comments;
+ }
+
+ @Override
+ public String getLanguagePath() {
+ return Config.VALUES.language.getValue().toString();
+ }
+
+ @Override
+ public void setValue(Object newValue) {
+ value = newValue;
+ }
+ }
+
+ private static boolean isGlassColor() {
+ if (T2C_McVersion.isMc1_8() || T2C_McVersion.isMc1_9() || T2C_McVersion.isMc1_10() || T2C_McVersion.isMc1_11() || T2C_McVersion.isMc1_12()) {
+ return true;
+ }
+ return false;
+ }
+
+ public static void createDefault(boolean isReload) {
+ File file = new File(Main.getPath(), "GUIs/default.yml");
+ T2C_ConfigWriter.createConfig(Util.getPrefix(), file, VALUES.values(), isReload, Util.getConfigLogo());
+ }
+
+ public static void set(boolean isReload) {
+ Main.guiHashMap.clear();
+ Main.allAliases.clear();
+ File f = new File(Main.getPath() + "/GUIs/");
+ f.mkdirs();
+ File[] fileArray = f.listFiles();
+
+ for (File file : fileArray) {
+ String sub = file.getName().substring(file.getName().length() - 4);
+ if (sub.equals(".yml")) {
+ T2C_ConfigWriter.createConfig(Util.getPrefix(), file, VALUES.values(), isReload, Util.getConfigLogo());
+ String guiName = file.getName().replace(".yml", "");
+ Main.allAliases.add(guiName);
+
+ Util.replace(VALUES.guiName);
+
+ Gui gui = new Gui(
+ (boolean) VALUES.guiEnable.value,
+ (int) VALUES.guiLines.value,
+ VALUES.guiName.value.toString(),
+ (boolean) VALUES.guiFillItemEnable.value,
+ VALUES.guiFillItemItem.value.toString(),
+ guiName,
+ (boolean) VALUES.commandAliasEnable.value,
+ (boolean) VALUES.commandPermission.value,
+ getSlots(file, guiName));
+ Main.guiHashMap.put(guiName, gui);
+ CmdExecuter_GUI.arg1.put(file.getName()
+ .replace(".yml", ""), "commandgui.gui." + guiName);
+ }
+ }
+ }
+
+ private static ArrayList getSlots(File file, String guiName) {
+ YamlConfiguration yamlConfiguration = YamlConfiguration.loadConfiguration(file);
+ ArrayList slots = new ArrayList<>();
+ for (String key : yamlConfiguration.getConfigurationSection(VALUES.slotSection.getPath()).getKeys(false)) {
+ int slotNumber = yamlConfiguration.getInt("Slots." + key + ".Slot") - 1;
+ Boolean enable = yamlConfiguration.getBoolean("Slots." + key + ".Enable");
+ String function = yamlConfiguration.getString("Slots." + key + ".Function");
+ Function functionCheck = Main.functionHashMap.get(function);
+ if (functionCheck == null) {
+ T2C_Send.error(Main.getPlugin(), "The Function " + function + " in the GUI " + guiName + " does not exist!");
+ }
+ Boolean permRequired = yamlConfiguration.getBoolean("Slots." + key + ".Permission.Required");
+ String permSee = yamlConfiguration.getString("Slots." + key + ".Permission.See");
+ String permUse = yamlConfiguration.getString("Slots." + key + ".Permission.Use");
+
+ Slot slot = new Slot(slotNumber, enable, function, permRequired,
+ permSee.replace("[function]", guiName).replace("[slot]", String.valueOf(slotNumber + 1))
+ .replace("[slotname]", key.toLowerCase()),
+ permUse.replace("[function]", guiName).replace("[slot]", String.valueOf(slotNumber + 1))
+ .replace("[slotname]", key.toLowerCase()));
+ slots.add(slot);
+ }
+ return slots;
+ }
+}
diff --git a/CommandGUI V2/src/main/java/net/t2code/commandguiv2/Spigot/config/languages/Languages.java b/CommandGUI V2/src/main/java/net/t2code/commandguiv2/Spigot/config/languages/Languages.java
new file mode 100644
index 0000000..cd0cdcf
--- /dev/null
+++ b/CommandGUI V2/src/main/java/net/t2code/commandguiv2/Spigot/config/languages/Languages.java
@@ -0,0 +1,624 @@
+// This class was created by JaTiTV.
+
+package net.t2code.commandguiv2.Spigot.config.languages;
+
+import net.t2code.commandguiv2.Spigot.Main;
+import net.t2code.commandguiv2.Spigot.config.config.Config;
+import net.t2code.commandguiv2.Util;
+import net.t2code.t2codelib.SPIGOT.api.messages.T2C_Replace;
+import net.t2code.t2codelib.SPIGOT.api.yaml.T2C_LanguageWriter;
+import net.t2code.t2codelib.util.T2C_ConfigItemLanguages;
+import net.t2code.t2codelib.util.T2C_LanguageEnum;
+
+import java.util.HashMap;
+import java.util.List;
+import java.util.logging.Level;
+
+public class Languages {
+ public enum VALUES implements T2C_ConfigItemLanguages {
+
+ VaultNotSetUp("Plugin.VaultNotSetUp", null,
+ new HashMap<>() {{
+ put(T2C_LanguageEnum.german, List.of("[prefix] Vault / Economy nicht eingerichtet!"));
+ put(T2C_LanguageEnum.english, List.of("[prefix] Vault / Economy not set up!"));
+ }},
+ new HashMap<>() {{
+ put(T2C_LanguageEnum.german, List.of());
+ put(T2C_LanguageEnum.english, List.of());
+ }}),
+ SoundNotFound("Plugin.SoundNotFound", null,
+ new HashMap<>() {{
+ put(T2C_LanguageEnum.german, List.of("[prefix] Der Sound [sound] wurde nicht gefunden! Bitte überprüfe die Einstellungen."));
+ put(T2C_LanguageEnum.english, List.of("[prefix] The sound [sound] was not found! Please check the settings."));
+ }},
+ new HashMap<>() {{
+ put(T2C_LanguageEnum.german, List.of());
+ put(T2C_LanguageEnum.english, List.of());
+ }}),
+
+ OnlyForPlayer("Plugin.OnlyForPlayer", null,
+ new HashMap<>() {{
+ put(T2C_LanguageEnum.german, List.of("[prefix] Dieser Command ist nur für Spieler!"));
+ put(T2C_LanguageEnum.english, List.of("[prefix] This command is for players only!"));
+ }},
+ new HashMap<>() {{
+ put(T2C_LanguageEnum.german, List.of());
+ put(T2C_LanguageEnum.english, List.of());
+ }}),
+
+ DefaultGUIcreate("Plugin.DefaultGUI.create", null,
+ new HashMap<>() {{
+ put(T2C_LanguageEnum.german, List.of("[prefix] DefaultGUI wurde erstellt. Du findest sie im Verzeichnis: [directory]!"));
+ put(T2C_LanguageEnum.english, List.of("[prefix] DefaultGUI was created. You can find it in the directory: [directory]!"));
+ }},
+ new HashMap<>() {{
+ put(T2C_LanguageEnum.german, List.of());
+ put(T2C_LanguageEnum.english, List.of());
+ }}),
+
+ ReloadStart("Plugin.Reload.Start", null,
+ new HashMap<>() {{
+ put(T2C_LanguageEnum.german, List.of("[prefix] Plugin wird neu geladen..."));
+ put(T2C_LanguageEnum.english, List.of("[prefix] Plugin is reloaded..."));
+ }},
+ new HashMap<>() {{
+ put(T2C_LanguageEnum.german, List.of());
+ put(T2C_LanguageEnum.english, List.of());
+ }}),
+
+ ReloadEnd("Plugin.Reload.End", null,
+ new HashMap<>() {{
+ put(T2C_LanguageEnum.german, List.of("[prefix] Du hast keine Permission für CommandGUI!"));
+ put(T2C_LanguageEnum.english, List.of("[prefix] Plugin was successfully reloaded."));
+ }},
+ new HashMap<>() {{
+ put(T2C_LanguageEnum.german, List.of());
+ put(T2C_LanguageEnum.english, List.of());
+ }}),
+
+ NoPermission("NoPermission.ForCommandGUI", null,
+ new HashMap<>() {{
+ put(T2C_LanguageEnum.german, List.of("[prefix] Du hast keine Permission für CommandGUI!"));
+ put(T2C_LanguageEnum.english, List.of("[prefix] You do not have permission for CommandGUI!"));
+ }},
+ new HashMap<>() {{
+ put(T2C_LanguageEnum.german, List.of());
+ put(T2C_LanguageEnum.english, List.of());
+ }}),
+
+ NoPermissionForCommand("NoPermission.ForCommand", null,
+ new HashMap<>() {{
+ put(T2C_LanguageEnum.german, List.of("[prefix] Für [cmd] fehlt dir die Permission [perm]!"));
+ put(T2C_LanguageEnum.english, List.of("[prefix] For [cmd] you lack the permission [perm]!"));
+ }},
+ new HashMap<>() {{
+ put(T2C_LanguageEnum.german, List.of());
+ put(T2C_LanguageEnum.english, List.of());
+ }}),
+
+ NoPermissionForUseItem("NoPermission.ForUseItem", null,
+ new HashMap<>() {{
+ put(T2C_LanguageEnum.german, List.of("[prefix] Dir fehlt die Permission [perm] um das Item für die GUI: [gui] nutzen zu können."));
+ put(T2C_LanguageEnum.english, List.of("[prefix] You lack the permission [perm] to use the item for the GUI: [gui]."));
+ }},
+ new HashMap<>() {{
+ put(T2C_LanguageEnum.german, List.of());
+ put(T2C_LanguageEnum.english, List.of());
+ }}),
+
+ NoPermissionForItem("NoPermission.ForItem", null,
+ new HashMap<>() {{
+ put(T2C_LanguageEnum.german, List.of("[prefix] Für [item] fehlt dir die Permission [perm]!"));
+ put(T2C_LanguageEnum.english, List.of("[prefix] For [item] you lack the permission [perm]!"));
+ }},
+ new HashMap<>() {{
+ put(T2C_LanguageEnum.german, List.of());
+ put(T2C_LanguageEnum.english, List.of());
+ }}),
+
+ ItemON("UseItem.UseItem_ON", null,
+ new HashMap<>() {{
+ put(T2C_LanguageEnum.german, List.of("[prefix] Du hast das GUI-Item aktiviert."));
+ put(T2C_LanguageEnum.english, List.of("[prefix] You have activated the GUI item."));
+ }},
+ new HashMap<>() {{
+ put(T2C_LanguageEnum.german, List.of());
+ put(T2C_LanguageEnum.english, List.of());
+ }}),
+
+ ItemOFF("UseItem.UseItem_OFF", null,
+ new HashMap<>() {{
+ put(T2C_LanguageEnum.german, List.of("[prefix] Du hast das GUI-Item deaktiviert."));
+ put(T2C_LanguageEnum.english, List.of("[prefix] You have disabled the GUI item."));
+ }},
+ new HashMap<>() {{
+ put(T2C_LanguageEnum.german, List.of());
+ put(T2C_LanguageEnum.english, List.of());
+ }}),
+
+ ItemSlot("UseItem.Change_Slot", null,
+ new HashMap<>() {{
+ put(T2C_LanguageEnum.german, List.of("[prefix] Du hast das GUI-Item auf Slot [slot] umgestellt."));
+ put(T2C_LanguageEnum.english, List.of("[prefix] You have changed the GUI item to slot: [slot]."));
+ }},
+ new HashMap<>() {{
+ put(T2C_LanguageEnum.german, List.of());
+ put(T2C_LanguageEnum.english, List.of());
+ }}),
+
+ ItemSlotNotEmpty("UseItem.SlotNotEmpty", null,
+ new HashMap<>() {{
+ put(T2C_LanguageEnum.german, List.of("[prefix] Der Slot §e[slot] §6ist derzeit belegt!."));
+ put(T2C_LanguageEnum.english, List.of("[prefix] The slot [slot] is currently occupied!"));
+ }},
+ new HashMap<>() {{
+ put(T2C_LanguageEnum.german, List.of());
+ put(T2C_LanguageEnum.english, List.of());
+ }}),
+
+ ItemSlotAlreadySet("UseItem.SlotAlreadySet", null,
+ new HashMap<>() {{
+ put(T2C_LanguageEnum.german, List.of("[prefix] Der Slot §e[slot] §6ist bereits eingestellt!"));
+ put(T2C_LanguageEnum.english, List.of("[prefix] The slot §e[slot] §6is already set!"));
+ }},
+ new HashMap<>() {{
+ put(T2C_LanguageEnum.german, List.of());
+ put(T2C_LanguageEnum.english, List.of());
+ }}),
+
+ ItemSlot_wrongValue("UseItem.ItemSlot_wrongValue", null,
+ new HashMap<>() {{
+ put(T2C_LanguageEnum.german, List.of("[prefix] Der angegebene Slot muss sich zwischen 1 und 9 befinden!"));
+ put(T2C_LanguageEnum.english, List.of("[prefix] The specified slot must be between 1 and 9!"));
+ }},
+ new HashMap<>() {{
+ put(T2C_LanguageEnum.german, List.of());
+ put(T2C_LanguageEnum.english, List.of());
+ }}),
+
+ UseItemDisabledInGameMode("UseItem.DisabledInGameMode", null,
+ new HashMap<>() {{
+ put(T2C_LanguageEnum.german, List.of("[prefix] Das UseItem ist in diesem GameMode deaktiviert!"));
+ put(T2C_LanguageEnum.english, List.of("[prefix] The UseItem is disabled in this GameMode!"));
+ }},
+ new HashMap<>() {{
+ put(T2C_LanguageEnum.german, List.of());
+ put(T2C_LanguageEnum.english, List.of());
+ }}),
+
+ UseItemDisabledInWorld("UseItem.DisabledInWorld", null,
+ new HashMap<>() {{
+ put(T2C_LanguageEnum.german, List.of("[prefix] Das UseItem ist in dieser Welt deaktiviert!"));
+ put(T2C_LanguageEnum.english, List.of("[prefix] The UseItem is disabled in this World!"));
+ }},
+ new HashMap<>() {{
+ put(T2C_LanguageEnum.german, List.of());
+ put(T2C_LanguageEnum.english, List.of());
+ }}),
+
+ Buy_msg("Cost.Buy_msg", null,
+ new HashMap<>() {{
+ put(T2C_LanguageEnum.german, List.of("[prefix] Du hast dir [itemname] für [price] gekauft."));
+ put(T2C_LanguageEnum.english, List.of("[prefix] You bought [itemname] for [price]."));
+ }},
+ new HashMap<>() {{
+ put(T2C_LanguageEnum.german, List.of());
+ put(T2C_LanguageEnum.english, List.of());
+ }}),
+
+ noMoney("Cost.noMoney", null,
+ new HashMap<>() {{
+ put(T2C_LanguageEnum.german, List.of("Du benötigst [price].'>[prefix] Du hast nicht genügend Geld!"));
+ put(T2C_LanguageEnum.english, List.of("You need: [price].'>[prefix] You don't have enough money!"));
+ }},
+ new HashMap<>() {{
+ put(T2C_LanguageEnum.german, List.of());
+ put(T2C_LanguageEnum.english, List.of());
+ }}),
+
+ noMoneyItem("Cost.noItem", null,
+ new HashMap<>() {{
+ put(T2C_LanguageEnum.german, List.of("Du benötigst: [amount].'>[prefix] Du hast nicht genügend Items von [item] im Inventar!"));
+ put(T2C_LanguageEnum.english, List.of("You need: [amount].'>[prefix] You don't have enough items of [item] in your inventory!"));
+ }},
+ new HashMap<>() {{
+ put(T2C_LanguageEnum.german, List.of());
+ put(T2C_LanguageEnum.english, List.of());
+ }}),
+
+ noMoneyVote("Cost.noVote", null,
+ new HashMap<>() {{
+ put(T2C_LanguageEnum.german, List.of("Du benötigst: [amount].'>[prefix] Du hast nicht genügend Vote Punkte!"));
+ put(T2C_LanguageEnum.english, List.of("You need: [amount].'>[prefix] You do not have enough vote points!"));
+ }},
+ new HashMap<>() {{
+ put(T2C_LanguageEnum.german, List.of());
+ put(T2C_LanguageEnum.english, List.of());
+ }}),
+
+ NoInventorySpace("Cost.NoInventorySpace", null,
+ new HashMap<>() {{
+ put(T2C_LanguageEnum.german, List.of("[prefix] Du hast keinen Platz in deinem Inventar!"));
+ put(T2C_LanguageEnum.english, List.of("[prefix] You have no room in your inventory!"));
+ }},
+ new HashMap<>() {{
+ put(T2C_LanguageEnum.german, List.of());
+ put(T2C_LanguageEnum.english, List.of());
+ }}),
+
+ onServerChange("ServerChange.onServerChange", null,
+ new HashMap<>() {{
+ put(T2C_LanguageEnum.german, List.of("[prefix] Du wirst auf den Server §e[server] §2verbunden."));
+ put(T2C_LanguageEnum.english, List.of("[prefix] You will be connected to the server [server]§2."));
+ }},
+ new HashMap<>() {{
+ put(T2C_LanguageEnum.german, List.of());
+ put(T2C_LanguageEnum.english, List.of());
+ }}),
+
+ guiNotFound("GUI.GUInotFound", null,
+ new HashMap<>() {{
+ put(T2C_LanguageEnum.german, List.of("[prefix] Die von die gew[ae]hlte GUI gibt es nicht."));
+ put(T2C_LanguageEnum.english, List.of("[prefix] The GUI chosen by the does not exist."));
+ }},
+ new HashMap<>() {{
+ put(T2C_LanguageEnum.german, List.of());
+ put(T2C_LanguageEnum.english, List.of());
+ }}),
+
+ GUIIsDisabled("GUI.GUIisDisabled", null,
+ new HashMap<>() {{
+ put(T2C_LanguageEnum.german, List.of("[prefix] Die GUI [gui] ist derzeit Deaktiviert!"));
+ put(T2C_LanguageEnum.english, List.of("[prefix] The GUI [gui] is currently Disabled!"));
+ }},
+ new HashMap<>() {{
+ put(T2C_LanguageEnum.german, List.of());
+ put(T2C_LanguageEnum.english, List.of());
+ }}),
+
+ Give_Sender("Give.Sender", null,
+ new HashMap<>() {{
+ put(T2C_LanguageEnum.german, List.of("[prefix] Du hast [player] ein [item] gegeben!"));
+ put(T2C_LanguageEnum.english, List.of("[prefix] You have given [player] an [item] !"));
+ }},
+ new HashMap<>() {{
+ put(T2C_LanguageEnum.german, List.of());
+ put(T2C_LanguageEnum.english, List.of());
+ }}),
+
+ Give_Receiver("Give.Receiver", null,
+ new HashMap<>() {{
+ put(T2C_LanguageEnum.german, List.of("[prefix] Du hast von [sender] , [item] bekommen!"));
+ put(T2C_LanguageEnum.english, List.of("[prefix] You got , [item] from [sender]!"));
+ }},
+ new HashMap<>() {{
+ put(T2C_LanguageEnum.german, List.of());
+ put(T2C_LanguageEnum.english, List.of());
+ }}),
+
+ PlayerNotFond("Player.PlayerNotFond", null,
+ new HashMap<>() {{
+ put(T2C_LanguageEnum.german, List.of("[prefix] Der Spieler [player] wurde nicht gefunden oder ist nicht Online!"));
+ put(T2C_LanguageEnum.english, List.of("[prefix] The player [player] was not found or is not online!"));
+ }},
+ new HashMap<>() {{
+ put(T2C_LanguageEnum.german, List.of());
+ put(T2C_LanguageEnum.english, List.of());
+ }}),
+
+ PlayerNoInventorySpace("Player.PlayerNoInventorySpace", null,
+ new HashMap<>() {{
+ put(T2C_LanguageEnum.german, List.of("[prefix] [player] hat keinen freien Platz in seinem Inventar!"));
+ put(T2C_LanguageEnum.english, List.of("[prefix] [player] has no free space in his inventory!"));
+ }},
+ new HashMap<>() {{
+ put(T2C_LanguageEnum.german, List.of());
+ put(T2C_LanguageEnum.english, List.of());
+ }}),
+
+ functionItemAdd("FunctionItem.Add", null,
+ new HashMap<>() {{
+ put(T2C_LanguageEnum.german, List.of("[prefix] Dir wurden [amount] [item] in dein Inventar gelegt."));
+ put(T2C_LanguageEnum.english, List.of("[prefix] You have [amount] [item] placed in your inventory."));
+ }},
+ new HashMap<>() {{
+ put(T2C_LanguageEnum.german, List.of());
+ put(T2C_LanguageEnum.english, List.of());
+ }}),
+
+ functionItemRemove("FunctionItem.Remove", null,
+ new HashMap<>() {{
+ put(T2C_LanguageEnum.german, List.of("[prefix] Dir wurden [amount] [item] entfernt."));
+ put(T2C_LanguageEnum.english, List.of("[prefix] You have been [amount] [item] removed."));
+ }},
+ new HashMap<>() {{
+ put(T2C_LanguageEnum.german, List.of());
+ put(T2C_LanguageEnum.english, List.of());
+ }}),
+
+ functionItemRemoveError("FunctionItem.RemoveError", null,
+ new HashMap<>() {{
+ put(T2C_LanguageEnum.german, List.of("Du benötigst [amount] [item]!'>[prefix] Du hast nicht so viele Items!"));
+ put(T2C_LanguageEnum.english, List.of("You need [amount] [item]!'>[prefix] You don't have so many items!"));
+ }},
+ new HashMap<>() {{
+ put(T2C_LanguageEnum.german, List.of());
+ put(T2C_LanguageEnum.english, List.of());
+ }}),
+
+ functionVoteAdd("FunctionVote.Add", null,
+ new HashMap<>() {{
+ put(T2C_LanguageEnum.german, List.of("[prefix] Dir wurden [amount] Vote Punkte gegeben."));
+ put(T2C_LanguageEnum.english, List.of("[prefix] You were given [amount] Vote points."));
+ }},
+ new HashMap<>() {{
+ put(T2C_LanguageEnum.german, List.of());
+ put(T2C_LanguageEnum.english, List.of());
+ }}),
+
+ functionVoteRemove("FunctionVote.Remove", null,
+ new HashMap<>() {{
+ put(T2C_LanguageEnum.german, List.of("[prefix] Dir wurden [amount] Vote Punkte entfernt."));
+ put(T2C_LanguageEnum.english, List.of("[prefix] You have been removed [amount] Vote points."));
+ }},
+ new HashMap<>() {{
+ put(T2C_LanguageEnum.german, List.of());
+ put(T2C_LanguageEnum.english, List.of());
+ }}),
+
+ functionVoteRemoveError("FunctionVote.RemoveError", null,
+ new HashMap<>() {{
+ put(T2C_LanguageEnum.german, List.of("Du benötigst [amount]!'>[prefix] Du hast nicht so viele VotePunkte!"));
+ put(T2C_LanguageEnum.english, List.of("You need [amount]!'>[prefix] You don't have so many VotePoints!"));
+ }},
+ new HashMap<>() {{
+ put(T2C_LanguageEnum.german, List.of());
+ put(T2C_LanguageEnum.english, List.of());
+ }}),
+
+ HelpCgui("Help.CGUI", null,
+ new HashMap<>() {{
+ put(T2C_LanguageEnum.german, List.of("''/commandgui | /cgui'' Öffne die default GUI ([gui])."));
+ put(T2C_LanguageEnum.english, List.of("''/commandgui