T2C-CommandGUI/CommandGUI V2/src/main/java/de/jatitv/commandguiv2/Spigot/config/config/SelectConfig.java

361 lines
18 KiB
Java
Raw Normal View History

2022-01-06 01:21:27 +00:00
package de.jatitv.commandguiv2.Spigot.config.config;
2021-12-21 04:57:29 +00:00
import de.jatitv.commandguiv2.Spigot.Main;
2.7.0 Snapshot 1 In this update some functions were rewritten, changed and added. Also some minor bugs have been fixed. The GUIs files have been split into GUI files and function files, this provides more clarity in the complete plugin structure and offers the possibility to access a function from multiple GUIs. Thus, for example, you can create a back button as a function and open it from 3 GUIs, the item, the function can also be in different places, because the slot is set in the GUI file. In the GUI files is thus specified on which slot which function should be located. In addition, the permission for See and for Use of the functions can now be set individually in the GUI Config. In the functions also 2 new functions were added, with which players can switch permissions on and off and an option to switch the UseItem on and off. Placeholders have been added. This update includes a converter that builds the new structure from the old config structure. Your options should be taken over. For security reasons your old GUI files are saved under the path 'plugins/CommandGUI/OldConfig/GUIs/Version4'. Bug fixes: - Fixed a bug that prevented GUIs from opening. - The OpenGUI option, the command '/cgui <guiname>' did not work. The GUI that was set as default GUI in UseItem was always opened. This was fixed New features: - Placeholders - %commandgui_useitem% - Shows if you have activated or deactivated the UseItem (in color, customizable in config.yml) - %commandgui_useitem_boolean% - Shows if you have enabled or disabled the UseItem - %commandgui_useitem_slot% - shows on which slot you have set the UseItem - ToggleUseItem as new option for slots - TogglePermission as new option for slots Changes: - The config structure has been revised.
2022-04-19 05:08:33 +00:00
import de.jatitv.commandguiv2.Spigot.config.configConverter.ConfigConverterUnderV5;
2022-01-06 01:21:27 +00:00
import de.jatitv.commandguiv2.Spigot.config.languages.SelectMessages;
2021-12-21 04:57:29 +00:00
import de.jatitv.commandguiv2.Spigot.system.database.MySQL;
import de.jatitv.commandguiv2.Spigot.system.database.StorageType;
2022-01-01 02:40:54 +00:00
import de.jatitv.commandguiv2.Util;
2021-12-21 04:57:29 +00:00
import net.t2code.lib.Spigot.Lib.messages.send;
import net.t2code.lib.Spigot.Lib.minecraftVersion.MCVersion;
import net.t2code.lib.Spigot.Lib.replace.Replace;
import org.bukkit.Sound;
import org.bukkit.configuration.file.YamlConfiguration;
import java.io.File;
2.7.0 Snapshot 1 In this update some functions were rewritten, changed and added. Also some minor bugs have been fixed. The GUIs files have been split into GUI files and function files, this provides more clarity in the complete plugin structure and offers the possibility to access a function from multiple GUIs. Thus, for example, you can create a back button as a function and open it from 3 GUIs, the item, the function can also be in different places, because the slot is set in the GUI file. In the GUI files is thus specified on which slot which function should be located. In addition, the permission for See and for Use of the functions can now be set individually in the GUI Config. In the functions also 2 new functions were added, with which players can switch permissions on and off and an option to switch the UseItem on and off. Placeholders have been added. This update includes a converter that builds the new structure from the old config structure. Your options should be taken over. For security reasons your old GUI files are saved under the path 'plugins/CommandGUI/OldConfig/GUIs/Version4'. Bug fixes: - Fixed a bug that prevented GUIs from opening. - The OpenGUI option, the command '/cgui <guiname>' did not work. The GUI that was set as default GUI in UseItem was always opened. This was fixed New features: - Placeholders - %commandgui_useitem% - Shows if you have activated or deactivated the UseItem (in color, customizable in config.yml) - %commandgui_useitem_boolean% - Shows if you have enabled or disabled the UseItem - %commandgui_useitem_slot% - shows on which slot you have set the UseItem - ToggleUseItem as new option for slots - TogglePermission as new option for slots Changes: - The config structure has been revised.
2022-04-19 05:08:33 +00:00
import java.io.IOException;
import java.util.ArrayList;
2021-12-21 04:57:29 +00:00
import java.util.List;
2022-01-01 02:40:54 +00:00
public class SelectConfig {
2021-12-21 04:57:29 +00:00
2.7.0 Snapshot 1 In this update some functions were rewritten, changed and added. Also some minor bugs have been fixed. The GUIs files have been split into GUI files and function files, this provides more clarity in the complete plugin structure and offers the possibility to access a function from multiple GUIs. Thus, for example, you can create a back button as a function and open it from 3 GUIs, the item, the function can also be in different places, because the slot is set in the GUI file. In the GUI files is thus specified on which slot which function should be located. In addition, the permission for See and for Use of the functions can now be set individually in the GUI Config. In the functions also 2 new functions were added, with which players can switch permissions on and off and an option to switch the UseItem on and off. Placeholders have been added. This update includes a converter that builds the new structure from the old config structure. Your options should be taken over. For security reasons your old GUI files are saved under the path 'plugins/CommandGUI/OldConfig/GUIs/Version4'. Bug fixes: - Fixed a bug that prevented GUIs from opening. - The OpenGUI option, the command '/cgui <guiname>' did not work. The GUI that was set as default GUI in UseItem was always opened. This was fixed New features: - Placeholders - %commandgui_useitem% - Shows if you have activated or deactivated the UseItem (in color, customizable in config.yml) - %commandgui_useitem_boolean% - Shows if you have enabled or disabled the UseItem - %commandgui_useitem_slot% - shows on which slot you have set the UseItem - ToggleUseItem as new option for slots - TogglePermission as new option for slots Changes: - The config structure has been revised.
2022-04-19 05:08:33 +00:00
private static final File config = new File(Main.getPath(), "config.yml");
private static final YamlConfiguration yamlConfiguration = YamlConfiguration.loadConfiguration(config);
2021-12-21 04:57:29 +00:00
public static Boolean DisableUpdateChecker;
public static Boolean UpdateCheckOnJoin;
public static Boolean Debug;
public static Boolean HelpAlias;
public static String language;
public static String Currency;
2022-04-16 12:32:22 +00:00
public static List<String> mainCommands;
2021-12-21 04:57:29 +00:00
public static StorageType Storage;
2021-12-21 04:57:29 +00:00
public static Boolean Bungee;
public static String thisServer;
public static String DefaultGUI;
public static Boolean UseItem_Enable;
public static Boolean UseItem_AllowToggle;
public static Boolean UseItem_AllowSetSlot;
public static Boolean UseItem_GiveOnEveryJoin;
public static Boolean UseItem_GiveOnlyOnFirstJoin;
public static Boolean UseItem_ServerChange;
public static Boolean Cursor_ToGUIItem_OnLogin;
public static Boolean Cursor_ToGUIItem_OnlyOnFirstLogin;
public static Boolean UseItem_BlockMoveAndDrop;
public static String UseItem_OpenGUI;
public static Boolean UseItem_Permission;
public static Boolean UseItem_KeepAtCommandClear;
2022-01-06 01:21:27 +00:00
public static Boolean UseItemGameModeChangeEnable;
2021-12-21 04:57:29 +00:00
public static int UseItemGameModeChangeDelayInTicks;
2022-01-06 01:21:27 +00:00
public static Boolean UseItemGameModeProtection;
public static Boolean UseItemGameModeRemoveItemWhenItIsDisabled;
2022-01-06 01:21:27 +00:00
public static String UseItemGameModeMode;
public static List<String> UseItemGameModeList;
public static Boolean UseItemWorldChangeEnable;
public static int UseItemWorldChangeDelayInTicks;
public static Boolean UseItemWorldProtection;
public static Boolean UseItemWorldRemoveItemWhenItIsDisabled;
public static String UseItemWorldMode;
public static List<String> UseItemWorldList;
2021-12-21 04:57:29 +00:00
public static Boolean UseItem_InventorySlot_FreeSlot;
public static Integer UseItem_InventorySlot;
public static Boolean UseItem_InventorySlotEnforce;
public static String UseItem_Material;
public static Boolean UseItem_PlayerHead_Enable;
public static Boolean UseItem_Base64_Enable;
public static String UseItem_Base64value;
public static Boolean UseItem_PlayerWhoHasOpenedTheGUI;
public static String UseItem_PlayerName;
public static String UseItem_Name;
2022-01-06 01:21:27 +00:00
public static List<String> UseItem_Lore;
2022-04-16 12:32:22 +00:00
public static Boolean toggleItemOnOrYesBase64;
public static String toggleItemOnOrYesBase64Value;
public static String toggleItemOnOrYesMaterial;
public static Boolean toggleItemOffOrNoBase64;
public static String toggleItemOffOrNoBase64Value;
public static String toggleItemOffOrNoMaterial;
public static String togglePermTrue;
public static String togglePermFalse;
public static String placeholderTrue;
public static String placeholderFalse;
2021-12-21 04:57:29 +00:00
public static Boolean Sound_Enable = true;
public static Boolean Sound_OpenInventory_Enable = true;
public static Sound Sound_OpenInventory;
public static String Sound_OpenInventory_input;
public static Boolean Sound_Click_Enable = true;
public static Sound Sound_Click;
public static String Sound_Click_input;
public static Boolean Sound_NoMoney_Enable = true;
public static Sound Sound_NoMoney;
public static String Sound_NoMoney_input;
public static Boolean Sound_NoInventorySpace_Enable = true;
public static Sound Sound_NoInventorySpace;
public static String Sound_NoInventorySpace_input;
public static Boolean Sound_Give_Enable = true;
public static Sound Sound_Give;
public static String Sound_Give_input;
public static Boolean Sound_PlayerNotFound_Enable = true;
public static Sound Sound_PlayerNotFound;
public static String Sound_PlayerNotFound_input;
public static void onSelect() {
2.7.0 Snapshot 1 In this update some functions were rewritten, changed and added. Also some minor bugs have been fixed. The GUIs files have been split into GUI files and function files, this provides more clarity in the complete plugin structure and offers the possibility to access a function from multiple GUIs. Thus, for example, you can create a back button as a function and open it from 3 GUIs, the item, the function can also be in different places, because the slot is set in the GUI file. In the GUI files is thus specified on which slot which function should be located. In addition, the permission for See and for Use of the functions can now be set individually in the GUI Config. In the functions also 2 new functions were added, with which players can switch permissions on and off and an option to switch the UseItem on and off. Placeholders have been added. This update includes a converter that builds the new structure from the old config structure. Your options should be taken over. For security reasons your old GUI files are saved under the path 'plugins/CommandGUI/OldConfig/GUIs/Version4'. Bug fixes: - Fixed a bug that prevented GUIs from opening. - The OpenGUI option, the command '/cgui <guiname>' did not work. The GUI that was set as default GUI in UseItem was always opened. This was fixed New features: - Placeholders - %commandgui_useitem% - Shows if you have activated or deactivated the UseItem (in color, customizable in config.yml) - %commandgui_useitem_boolean% - Shows if you have enabled or disabled the UseItem - %commandgui_useitem_slot% - shows on which slot you have set the UseItem - ToggleUseItem as new option for slots - TogglePermission as new option for slots Changes: - The config structure has been revised.
2022-04-19 05:08:33 +00:00
if (yamlConfiguration.getInt("ConfigVersion") < Util.getConfigVersion() && new File(Main.getPath(), "config.yml").exists()) {
send.console(Util.getPrefix() + " §4----------------------");
send.console(Util.getPrefix() + " ");
send.console(Util.getPrefix() + " §6New features have been added to CommandGUI. The Config is adapted!");
send.console(Util.getPrefix() + " ");
send.console(Util.getPrefix() + " §4----------------------");
if (yamlConfiguration.getInt("ConfigVersion") < 5) {
ConfigConverterUnderV5.convert();
}
}
2021-12-21 04:57:29 +00:00
if (yamlConfiguration.get("Plugin.DisableUpdateChecker") == null) {
DisableUpdateChecker = false;
} else DisableUpdateChecker = yamlConfiguration.getBoolean("Plugin.DisableUpdateChecker");
UpdateCheckOnJoin = yamlConfiguration.getBoolean("Plugin.UpdateCheckOnJoin");
Debug = yamlConfiguration.getBoolean("Plugin.Debug");
HelpAlias = yamlConfiguration.getBoolean("Plugin.HelpAlias");
language = yamlConfiguration.getString("Plugin.language");
Currency = yamlConfiguration.getString("Plugin.Currency");
DefaultGUI = yamlConfiguration.getString("Plugin.DefaultGUI");
Storage = StorageType.valueOf(yamlConfiguration.getString("Storage.Type").toUpperCase());
2021-12-21 04:57:29 +00:00
MySQL.ip = yamlConfiguration.getString("Storage.MySQL.IP");
MySQL.port = yamlConfiguration.getInt("Storage.MySQL.Port");
MySQL.database = yamlConfiguration.getString("Storage.MySQL.Database");
MySQL.user = yamlConfiguration.getString("Storage.MySQL.User");
MySQL.password = yamlConfiguration.getString("Storage.MySQL.Password");
MySQL.SSL = yamlConfiguration.getBoolean("Storage.MySQL.SSL");
Bungee = yamlConfiguration.getBoolean("BungeeCord.Enable");
thisServer = yamlConfiguration.getString("BungeeCord.ThisServer");
UseItem_Enable = yamlConfiguration.getBoolean("UseItem.Enable");
UseItem_AllowToggle = yamlConfiguration.getBoolean("UseItem.AllowToggle");
UseItem_AllowSetSlot = yamlConfiguration.getBoolean("UseItem.AllowSetSlot");
UseItem_BlockMoveAndDrop = yamlConfiguration.getBoolean("UseItem.BlockMoveAndDrop");
UseItem_OpenGUI = yamlConfiguration.getString("UseItem.OpenGUI");
UseItem_Permission = yamlConfiguration.getBoolean("UseItem.Permission.NeededToUse");
UseItem_KeepAtCommandClear = yamlConfiguration.getBoolean("UseItem.KeepAtCommandClear");
UseItem_InventorySlot_FreeSlot = yamlConfiguration.getBoolean("UseItem.InventorySlot.FreeSlot");
UseItem_InventorySlot = yamlConfiguration.getInt("UseItem.InventorySlot.Slot");
UseItem_InventorySlotEnforce = yamlConfiguration.getBoolean("UseItem.InventorySlot.SlotEnforce");
UseItem_Material = yamlConfiguration.getString("UseItem.Item.Material").toUpperCase();
UseItem_PlayerHead_Enable = yamlConfiguration.getBoolean("UseItem.Item.PlayerHead.Enable");
UseItem_Base64_Enable = yamlConfiguration.getBoolean("UseItem.Item.PlayerHead.Base64.Enable");
UseItem_Base64value = yamlConfiguration.getString("UseItem.Item.PlayerHead.Base64.Base64Value");
UseItem_PlayerWhoHasOpenedTheGUI = yamlConfiguration.getBoolean("UseItem.Item.PlayerHead.PlayerWhoHasOpenedTheGUI");
UseItem_PlayerName = yamlConfiguration.getString("UseItem.Item.PlayerHead.PlayerName");
2022-04-16 12:32:22 +00:00
UseItem_Name = Replace.replace(Util.getPrefix(), yamlConfiguration.getString("UseItem.Item.Name"));
2022-01-06 01:21:27 +00:00
UseItem_Lore = yamlConfiguration.getStringList("UseItem.Item.Lore");
2021-12-21 04:57:29 +00:00
UseItem_GiveOnEveryJoin = yamlConfiguration.getBoolean("UseItem.Join.GiveOnEveryJoin");
UseItem_GiveOnlyOnFirstJoin = yamlConfiguration.getBoolean("UseItem.Join.GiveOnlyOnFirstJoin");
Cursor_ToGUIItem_OnLogin = yamlConfiguration.getBoolean("UseItem.Join.Cursor.ToGUIItem.OnLogin.Enable");
Cursor_ToGUIItem_OnlyOnFirstLogin = yamlConfiguration.getBoolean("UseItem.Join.Cursor.ToGUIItem.Spigot.OnlyOnFirstLogin");
UseItem_ServerChange = yamlConfiguration.getBoolean("UseItem.Join.Cursor.ToGUIItem.Bungee.OnServerChange");
UseItemGameModeChangeEnable = yamlConfiguration.getBoolean("Advanced.UseItem.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");
List<String> gml = new ArrayList<>();
2022-04-16 12:32:22 +00:00
for (String gm : yamlConfiguration.getStringList("Advanced.UseItem.GameMode.Protection.List")) {
gml.add(gm.toUpperCase());
}
UseItemGameModeList = gml;
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");
2022-04-16 12:32:22 +00:00
UseItemWorldList = yamlConfiguration.getStringList("Advanced.UseItem.World.Protection.List");
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");
2021-12-21 04:57:29 +00:00
Sound_Enable = yamlConfiguration.getBoolean("Sound.Enable");
Sound_OpenInventory_Enable = yamlConfiguration.getBoolean("Sound.OpenInventory.Enable");
Sound_OpenInventory_input = (yamlConfiguration.getString("Sound.OpenInventory.Sound").toUpperCase().replace(".", "_"));
Sound_Click_Enable = yamlConfiguration.getBoolean("Sound.Click.Enable");
Sound_Click_input = (yamlConfiguration.getString("Sound.Click.Sound").toUpperCase().replace(".", "_"));
Sound_NoMoney_Enable = yamlConfiguration.getBoolean("Sound.NoMoney.Enable");
Sound_NoMoney_input = (yamlConfiguration.getString("Sound.NoMoney.Sound").toUpperCase().replace(".", "_"));
Sound_NoInventorySpace_Enable = yamlConfiguration.getBoolean("Sound.NoInventorySpace.Enable");
Sound_NoInventorySpace_input = (yamlConfiguration.getString("Sound.NoInventorySpace.Sound").toUpperCase().replace(".", "_"));
Sound_Give_Enable = yamlConfiguration.getBoolean("Sound.Give.Enable");
Sound_Give_input = (yamlConfiguration.getString("Sound.Give.Sound").toUpperCase().replace(".", "_"));
Sound_PlayerNotFound_Enable = yamlConfiguration.getBoolean("Sound.PlayerNotFound.Enable");
Sound_PlayerNotFound_input = (yamlConfiguration.getString("Sound.PlayerNotFound.Sound").toUpperCase().replace(".", "_"));
2.7.0 Snapshot 1 In this update some functions were rewritten, changed and added. Also some minor bugs have been fixed. The GUIs files have been split into GUI files and function files, this provides more clarity in the complete plugin structure and offers the possibility to access a function from multiple GUIs. Thus, for example, you can create a back button as a function and open it from 3 GUIs, the item, the function can also be in different places, because the slot is set in the GUI file. In the GUI files is thus specified on which slot which function should be located. In addition, the permission for See and for Use of the functions can now be set individually in the GUI Config. In the functions also 2 new functions were added, with which players can switch permissions on and off and an option to switch the UseItem on and off. Placeholders have been added. This update includes a converter that builds the new structure from the old config structure. Your options should be taken over. For security reasons your old GUI files are saved under the path 'plugins/CommandGUI/OldConfig/GUIs/Version4'. Bug fixes: - Fixed a bug that prevented GUIs from opening. - The OpenGUI option, the command '/cgui <guiname>' did not work. The GUI that was set as default GUI in UseItem was always opened. This was fixed New features: - Placeholders - %commandgui_useitem% - Shows if you have activated or deactivated the UseItem (in color, customizable in config.yml) - %commandgui_useitem_boolean% - Shows if you have enabled or disabled the UseItem - %commandgui_useitem_slot% - shows on which slot you have set the UseItem - ToggleUseItem as new option for slots - TogglePermission as new option for slots Changes: - The config structure has been revised.
2022-04-19 05:08:33 +00:00
setConfigVersion();
2021-12-21 04:57:29 +00:00
}
2022-01-06 01:21:27 +00:00
2021-12-21 04:57:29 +00:00
public static void sound(String Prefix) {
String soundOpenInventory;
if (MCVersion.minecraft1_8) {
2022-01-06 01:21:27 +00:00
soundOpenInventory = "CHEST_OPEN";
2021-12-21 04:57:29 +00:00
} else {
2022-01-06 01:21:27 +00:00
soundOpenInventory = "BLOCK_CHEST_OPEN";
2021-12-21 04:57:29 +00:00
}
String soundClick;
if (MCVersion.minecraft1_8) {
2022-01-06 01:21:27 +00:00
soundClick = "NOTE_STICKS";
2021-12-21 04:57:29 +00:00
} else if (MCVersion.minecraft1_9 || MCVersion.minecraft1_10 || MCVersion.minecraft1_11 || MCVersion.minecraft1_12) {
2022-01-06 01:21:27 +00:00
soundClick = "BLOCK_NOTE_HAT";
2021-12-21 04:57:29 +00:00
} else {
2022-01-06 01:21:27 +00:00
soundClick = "BLOCK_NOTE_BLOCK_HAT";
2021-12-21 04:57:29 +00:00
}
String soundNoMoney;
if (MCVersion.minecraft1_8) {
2022-01-06 01:21:27 +00:00
soundNoMoney = "NOTE_PIANO";
2021-12-21 04:57:29 +00:00
} else if (MCVersion.minecraft1_9 || MCVersion.minecraft1_10 || MCVersion.minecraft1_11 || MCVersion.minecraft1_12) {
2022-01-06 01:21:27 +00:00
soundNoMoney = "BLOCK_NOTE_HARP";
2021-12-21 04:57:29 +00:00
} else {
2022-01-06 01:21:27 +00:00
soundNoMoney = "BLOCK_NOTE_BLOCK_HARP";
2021-12-21 04:57:29 +00:00
}
String soundNoInventorySpace;
if (MCVersion.minecraft1_8) {
soundNoInventorySpace = "NOTE_PIANO";
} else if (MCVersion.minecraft1_9 || MCVersion.minecraft1_10 || MCVersion.minecraft1_11 || MCVersion.minecraft1_12) {
soundNoInventorySpace = "BLOCK_NOTE_BASS";
} else {
soundNoInventorySpace = "BLOCK_NOTE_BLOCK_GUITAR";
}
String soundGive;
if (MCVersion.minecraft1_8) {
soundGive = "LEVEL_UP";
} else {
soundGive = "ENTITY_PLAYER_LEVELUP";
}
String soundPlayerNotFound;
if (MCVersion.minecraft1_8) {
soundPlayerNotFound = "NOTE_PIANO";
} else if (MCVersion.minecraft1_9 || MCVersion.minecraft1_10 || MCVersion.minecraft1_11 || MCVersion.minecraft1_12) {
soundPlayerNotFound = "BLOCK_NOTE_HARP";
} else {
soundPlayerNotFound = "BLOCK_NOTE_BLOCK_HARP";
}
try {
Sound sound_OpenInventory = Sound.valueOf(Sound_OpenInventory_input);
if (sound_OpenInventory != null) {
Sound_OpenInventory = sound_OpenInventory;
}
} catch (Exception e) {
send.console("§4\n§4\n§4\n" + SelectMessages.SoundNotFound.replace("[prefix]", Prefix)
.replace("[sound]", "§8OpenInventory: §6" + Sound_OpenInventory_input) + "§4\n§4\n§4\n");
Sound_OpenInventory = Sound.valueOf(soundOpenInventory);
}
try {
Sound sound_Click = Sound.valueOf(Sound_Click_input);
if (sound_Click != null) {
Sound_Click = sound_Click;
}
} catch (Exception e) {
send.console("§4\n§4\n§4\n" + SelectMessages.SoundNotFound.replace("[prefix]", Prefix)
.replace("[sound]", "§8Click: §6" + Sound_Click_input) + "§4\n§4\n§4\n");
Sound_Click = Sound.valueOf(soundClick);
}
try {
Sound sound_NoMoney = Sound.valueOf(Sound_NoMoney_input);
if (sound_NoMoney != null) {
Sound_Click = sound_NoMoney;
}
} catch (Exception e) {
send.console("§4\n§4\n§4\n" + SelectMessages.SoundNotFound.replace("[prefix]", Prefix)
.replace("[sound]", "§8NoMoney: §6" + Sound_NoMoney_input) + "§4\n§4\n§4\n");
Sound_NoMoney = Sound.valueOf(soundNoMoney);
}
try {
Sound sound_NoInventorySpace = Sound.valueOf(Sound_NoInventorySpace_input);
if (sound_NoInventorySpace != null) {
Sound_NoInventorySpace = sound_NoInventorySpace;
}
} catch (Exception e) {
send.console("§4\n§4\n§4\n" + SelectMessages.SoundNotFound.replace("[prefix]", Prefix)
.replace("[sound]", "§8NoInventorySpace: §6" + Sound_NoInventorySpace_input) + "§4\n§4\n§4\n");
Sound_NoInventorySpace = Sound.valueOf(soundNoInventorySpace);
}
try {
Sound sound_Give = Sound.valueOf(Sound_Give_input);
if (sound_Give != null) {
Sound_Give = sound_Give;
}
} catch (Exception e) {
send.console("§4\n§4\n§4\n" + SelectMessages.SoundNotFound.replace("[prefix]", Prefix)
.replace("[sound]", "§8Give: §6" + Sound_Give_input) + "§4\n§4\n§4\n");
Sound_Give = Sound.valueOf(soundGive);
}
try {
Sound sound_PlayerNotFound = Sound.valueOf(Sound_PlayerNotFound_input);
if (sound_PlayerNotFound != null) {
Sound_PlayerNotFound = sound_PlayerNotFound;
}
} catch (Exception e) {
send.console("§4\n§4\n§4\n" + SelectMessages.SoundNotFound.replace("[prefix]", Prefix)
.replace("[sound]", "§8PlayerNotFound: §6" + Sound_PlayerNotFound_input) + "§4\n§4\n§4\n");
Sound_PlayerNotFound = Sound.valueOf(soundPlayerNotFound);
}
}
2.7.0 Snapshot 1 In this update some functions were rewritten, changed and added. Also some minor bugs have been fixed. The GUIs files have been split into GUI files and function files, this provides more clarity in the complete plugin structure and offers the possibility to access a function from multiple GUIs. Thus, for example, you can create a back button as a function and open it from 3 GUIs, the item, the function can also be in different places, because the slot is set in the GUI file. In the GUI files is thus specified on which slot which function should be located. In addition, the permission for See and for Use of the functions can now be set individually in the GUI Config. In the functions also 2 new functions were added, with which players can switch permissions on and off and an option to switch the UseItem on and off. Placeholders have been added. This update includes a converter that builds the new structure from the old config structure. Your options should be taken over. For security reasons your old GUI files are saved under the path 'plugins/CommandGUI/OldConfig/GUIs/Version4'. Bug fixes: - Fixed a bug that prevented GUIs from opening. - The OpenGUI option, the command '/cgui <guiname>' did not work. The GUI that was set as default GUI in UseItem was always opened. This was fixed New features: - Placeholders - %commandgui_useitem% - Shows if you have activated or deactivated the UseItem (in color, customizable in config.yml) - %commandgui_useitem_boolean% - Shows if you have enabled or disabled the UseItem - %commandgui_useitem_slot% - shows on which slot you have set the UseItem - ToggleUseItem as new option for slots - TogglePermission as new option for slots Changes: - The config structure has been revised.
2022-04-19 05:08:33 +00:00
private static void setConfigVersion() {
yamlConfiguration.set("ConfigVersion", Util.getConfigVersion());
try {
yamlConfiguration.save(config);
} catch (IOException e) {
e.printStackTrace();
}
}
2021-12-21 04:57:29 +00:00
}