From 9d9f0b988e4611edde071b46914a558f78461c43 Mon Sep 17 00:00:00 2001 From: j502647092 Date: Fri, 17 Jul 2015 18:22:31 +0800 Subject: [PATCH] init project... Signed-off-by: j502647092 --- .classpath | 7 + .gitignore | 36 + .project | 17 + src/config.yml | 146 ++ src/me/jacobculley/customgui/Main.java | 2236 ++++++++++++++++++++++++ src/plugin.yml | 8 + 6 files changed, 2450 insertions(+) create mode 100644 .classpath create mode 100644 .gitignore create mode 100644 .project create mode 100644 src/config.yml create mode 100644 src/me/jacobculley/customgui/Main.java create mode 100644 src/plugin.yml diff --git a/.classpath b/.classpath new file mode 100644 index 0000000..58bbb64 --- /dev/null +++ b/.classpath @@ -0,0 +1,7 @@ + + + + + + + diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..aad0b9b --- /dev/null +++ b/.gitignore @@ -0,0 +1,36 @@ +# netbeans +/nbproject + +# we use maven! +/build.xml + +# maven +/target +/repo + +# vim +.*.sw[a-p] + +# various other potential build files +/build +/bin +/dist +/manifest.mf + +/world + +# Mac filesystem dust +*.DS_Store + +# intellij +*.iml +*.ipr +*.iws +.idea/ + +# Project Stuff +/src/main/resources/Soulbound + +# Atlassian Stuff +/atlassian-ide-plugin.xml +/target/ diff --git a/.project b/.project new file mode 100644 index 0000000..107f966 --- /dev/null +++ b/.project @@ -0,0 +1,17 @@ + + + CustomGUI + + + + + + org.eclipse.jdt.core.javabuilder + + + + + + org.eclipse.jdt.core.javanature + + diff --git a/src/config.yml b/src/config.yml new file mode 100644 index 0000000..8b322b6 --- /dev/null +++ b/src/config.yml @@ -0,0 +1,146 @@ +#PlaceHolders: %PLAYER%, %BALANCE%, %PLAYERLEVEL%, %COMMANDSCOST% +#For extra placeholders download PlaceholderAPI: http://www.spigotmc.org/resources/clips-placeholderapi.6245/ + +GUI: ##DO NOT TOUCH! + Custom: ##The GUI interface, you can set as many "GUI's" as you wish + Bungee: false ##Set 'true' if you want to use Bungee features + ChestSize: 9 ##Item slots in GUI can be either 9,18,27,36,47,56 + ChestName: '&8ExampleGUI (%PLAYER%)' ##The name of the GUI displayed when you enter your "CustomGUICommand" + GUICommand: ##The command(s) used to access the GUI + - customgui + - custom + GUIPermission: customgui.open ##The permission required to access the GUI + OPItem: true ##If you want to use OP display items + PermissionItem: true ##If you want to use permission display items + BalanceItem: true ##If you want to use balance display items + EXPItem: true ##If you want to use EXP display items + OpenSound: LEVEL_UP ##The sound to play when the GUI is opened + WhitelistedWorlds: ##Specific worlds you want the GUI to be accessible in (Set "null" to ignore) + - null + InventoryGUIItemMovement: false ##Whether or not players can move the item in their inventory (Set "true" to allow movement) + InventoryGUIItems: [] + GUIItems: ##DO NOT TOUCH! +#-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-# + 1: ##You can place as many "items" as you wish in the config with any name + Permission: test.item.permission ##The permission required to use the item in the GUI + NoPermsClickSound: EXPLODE ##The sound to play if the player does not have permission and/or enough money to use the item + ItemSlot: 4 ##The itemslot in the GUI for the item to be displayed + #-=-=-=-=-=-=-=-=-=-=-=-=-# + OPItem: + Item: SKULL_ITEM;1;%PLAYER% ##The OP item that will be used in the GUI (Format: ;;) + Name: '&c&lOP Item' ##The OP item name to be displayed in the GUI + Lore: ##The lore of the OP item to be displayed in the GUI + - '&aThis OP item will be' + - '&ashown to any players' + - '&ain OP mode' + Enchant: DURABILITY;1,DAMAGE_ALL;1 ##The enchantment to be put on the OP item (Format: ;) + ConsoleCommands: ##The console commands to be executed when clicked (Use %PLAYER% for players name) + - deop %PLAYER% + - pex user %PLAYER% remove example.permission.1 + - pex user %PLAYER% group remove B + - xp set %PLAYER% 0 + PlayerCommands: ##The player commands to be executed when clicked + - spawn [RIGHT-CLICK] + CommandsCost: 0 ##The cost to execute the OP commands (Set Ò0Ó to make the commands free) + PlayerMessages: ##The messages to be sent to the player when clicked + - '&bYou are no longer OP' + BroadcastMessages: ##The messages to be sent globally when clicked + - '&a%PLAYER% clicked the OP Item!' + ClickSound: LEVEL_UP ##The sound to be played once the player clicks the item + SendToServer: null ##Send a player to the specified server on a Bungee network + CloseOnClick: true ##If you want the GUI to close when the item is clicked + #-=-=-=-=-=-=-=-=-=-=-=-=-# + PermissionItem: + Permission: example.permission.1 ##The permission required for the player to see the permission item + Item: DIAMOND;3;0 ##The permission item that will be used in the GUI (Format: ;;) + Name: '&b&lPermission Item' ##The permission item name to be displayed in the GUI + Lore: ##The lore of the permission item to be displayed in the GUI + - '&aThis permission item will' + - '&abe shown if the player has' + - '&athe config defined permission' + - '&eYou need $%COMMANDSCOST% to use this item' + Enchant: DURABILITY;1 ##The enchantment to be put on the permission item (Format: ;) + ConsoleCommands: ##The console commands to be executed when clicked (Use %PLAYER% for players name) + - fly %PLAYER% + - op %PLAYER% [LEFT-CLICK] + PlayerCommands: ##The player commands to be executed when clicked + - spawn + CommandsCost: 1000 ##The cost to execute the permission commands (Set Ò0Ó to make the commands free) + PlayerMessages: ##The messages to be sent to the player when clicked + - '&b$1000 has been deducted from your account' + BroadcastMessages: ##The messages to be sent globally when clicked + - '&a%PLAYER% clicked the Permission Item!' + ClickSound: LEVEL_UP ##The sound to be played once the player clicks the item + SendToServer: null ##Send a player to the specified server on a Bungee network + CloseOnClick: true ##If you want the GUI to close when the item is clicked + #-=-=-=-=-=-=-=-=-=-=-=-=-# + BalanceItem: + Balance: 1000 ##The player balance (Economy) required for the balance item to display + Item: GOLD_INGOT;2;0 ##The balance item that will be used in the GUI (Format: ;;) + Name: '&7&lBalance Item' ##The balance item name to be displayed in the GUI + Lore: ##The lore of the balance item to be displayed in the GUI + - '&aThis balance item will' + - '&abe shown if the player has' + - '&athe config defined balance' + - '&6Current Balance: %BALANCE%' + - '&eYou need $%COMMANDSCOST% to use this item' + Enchant: DURABILITY;1 ##The enchantment to be put on the balance item (Format: ;) + ConsoleCommands: ##The console commands to be executed when clicked (Use %PLAYER% for players name) + - pex user %PLAYER% add example.permission.1 + PlayerCommands: ##The player commands to be executed when clicked + - spawn + CommandsCost: 1000 ##The cost to execute the balance commands (Set Ò0Ó to make the commands free) + PlayerMessages: ##The messages to be sent to the player when clicked + - '&b$1000 has been deducted from your account' + BroadcastMessages: ##The messages to be sent globally when clicked + - '&a%PLAYER% clicked the Balance Item!' + SendToServer: null ##Send a player to the specified server on a Bungee network + ClickSound: LEVEL_UP ##The sound to be played once the player clicks the item + CloseOnClick: true ##If you want the GUI to close when the item is clicked + #-=-=-=-=-=-=-=-=-=-=-=-=-# + EXPItem: + Level: 10 ##The player EXP level required for the EXP item to display + Item: IRON_INGOT;1;0 ##The EXP item that will be used in the GUI (Format: ;;) + Name: '&e&lEXP Item' ##The EXP item name to be displayed in the GUI + Lore: ##The lore of the EXP item to be displayed in the GUI + - '&aThis EXP item will' + - '&abe shown if the player has' + - '&athe config defined EXP' + - '&6Current Level: %PLAYERLEVEL%' + Enchant: null ##The enchantment to be put on the EXP item (Format: ;) + ConsoleCommands: ##The console commands to be executed when clicked (Use %PLAYER% for players name) + - eco give %PLAYER% 2000 + PlayerCommands: ##The player commands to be executed when clicked + - spawn + CommandsCost: 0 ##The cost to execute the EXP commands (Set Ò0Ó to make the commands free) + PlayerMessages: ##The messages to be sent to the player when clicked + - null + BroadcastMessages: ##The messages to be sent globally when clicked + - '&a%PLAYER% clicked the EXP Item!' + SendToServer: null ##Send a player to the specified server on a Bungee network + ClickSound: LEVEL_UP ##The sound to be played once the player clicks the item + CloseOnClick: true ##If you want the GUI to close when the item is clicked + #-=-=-=-=-=-=-=-=-=-=-=-=-# + DefaultItem: + Item: COAL;0;0 ##The default item that will be used in the GUI (Format: ;;) + Name: '&8&lDefault' ##The default item name to be displayed in the GUI + Lore: ##The lore of the default item to be displayed in the GUI + - '&aThis default item will' + - '&abe shown if the player does' + - '&anot meet any of the other item' + - '&adisplay requirements.' + Enchant: null ##The enchantment to be put on the EXP item (Format: ;) + ConsoleCommands: ##The console commands to be executed when clicked (Use %PLAYER% for players name) + - xp give %PLAYER% 160 + PlayerCommands: ##The player commands to be executed when clicked + - spawn + CommandsCost: 0 ##The cost to execute the default commands (Set Ò0Ó to make the commands free) + PlayerMessages: ##The messages to be sent to the player when clicked + - null + BroadcastMessages: ##The messages to be sent globally when clicked + - '&a%PLAYER% clicked the Default Item!' + SendToServer: null ##Send a player to the specified server on a Bungee network + ClickSound: LEVEL_UP ##The sound to be played once the player clicks the item + CloseOnClick: true ##If you want the GUI to close when the item is clicked + #-=-=-=-=-=-=-=-=-=-=-=-=-# +#-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-# \ No newline at end of file diff --git a/src/me/jacobculley/customgui/Main.java b/src/me/jacobculley/customgui/Main.java new file mode 100644 index 0000000..134a06d --- /dev/null +++ b/src/me/jacobculley/customgui/Main.java @@ -0,0 +1,2236 @@ +package me.jacobculley.customgui; + +import java.io.File; +import java.io.FileNotFoundException; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Iterator; +import java.util.List; +import java.util.Set; + +import me.clip.placeholderapi.PlaceholderAPI; +import net.milkbowl.vault.economy.Economy; +import net.milkbowl.vault.permission.Permission; + +import org.bukkit.Bukkit; +import org.bukkit.ChatColor; +import org.bukkit.Material; +import org.bukkit.Sound; +import org.bukkit.command.Command; +import org.bukkit.command.CommandSender; +import org.bukkit.configuration.InvalidConfigurationException; +import org.bukkit.configuration.file.YamlConfiguration; +import org.bukkit.enchantments.Enchantment; +import org.bukkit.entity.Player; +import org.bukkit.event.EventHandler; +import org.bukkit.event.EventPriority; +import org.bukkit.event.Listener; +import org.bukkit.event.block.Action; +import org.bukkit.event.inventory.InventoryClickEvent; +import org.bukkit.event.player.PlayerCommandPreprocessEvent; +import org.bukkit.event.player.PlayerDropItemEvent; +import org.bukkit.event.player.PlayerInteractEvent; +import org.bukkit.inventory.Inventory; +import org.bukkit.inventory.InventoryHolder; +import org.bukkit.inventory.ItemStack; +import org.bukkit.inventory.meta.ItemMeta; +import org.bukkit.inventory.meta.SkullMeta; +import org.bukkit.plugin.RegisteredServiceProvider; +import org.bukkit.plugin.java.JavaPlugin; + +import com.google.common.io.ByteArrayDataOutput; +import com.google.common.io.ByteStreams; + +public class Main extends JavaPlugin implements Listener { + public static Economy economy = null; + public static Permission permission = null; + File Messages; + YamlConfiguration messagesFile; + + static { + Main.economy = null; + Main.permission = null; + } + + public Main() { + this.Messages = new File(this.getDataFolder(), "messages.yml"); + this.messagesFile = YamlConfiguration.loadConfiguration(this.Messages); + } + + @Override + public void onEnable() { + reloadConfig(); + this.getServer().getPluginManager().registerEvents(this, this); + this.getLogger().info("CustomGUI has been enabled!"); + this.saveDefaultConfig(); + this.reloadConfig(); + this.getServer().getMessenger().registerOutgoingPluginChannel(this, "BungeeCord"); + if (!this.Messages.exists()) { + try { + this.Messages.createNewFile(); + ArrayList list = new ArrayList(); + list.add("&aCustomGUI Commands"); + list.add("&7-----------------------------------"); + list.add("&e/customgui reload &7- Reloads the config file"); + list.add("&e/customgui open &7- Opens the specified GUI"); + list.add("&e/customgui setitem &7- Binds your item to the specified GUI"); + list.add("&e/customgui deleteitem &7- Unbinds your item from the specified GUI"); + this.messagesFile.set("HelpFormat", list); + this.messagesFile.set("NoPermsCommandMessage", + "&cYou do not have permission to execute this command!"); + this.messagesFile.set("NoPermsItemMessage", + "&cYou do not have permission to use this item!"); + this.messagesFile.set("InsufficientFundsMessage", + "&c&cYou need $%COMMANDSCOST% to use this item!"); + this.messagesFile.set("WhitelistedWorldMessage", + "&cYou cannot use this GUI in your current world!"); + this.messagesFile.set("InvalidGUIMessage", "&cPlease specify a valid GUI!"); + this.messagesFile.set("ItemAddedMessage", + "&aThe item has been added to the %GUI% inventory item list!"); + this.messagesFile.set("ItemRemovedMessage", + "&aThis item has been removed from the %GUI% inventory item list!"); + this.messagesFile.set("ItemDoesExistMessage", + "&cThis item already exists in the %GUI% inventory item list!"); + this.messagesFile.set("ItemDoesntExistMessage", + "&cThis item does not exist in the %GUI% inventory item list!"); + this.messagesFile.set("UnknownClickMethod", + "&cPlease specify right, left, or both as the click method!"); + this.messagesFile.set("UnknownCommandMessage", + "&cPlease enter /customgui help for a list of commands!"); + this.messagesFile.set("ReloadMessage", "&aCustomGUI has been reloaded!"); + } catch (IOException ex2) { + this.getLogger().severe( + String.format("[%s] - CustomGUI could not generate messages.yml", this + .getDescription().getName())); + } + } + try { + this.messagesFile.save(this.Messages); + } catch (IOException ex) { + ex.printStackTrace(); + } + if (this.setupEconomy()) { + this.getLogger().severe( + String.format("[%s] - CustomGUI has hooked into Vault - Economy", this + .getDescription().getName())); + } else { + this.getLogger().warning("Vault - Economy 载入失败!"); + } + if (this.setupAPI()) { + this.getLogger().severe( + String.format("[%s] - CustomGUI has hooked into PlaceholderAPI", this + .getDescription().getName())); + } + if (this.setupPermissions()) { + this.getLogger().severe( + String.format("[%s] - CustomGUI has hooked into Vault - Permission", this + .getDescription().getName())); + } else { + this.getLogger().warning("Vault - Permission 载入失败!"); + } + } + + @Override + public void onDisable() { + this.getLogger().info("CustomGUI has been disabled!"); + } + + private boolean setupAPI() { + return this.getServer().getPluginManager().getPlugin("PlaceholderAPI") != null; + } + + public boolean setupPermissions() { + RegisteredServiceProvider permissionProvider = getServer().getServicesManager() + .getRegistration(net.milkbowl.vault.permission.Permission.class); + if (permissionProvider != null) { + permission = permissionProvider.getProvider(); + } + return (permission != null); + } + + public boolean setupEconomy() { + RegisteredServiceProvider economyProvider = getServer().getServicesManager() + .getRegistration(net.milkbowl.vault.economy.Economy.class); + if (economyProvider != null) { + economy = economyProvider.getProvider(); + } + return (economy != null); + } + + public String sendMessage(Player player, String setPlaceholders) { + return setPlaceholders = PlaceholderAPI.setPlaceholders(player, setPlaceholders); + } + + @EventHandler( + priority = EventPriority.HIGHEST) + public void commandProcess(PlayerCommandPreprocessEvent playerCommandPreprocessEvent) { + Player player = playerCommandPreprocessEvent.getPlayer(); + Iterator iterator = this.getConfig().getConfigurationSection("GUI").getKeys(false) + .iterator(); + while (iterator.hasNext()) { + for (String s : this.getConfig() + .getStringList("GUI." + iterator.next() + ".GUICommand")) { + if (playerCommandPreprocessEvent.getMessage().equalsIgnoreCase("/" + s)) { + player.performCommand("customgui open " + s); + playerCommandPreprocessEvent.setCancelled(true); + } + } + } + } + + @SuppressWarnings("deprecation") + @EventHandler + public void onInventoryClick(InventoryClickEvent inventoryClickEvent) { + Player player = (Player) inventoryClickEvent.getWhoClicked(); + for (String s : this.getConfig().getConfigurationSection("GUI").getKeys(false)) { + String string = this.getConfig().getString("GUI." + s + ".ChestName", ""); + for (String s2 : this.getConfig().getConfigurationSection("GUI." + s + ".GUIItems") + .getKeys(false)) { + if (inventoryClickEvent + .getInventory() + .getTitle() + .contentEquals( + ChatColor.translateAlternateColorCodes( + '&', + string.replace("%PLAYER%", player.getName()) + .replace( + "%BALANCE%", + new StringBuilder().append( + Main.economy.getBalance(player)) + .toString()) + .replace( + "%PLAYERLEVEL%", + new StringBuilder().append( + player.getLevel()).toString())))) { + if (inventoryClickEvent.getRawSlot() == this.getConfig().getInt( + "GUI." + s + ".GUIItems." + s2 + ".ItemSlot")) { + for (String s3 : this.getConfig() + .getConfigurationSection("GUI." + s + ".GUIItems." + s2) + .getKeys(false)) { + String string2 = this.getConfig().getString( + "GUI." + s + ".GUIItems." + s2 + ".Permission", ""); + List stringList = this.getConfig().getStringList( + "GUI." + s + ".GUIItems." + s2 + "." + s3 + ".ConsoleCommands"); + List stringList2 = this.getConfig().getStringList( + "GUI." + s + ".GUIItems." + s2 + "." + s3 + ".PlayerCommands"); + List stringList3 = this.getConfig().getStringList( + "GUI." + s + ".GUIItems." + s2 + "." + s3 + ".PlayerMessages"); + List stringList4 = this.getConfig().getStringList( + "GUI." + s + ".GUIItems." + s2 + "." + s3 + + ".BroadcastMessages"); + String upperCase = this + .getConfig() + .getString( + "GUI." + s + ".GUIItems." + s2 + "." + s3 + + ".ClickSound", "").toUpperCase(); + String upperCase2 = this + .getConfig() + .getString( + "GUI." + s + ".GUIItems." + s2 + ".NoPermsClickSound", + "").toUpperCase(); + boolean boolean1 = this.getConfig().getBoolean( + "GUI." + s + ".GUIItems." + s2 + "." + s3 + ".CloseOnClick"); + double n = this.getConfig().getInt( + "GUI." + s + ".GUIItems." + s2 + "." + s3 + ".CommandsCost"); + if (inventoryClickEvent + .getCurrentItem() + .getItemMeta() + .getDisplayName() + .contentEquals( + ChatColor.translateAlternateColorCodes( + '&', + this.sendMessage( + player, + this.getConfig() + .getString( + "GUI." + s + + ".GUIItems." + + s2 + "." + s3 + + ".Name", "") + .replace("%PLAYER%", + player.getName()) + .replace( + "%BALANCE%", + new StringBuilder() + .append(Main.economy + .getBalance(player)) + .toString()) + .replace( + "%PLAYERLEVEL%", + new StringBuilder() + .append(player + .getLevel()) + .toString()) + .replace( + "%COMMANDSCOST%", + new StringBuilder() + .append(n) + .toString()))))) { + if (player.hasPermission(string2) || string2.isEmpty()) { + if (Main.economy.getBalance(player) >= n || n == 0.0) { + if (boolean1) { + player.closeInventory(); + } else { + inventoryClickEvent.setCancelled(true); + } + if (!upperCase.isEmpty()) { + float n2 = 1.0f; + player.playSound(player.getLocation(), + Sound.valueOf(upperCase), n2, n2); + } + if (n != 0.0) { + Main.economy.withdrawPlayer(player, n); + } + for (String s4 : stringList) { + if (s4.contains("[RIGHT-CLICK]")) { + if (!inventoryClickEvent.isRightClick()) { + continue; + } + this.getServer() + .dispatchCommand( + Bukkit.getConsoleSender(), + this.sendMessage(player, s4) + .replace("%PLAYER%", + player.getName()) + .replace( + "%BALANCE%", + new StringBuilder() + .append(Main.economy + .getBalance(player)) + .toString()) + .replace( + "%PLAYERLEVEL%", + new StringBuilder() + .append(player + .getLevel()) + .toString()) + .replace( + "%COMMANDSCOST%", + new StringBuilder() + .append(n) + .toString()) + .replace("[RIGHT-CLICK]", + "") + .replace("[LEFT-CLICK]", "")); + } else if (s4.contains("[LEFT-CLICK]")) { + if (!inventoryClickEvent.isLeftClick()) { + continue; + } + this.getServer() + .dispatchCommand( + Bukkit.getConsoleSender(), + this.sendMessage(player, s4) + .replace("%PLAYER%", + player.getName()) + .replace( + "%BALANCE%", + new StringBuilder() + .append(Main.economy + .getBalance(player)) + .toString()) + .replace( + "%PLAYERLEVEL%", + new StringBuilder() + .append(player + .getLevel()) + .toString()) + .replace( + "%COMMANDSCOST%", + new StringBuilder() + .append(n) + .toString()) + .replace("[RIGHT-CLICK]", + "") + .replace("[LEFT-CLICK]", "")); + } else { + if (s4.contains("[RIGHT-CLICK]") + && s4.contains("[LEFT-CLICK]")) { + continue; + } + this.getServer() + .dispatchCommand( + Bukkit.getConsoleSender(), + this.sendMessage(player, s4) + .replace("%PLAYER%", + player.getName()) + .replace( + "%BALANCE%", + new StringBuilder() + .append(Main.economy + .getBalance(player)) + .toString()) + .replace( + "%PLAYERLEVEL%", + new StringBuilder() + .append(player + .getLevel()) + .toString()) + .replace( + "%COMMANDSCOST%", + new StringBuilder() + .append(n) + .toString()) + .replace("[RIGHT-CLICK]", + "") + .replace("[LEFT-CLICK]", "")); + } + } + for (String s5 : stringList2) { + if (s5.contains("[RIGHT-CLICK]")) { + if (!inventoryClickEvent.isRightClick()) { + continue; + } + this.getServer() + .dispatchCommand( + player, + this.sendMessage(player, s5) + .replace("%PLAYER%", + player.getName()) + .replace( + "%BALANCE%", + new StringBuilder() + .append(Main.economy + .getBalance(player)) + .toString()) + .replace( + "%PLAYERLEVEL%", + new StringBuilder() + .append(player + .getLevel()) + .toString()) + .replace( + "%COMMANDSCOST%", + new StringBuilder() + .append(n) + .toString()) + .replace("[RIGHT-CLICK]", + "") + .replace("[LEFT-CLICK]", "")); + } else if (s5.contains("[LEFT-CLICK]")) { + if (!inventoryClickEvent.isLeftClick()) { + continue; + } + this.getServer() + .dispatchCommand( + player, + this.sendMessage(player, s5) + .replace("%PLAYER%", + player.getName()) + .replace( + "%BALANCE%", + new StringBuilder() + .append(Main.economy + .getBalance(player)) + .toString()) + .replace( + "%PLAYERLEVEL%", + new StringBuilder() + .append(player + .getLevel()) + .toString()) + .replace( + "%COMMANDSCOST%", + new StringBuilder() + .append(n) + .toString()) + .replace("[RIGHT-CLICK]", + "") + .replace("[LEFT-CLICK]", "")); + } else { + if (s5.contains("[RIGHT-CLICK]") + && s5.contains("[LEFT-CLICK]")) { + continue; + } + this.getServer() + .dispatchCommand( + player, + this.sendMessage(player, s5) + .replace("%PLAYER%", + player.getName()) + .replace( + "%BALANCE%", + new StringBuilder() + .append(Main.economy + .getBalance(player)) + .toString()) + .replace( + "%PLAYERLEVEL%", + new StringBuilder() + .append(player + .getLevel()) + .toString()) + .replace( + "%COMMANDSCOST%", + new StringBuilder() + .append(n) + .toString()) + .replace("[RIGHT-CLICK]", + "") + .replace("[LEFT-CLICK]", "")); + } + } + for (String s6 : stringList3) { + if (s6.contains("[RIGHT-CLICK]")) { + if (!inventoryClickEvent.isRightClick()) { + continue; + } + player.sendMessage(ChatColor + .translateAlternateColorCodes( + '&', + this.sendMessage(player, s6) + .replace("%PLAYER%", + player.getName()) + .replace( + "%BALANCE%", + new StringBuilder() + .append(Main.economy + .getBalance(player)) + .toString()) + .replace( + "%PLAYERLEVEL%", + new StringBuilder() + .append(player + .getLevel()) + .toString()) + .replace( + "%COMMANDSCOST%", + new StringBuilder() + .append(n) + .toString()) + .replace("[RIGHT-CLICK]", + "") + .replace("[LEFT-CLICK]", ""))); + } else if (s6.contains("[LEFT-CLICK]")) { + if (!inventoryClickEvent.isLeftClick()) { + continue; + } + player.sendMessage(ChatColor + .translateAlternateColorCodes( + '&', + this.sendMessage(player, s6) + .replace("%PLAYER%", + player.getName()) + .replace( + "%BALANCE%", + new StringBuilder() + .append(Main.economy + .getBalance(player)) + .toString()) + .replace( + "%PLAYERLEVEL%", + new StringBuilder() + .append(player + .getLevel()) + .toString()) + .replace( + "%COMMANDSCOST%", + new StringBuilder() + .append(n) + .toString()) + .replace("[RIGHT-CLICK]", + "") + .replace("[LEFT-CLICK]", ""))); + } else { + if (s6.contains("[RIGHT-CLICK]") + && s6.contains("[LEFT-CLICK]")) { + continue; + } + player.sendMessage(ChatColor + .translateAlternateColorCodes( + '&', + this.sendMessage(player, s6) + .replace("%PLAYER%", + player.getName()) + .replace( + "%BALANCE%", + new StringBuilder() + .append(Main.economy + .getBalance(player)) + .toString()) + .replace( + "%PLAYERLEVEL%", + new StringBuilder() + .append(player + .getLevel()) + .toString()) + .replace( + "%COMMANDSCOST%", + new StringBuilder() + .append(n) + .toString()) + .replace("[RIGHT-CLICK]", + "") + .replace("[LEFT-CLICK]", ""))); + } + } + for (String s7 : stringList4) { + if (s7.contains("[RIGHT-CLICK]")) { + if (!inventoryClickEvent.isRightClick()) { + continue; + } + this.getServer() + .broadcastMessage( + ChatColor + .translateAlternateColorCodes( + '&', + this.sendMessage( + player, s7) + .replace( + "%PLAYER%", + player.getName()) + .replace( + "%BALANCE%", + new StringBuilder() + .append(Main.economy + .getBalance(player)) + .toString()) + .replace( + "%PLAYERLEVEL%", + new StringBuilder() + .append(player + .getLevel()) + .toString()) + .replace( + "%COMMANDSCOST%", + new StringBuilder() + .append(n) + .toString()) + .replace( + "[RIGHT-CLICK]", + "") + .replace( + "[LEFT-CLICK]", + ""))); + } else if (s7.contains("[LEFT-CLICK]")) { + if (!inventoryClickEvent.isLeftClick()) { + continue; + } + this.getServer() + .broadcastMessage( + ChatColor + .translateAlternateColorCodes( + '&', + this.sendMessage( + player, s7) + .replace( + "%PLAYER%", + player.getName()) + .replace( + "%BALANCE%", + new StringBuilder() + .append(Main.economy + .getBalance(player)) + .toString()) + .replace( + "%PLAYERLEVEL%", + new StringBuilder() + .append(player + .getLevel()) + .toString()) + .replace( + "%COMMANDSCOST%", + new StringBuilder() + .append(n) + .toString()) + .replace( + "[RIGHT-CLICK]", + "") + .replace( + "[LEFT-CLICK]", + ""))); + } else { + if (s7.contains("[RIGHT-CLICK]") + && s7.contains("[LEFT-CLICK]")) { + continue; + } + this.getServer() + .broadcastMessage( + ChatColor + .translateAlternateColorCodes( + '&', + this.sendMessage( + player, s7) + .replace( + "%PLAYER%", + player.getName()) + .replace( + "%BALANCE%", + new StringBuilder() + .append(Main.economy + .getBalance(player)) + .toString()) + .replace( + "%PLAYERLEVEL%", + new StringBuilder() + .append(player + .getLevel()) + .toString()) + .replace( + "%COMMANDSCOST%", + new StringBuilder() + .append(n) + .toString()) + .replace( + "[RIGHT-CLICK]", + "") + .replace( + "[LEFT-CLICK]", + ""))); + } + } + if (!this.getConfig().getBoolean("GUI." + s + ".Bungee") + || this.getConfig() + .getString( + "GUI." + s + ".GUIItems." + s2 + + "." + s3 + + ".SendToServer", "") + .isEmpty()) { + continue; + } + ByteArrayDataOutput dataOutput = ByteStreams + .newDataOutput(); + dataOutput.writeUTF("Connect"); + dataOutput.writeUTF(this.getConfig().getString( + "GUI." + s + ".GUIItems." + s2 + "." + s3 + + ".SendToServer", "")); + Bukkit.getPlayer(player.getName()).sendPluginMessage(this, + "BungeeCord", dataOutput.toByteArray()); + } else { + player.closeInventory(); + player.sendMessage(this.sendMessage( + player, + ChatColor + .translateAlternateColorCodes( + '&', + this.messagesFile + .getString( + "InsufficientFundsMessage") + .replace("%PLAYER%", + player.getName()) + .replace( + "%BALANCE%", + new StringBuilder() + .append(Main.economy + .getBalance(player)) + .toString()) + .replace( + "%PLAYERLEVEL%", + new StringBuilder() + .append(player + .getLevel()) + .toString()) + .replace( + "%COMMANDSCOST%", + new StringBuilder() + .append(n) + .toString())))); + if (upperCase2.isEmpty()) { + continue; + } + float n3 = 1.0f; + player.playSound(player.getLocation(), + Sound.valueOf(upperCase2), n3, n3); + } + } else { + player.closeInventory(); + player.sendMessage(this.sendMessage( + player, + ChatColor + .translateAlternateColorCodes( + '&', + this.messagesFile + .getString("NoPermsItemMessage") + .replace("%PLAYER%", + player.getName()) + .replace( + "%BALANCE%", + new StringBuilder() + .append(Main.economy + .getBalance(player)) + .toString()) + .replace( + "%PLAYERLEVEL%", + new StringBuilder() + .append(player + .getLevel()) + .toString()) + .replace( + "%COMMANDSCOST%", + new StringBuilder() + .append(n) + .toString())))); + if (upperCase2.isEmpty()) { + continue; + } + float n4 = 1.0f; + player.playSound(player.getLocation(), + Sound.valueOf(upperCase2), n4, n4); + } + } + } + inventoryClickEvent.setCancelled(true); + } + inventoryClickEvent.setCancelled(true); + } else { + if (this.getConfig().getBoolean("GUI." + s + ".InventoryGUIItemMovement")) { + continue; + } + List stringList5 = this.getConfig().getStringList( + "GUI." + s + ".InventoryGUIItems"); + for (int i = 0; i < stringList5.size(); ++i) { + String[] split = stringList5.get(i).split(";"); + if (inventoryClickEvent.getCurrentItem().getType() == Material + .getMaterial(split[1]) + && inventoryClickEvent.getCurrentItem().getData().getData() == (byte) Integer + .parseInt(split[2]) + && inventoryClickEvent + .getCurrentItem() + .getItemMeta() + .getDisplayName() + .contentEquals( + ChatColor.translateAlternateColorCodes('&', + split[0])) + && inventoryClickEvent.getCurrentItem().getEnchantments() + .toString().contentEquals(split[3])) { + inventoryClickEvent.setCancelled(true); + } + } + } + } + } + } + + @SuppressWarnings("deprecation") + @EventHandler + public void playerDropEvent(PlayerDropItemEvent playerDropItemEvent) { + for (String s : this.getConfig().getConfigurationSection("GUI").getKeys(false)) { + if (!this.getConfig().getBoolean("GUI." + s + ".InventoryGUIItemMovement")) { + List stringList = this.getConfig().getStringList( + "GUI." + s + ".InventoryGUIItems"); + for (int i = 0; i < stringList.size(); ++i) { + String[] split = stringList.get(i).split(";"); + if (playerDropItemEvent.getItemDrop().getItemStack().getType() == Material + .getMaterial(split[1]) + && playerDropItemEvent.getItemDrop().getItemStack().getData().getData() == (byte) Integer + .parseInt(split[2]) + && playerDropItemEvent + .getItemDrop() + .getItemStack() + .getItemMeta() + .getDisplayName() + .contentEquals( + ChatColor.translateAlternateColorCodes('&', split[0])) + && playerDropItemEvent.getItemDrop().getItemStack().getEnchantments() + .toString().contentEquals(split[3])) { + playerDropItemEvent.setCancelled(true); + } + } + } + } + } + + @SuppressWarnings("deprecation") + @EventHandler + public void playerInteract(PlayerInteractEvent playerInteractEvent) { + if (playerInteractEvent.getAction() == Action.RIGHT_CLICK_BLOCK + || playerInteractEvent.getAction() == Action.RIGHT_CLICK_AIR) { + Player player = playerInteractEvent.getPlayer(); + for (String s : this.getConfig().getConfigurationSection("GUI").getKeys(false)) { + List stringList = this.getConfig().getStringList( + "GUI." + s + ".InventoryGUIItems"); + for (int i = 0; i < stringList.size(); ++i) { + String[] split = stringList.get(i).split(";"); + if ((split[4].equalsIgnoreCase("both") || split[4].equalsIgnoreCase("right")) + && playerInteractEvent.getItem().getType() == Material + .getMaterial(split[1]) + && playerInteractEvent.getItem().getData().getData() == (byte) Integer + .parseInt(split[2]) + && playerInteractEvent + .getItem() + .getItemMeta() + .getDisplayName() + .contentEquals( + ChatColor.translateAlternateColorCodes('&', split[0])) + && playerInteractEvent.getItem().getEnchantments().toString() + .contentEquals(split[3])) { + player.performCommand("customgui open " + + this.getConfig().getStringList("GUI." + s + ".GUICommand").get(0)); + playerInteractEvent.setCancelled(true); + } + } + } + } + if (playerInteractEvent.getAction() == Action.LEFT_CLICK_BLOCK + || playerInteractEvent.getAction() == Action.LEFT_CLICK_AIR) { + Player player2 = playerInteractEvent.getPlayer(); + for (String s2 : this.getConfig().getConfigurationSection("GUI").getKeys(false)) { + List stringList2 = this.getConfig().getStringList( + "GUI." + s2 + ".InventoryGUIItems"); + for (int j = 0; j < stringList2.size(); ++j) { + String[] split2 = stringList2.get(j).split(";"); + if ((split2[4].equalsIgnoreCase("both") || split2[4].equalsIgnoreCase("left")) + && playerInteractEvent.getItem().getType() == Material + .getMaterial(split2[1]) + && playerInteractEvent.getItem().getData().getData() == (byte) Integer + .parseInt(split2[2]) + && playerInteractEvent + .getItem() + .getItemMeta() + .getDisplayName() + .contentEquals( + ChatColor.translateAlternateColorCodes('&', split2[0])) + && playerInteractEvent.getItem().getEnchantments().toString() + .contentEquals(split2[3])) { + player2.performCommand("customgui open " + + this.getConfig().getStringList("GUI." + s2 + ".GUICommand") + .get(0)); + playerInteractEvent.setCancelled(true); + } + } + } + } + } + + @Override + @SuppressWarnings("deprecation") + public boolean onCommand(CommandSender commandSender, Command command, String s, String[] array) { + Player player = null; + if (commandSender instanceof Player) { + player = (Player) commandSender; + } else { + this.getServer().getConsoleSender().sendMessage("&c控制å°æ— æ³•ä½¿ç”¨æ­¤å‘½ä»¤!"); + return true; + } + if (command.getName().equalsIgnoreCase("customgui")) { + if (array.length == 0) { + if (player.hasPermission("customgui.help")) { + Iterator iterator = this.messagesFile.getStringList("HelpFormat") + .iterator(); + while (iterator.hasNext()) { + player.sendMessage(ChatColor.translateAlternateColorCodes('&', + iterator.next())); + } + } else { + player.sendMessage(ChatColor.translateAlternateColorCodes('&', this + .sendMessage( + player, + this.messagesFile + .getString("NoPermsCommandMessage") + .replace("%PLAYER%", player.getName()) + .replace( + "%BALANCE%", + new StringBuilder().append( + Main.economy.getBalance(player)) + .toString()) + .replace( + "%PLAYERLEVEL%", + new StringBuilder().append(player.getLevel()) + .toString())))); + } + return false; + } + if (array[0].equalsIgnoreCase("reload")) { + if (player.hasPermission("customgui.reload")) { + this.reloadConfig(); + try { + this.messagesFile.load(this.Messages); + } catch (FileNotFoundException ex) { + ex.printStackTrace(); + } catch (IOException ex2) { + ex2.printStackTrace(); + } catch (InvalidConfigurationException ex3) { + ex3.printStackTrace(); + } + this.getLogger().info("CustomGUI has been reloaded!"); + player.sendMessage(ChatColor.translateAlternateColorCodes('&', this + .sendMessage( + player, + this.messagesFile + .getString("ReloadMessage") + .replace("%PLAYER%", player.getName()) + .replace( + "%BALANCE%", + new StringBuilder().append( + Main.economy.getBalance(player)) + .toString()) + .replace( + "%PLAYERLEVEL%", + new StringBuilder().append(player.getLevel()) + .toString())))); + } else { + player.sendMessage(ChatColor.translateAlternateColorCodes('&', this + .sendMessage( + player, + this.messagesFile + .getString("NoPermsCommandMessage") + .replace("%PLAYER%", player.getName()) + .replace( + "%BALANCE%", + new StringBuilder().append( + Main.economy.getBalance(player)) + .toString()) + .replace( + "%PLAYERLEVEL%", + new StringBuilder().append(player.getLevel()) + .toString())))); + } + } else if (array[0].equalsIgnoreCase("help")) { + if (player.hasPermission("customgui.help")) { + Iterator iterator2 = this.messagesFile.getStringList("HelpFormat") + .iterator(); + while (iterator2.hasNext()) { + player.sendMessage(ChatColor.translateAlternateColorCodes('&', + this.sendMessage(player, iterator2.next()))); + } + } else { + player.sendMessage(ChatColor.translateAlternateColorCodes('&', this + .sendMessage( + player, + this.messagesFile + .getString("NoPermsCommandMessage") + .replace("%PLAYER%", player.getName()) + .replace( + "%BALANCE%", + new StringBuilder().append( + Main.economy.getBalance(player)) + .toString()) + .replace( + "%PLAYERLEVEL%", + new StringBuilder().append(player.getLevel()) + .toString())))); + } + } else if (array[0].equalsIgnoreCase("setitem") && array.length == 3) { + if (player.hasPermission("customgui.setitem")) { + if (this.getConfig().getConfigurationSection("GUI").getKeys(false) + .contains(array[1])) { + if (array[2].equalsIgnoreCase("both") || array[2].equalsIgnoreCase("right") + || array[2].equalsIgnoreCase("left")) { + List stringList = this.getConfig().getStringList( + "GUI." + array[1] + ".InventoryGUIItems"); + String displayName = player.getItemInHand().getItemMeta() + .getDisplayName(); + String string = player.getItemInHand().getEnchantments().toString(); + String name = player.getItemInHand().getType().name(); + byte data = player.getItemInHand().getData().getData(); + if (!stringList.contains(String.valueOf(displayName) + ";" + name + ";" + + data + ";" + string + ";" + array[2].toUpperCase())) { + stringList.add(String.valueOf(displayName) + ";" + name + ";" + + data + ";" + string + ";" + array[2].toUpperCase()); + this.getConfig().set("GUI." + array[1] + ".InventoryGUIItems", + stringList); + this.saveConfig(); + player.sendMessage(ChatColor.translateAlternateColorCodes( + '&', + this.sendMessage( + player, + this.messagesFile + .getString("ItemAddedMessage") + .replace("%PLAYER%", player.getName()) + .replace( + "%BALANCE%", + new StringBuilder() + .append(Main.economy + .getBalance(player)) + .toString()) + .replace( + "%PLAYERLEVEL%", + new StringBuilder().append( + player.getLevel()) + .toString()) + .replace("%GUI%", array[1])))); + } else { + player.sendMessage(ChatColor.translateAlternateColorCodes( + '&', + this.sendMessage( + player, + this.messagesFile + .getString("ItemDoesExistMessage") + .replace("%PLAYER%", player.getName()) + .replace( + "%BALANCE%", + new StringBuilder() + .append(Main.economy + .getBalance(player)) + .toString()) + .replace( + "%PLAYERLEVEL%", + new StringBuilder().append( + player.getLevel()) + .toString()) + .replace("%GUI%", array[1])))); + } + } else { + player.sendMessage(ChatColor.translateAlternateColorCodes('&', this + .sendMessage( + player, + this.messagesFile + .getString("UnknownClickMethod") + .replace("%PLAYER%", player.getName()) + .replace( + "%BALANCE%", + new StringBuilder() + .append(Main.economy + .getBalance(player)) + .toString()) + .replace( + "%PLAYERLEVEL%", + new StringBuilder().append( + player.getLevel()).toString())))); + } + } else { + player.sendMessage(ChatColor.translateAlternateColorCodes('&', this + .sendMessage( + player, + this.messagesFile + .getString("InvalidGUIMessage") + .replace("%PLAYER%", player.getName()) + .replace( + "%BALANCE%", + new StringBuilder().append( + Main.economy.getBalance(player)) + .toString()) + .replace( + "%PLAYERLEVEL%", + new StringBuilder().append( + player.getLevel()).toString())))); + } + } else { + player.sendMessage(ChatColor.translateAlternateColorCodes( + '&', + this.messagesFile + .getString("NoPermsCommandMessage") + .replace("%PLAYER%", player.getName()) + .replace( + "%BALANCE%", + new StringBuilder().append( + Main.economy.getBalance(player)).toString()) + .replace( + "%PLAYERLEVEL%", + new StringBuilder().append(player.getLevel()) + .toString()))); + } + } else if (array[0].equalsIgnoreCase("deleteitem") && array.length == 2) { + if (player.hasPermission("customgui.deleteitem")) { + if (this.getConfig().getConfigurationSection("GUI").getKeys(false) + .contains(array[1])) { + List stringList2 = this.getConfig().getStringList( + "GUI." + array[1] + ".InventoryGUIItems"); + String displayName2 = player.getItemInHand().getItemMeta().getDisplayName(); + String string2 = player.getItemInHand().getEnchantments().toString(); + String name2 = player.getItemInHand().getType().name(); + byte data2 = player.getItemInHand().getData().getData(); + if (stringList2.contains(String.valueOf(displayName2) + ";" + name2 + ";" + + data2 + ";" + string2 + ";" + "RIGHT") + || stringList2.contains(String.valueOf(displayName2) + ";" + name2 + + ";" + data2 + ";" + string2 + ";" + "LEFT") + || stringList2.contains(String.valueOf(displayName2) + ";" + name2 + + ";" + data2 + ";" + string2 + ";" + "BOTH")) { + ArrayList list = new ArrayList(); + list.add("RIGHT"); + list.add("LEFT"); + list.add("BOTH"); + Iterator iterator3 = list.iterator(); + while (iterator3.hasNext()) { + stringList2.remove(String.valueOf(displayName2) + ";" + name2 + ";" + + data2 + ";" + string2 + ";" + iterator3.next()); + this.getConfig().set("GUI." + array[1] + ".InventoryGUIItems", + stringList2); + this.saveConfig(); + } + player.sendMessage(ChatColor.translateAlternateColorCodes('&', this + .sendMessage( + player, + this.messagesFile + .getString("ItemRemovedMessage") + .replace("%PLAYER%", player.getName()) + .replace( + "%BALANCE%", + new StringBuilder() + .append(Main.economy + .getBalance(player)) + .toString()) + .replace( + "%PLAYERLEVEL%", + new StringBuilder().append( + player.getLevel()).toString()) + .replace("%GUI%", array[1])))); + } else { + player.sendMessage(ChatColor.translateAlternateColorCodes('&', this + .sendMessage( + player, + this.messagesFile + .getString("ItemDoesntExistMessage") + .replace("%PLAYER%", player.getName()) + .replace( + "%BALANCE%", + new StringBuilder() + .append(Main.economy + .getBalance(player)) + .toString()) + .replace( + "%PLAYERLEVEL%", + new StringBuilder().append( + player.getLevel()).toString()) + .replace("%GUI%", array[1])))); + } + } else { + player.sendMessage(ChatColor.translateAlternateColorCodes('&', this + .sendMessage( + player, + this.messagesFile + .getString("InvalidGUIMessage") + .replace("%PLAYER%", player.getName()) + .replace( + "%BALANCE%", + new StringBuilder().append( + Main.economy.getBalance(player)) + .toString()) + .replace( + "%PLAYERLEVEL%", + new StringBuilder().append( + player.getLevel()).toString())))); + } + } else { + player.sendMessage(ChatColor.translateAlternateColorCodes('&', this + .sendMessage( + player, + this.messagesFile + .getString("NoPermsCommandMessage") + .replace("%PLAYER%", player.getName()) + .replace( + "%BALANCE%", + new StringBuilder().append( + Main.economy.getBalance(player)) + .toString()) + .replace( + "%PLAYERLEVEL%", + new StringBuilder().append(player.getLevel()) + .toString())))); + } + } else if (array[0].equalsIgnoreCase("open") && array.length == 2) { + Set keys = this.getConfig().getConfigurationSection("GUI").getKeys(false); + for (String s2 : keys) { + Iterator iterator5 = this.getConfig() + .getStringList("GUI." + s2 + ".GUICommand").iterator(); + while (iterator5.hasNext()) { + if (array[1].equalsIgnoreCase(iterator5.next())) { + if (keys.contains(s2)) { + String string3 = this.getConfig().getString( + "GUI." + s2 + ".GUIPermission", ""); + List stringList3 = this.getConfig().getStringList( + "GUI." + s2 + ".WhitelistedWorlds"); + if (stringList3.contains(player.getWorld().getName()) + || stringList3 == null || stringList3.isEmpty()) { + if (player.hasPermission(string3)) { + String string4 = this.getConfig().getString( + "GUI." + s2 + ".ChestName", ""); + int int1 = this.getConfig().getInt( + "GUI." + s2 + ".ChestSize"); + Set keys2 = this.getConfig() + .getConfigurationSection("GUI." + s2 + ".GUIItems") + .getKeys(false); + Inventory inventory = Bukkit + .createInventory( + (InventoryHolder) null, + int1, + ChatColor + .translateAlternateColorCodes( + '&', + string4.replace("%PLAYER%", + player.getName()) + .replace( + "%BALANCE%", + new StringBuilder() + .append(Main.economy + .getBalance(player)) + .toString()) + .replace( + "%PLAYERLEVEL%", + new StringBuilder() + .append(player + .getLevel()) + .toString()))); + for (String s3 : keys2) { + Double value = this.getConfig().getDouble( + "GUI." + s2 + ".GUIItems." + s3 + + ".OPItem.CommandsCost"); + Double value2 = this.getConfig().getDouble( + "GUI." + s2 + ".GUIItems." + s3 + + ".PermissionItem.CommandsCost"); + Double value3 = this.getConfig().getDouble( + "GUI." + s2 + ".GUIItems." + s3 + + ".BalanceItem.CommandsCost"); + Double value4 = this.getConfig().getDouble( + "GUI." + s2 + ".GUIItems." + s3 + + ".EXPItem.CommandsCost"); + Double value5 = this.getConfig().getDouble( + "GUI." + s2 + ".GUIItems." + s3 + + ".DefaultItem.CommandsCost"); + String[] split = this + .getConfig() + .getString( + "GUI." + s2 + ".GUIItems." + s3 + + ".OPItem.Item", "") + .toUpperCase().split(";"); + String string5 = this.getConfig().getString( + "GUI." + s2 + ".GUIItems." + s3 + + ".OPItem.Name", ""); + List stringList4 = this.getConfig() + .getStringList( + "GUI." + s2 + ".GUIItems." + s3 + + ".OPItem.Lore"); + String[] split2 = this + .getConfig() + .getString( + "GUI." + s2 + ".GUIItems." + s3 + + ".OPItem.Enchant", "") + .toUpperCase().split(";"); + String s4 = split2[0]; + String string6 = this.getConfig().getString( + "GUI." + s2 + ".GUIItems." + s3 + + ".PermissionItem.Permission", ""); + String[] split3 = this + .getConfig() + .getString( + "GUI." + s2 + ".GUIItems." + s3 + + ".PermissionItem.Item", "") + .toUpperCase().split(";"); + String string7 = this.getConfig().getString( + "GUI." + s2 + ".GUIItems." + s3 + + ".PermissionItem.Name", ""); + List stringList5 = this.getConfig() + .getStringList( + "GUI." + s2 + ".GUIItems." + s3 + + ".PermissionItem.Lore"); + String[] split4 = this + .getConfig() + .getString( + "GUI." + s2 + ".GUIItems." + s3 + + ".PermissionItem.Enchant", "") + .toUpperCase().split(";"); + String s5 = split4[0]; + int int2 = this.getConfig().getInt( + "GUI." + s2 + ".GUIItems." + s3 + + ".BalanceItem.Balance"); + String[] split5 = this + .getConfig() + .getString( + "GUI." + s2 + ".GUIItems." + s3 + + ".BalanceItem.Item", "") + .toUpperCase().split(";"); + String string8 = this.getConfig().getString( + "GUI." + s2 + ".GUIItems." + s3 + + ".BalanceItem.Name", ""); + List stringList6 = this.getConfig() + .getStringList( + "GUI." + s2 + ".GUIItems." + s3 + + ".BalanceItem.Lore"); + String[] split6 = this + .getConfig() + .getString( + "GUI." + s2 + ".GUIItems." + s3 + + ".BalanceItem.Enchant", "") + .toUpperCase().split(";"); + String s6 = split6[0]; + int int3 = this.getConfig().getInt( + "GUI." + s2 + ".GUIItems." + s3 + + ".EXPItem.Level"); + String[] split7 = this + .getConfig() + .getString( + "GUI." + s2 + ".GUIItems." + s3 + + ".EXPItem.Item", "") + .toUpperCase().split(";"); + String string9 = this.getConfig().getString( + "GUI." + s2 + ".GUIItems." + s3 + + ".EXPItem.Name", ""); + List stringList7 = this.getConfig() + .getStringList( + "GUI." + s2 + ".GUIItems." + s3 + + ".EXPItem.Lore"); + String[] split8 = this + .getConfig() + .getString( + "GUI." + s2 + ".GUIItems." + s3 + + ".EXPItem.Enchant", "") + .toUpperCase().split(";"); + String s7 = split8[0]; + String[] split9 = this + .getConfig() + .getString( + "GUI." + s2 + ".GUIItems." + s3 + + ".DefaultItem.Item", "") + .toUpperCase().split(";"); + String string10 = this.getConfig().getString( + "GUI." + s2 + ".GUIItems." + s3 + + ".DefaultItem.Name", ""); + List stringList8 = this.getConfig() + .getStringList( + "GUI." + s2 + ".GUIItems." + s3 + + ".DefaultItem.Lore"); + String[] split10 = this + .getConfig() + .getString( + "GUI." + s2 + ".GUIItems." + s3 + + ".DefaultItem.Enchant", "") + .toUpperCase().split(";"); + String s8 = split10[0]; + int int4 = this.getConfig().getInt( + "GUI." + s2 + ".GUIItems." + s3 + ".ItemSlot"); + if (player.isOp() + && this.getConfig().getBoolean( + "GUI." + s2 + ".OPItem")) { + if (split[0].equalsIgnoreCase("SKULL_ITEM")) { + ItemStack itemStack = new ItemStack( + Material.SKULL_ITEM, + Integer.parseInt(split[1]), (short) 3); + SkullMeta itemMeta = (SkullMeta) itemStack + .getItemMeta(); + itemMeta.setOwner(split[2].replace("%PLAYER%", + player.getName())); + itemMeta.setDisplayName(ChatColor.translateAlternateColorCodes( + '&', + this.sendMessage( + player, + string5.replace("%PLAYER%", + player.getName()) + .replace( + "%BALANCE%", + new StringBuilder() + .append(Main.economy + .getBalance(player)) + .toString()) + .replace( + "%PLAYERLEVEL%", + new StringBuilder() + .append(player + .getLevel()) + .toString()) + .replace( + "%COMMANDSCOST%", + new StringBuilder() + .append(value) + .toString())))); + ArrayList lore = new ArrayList(); + if (!stringList4.isEmpty()) { + Iterator iterator7 = stringList4 + .iterator(); + while (iterator7.hasNext()) { + lore.add(ChatColor.translateAlternateColorCodes( + '&', + this.sendMessage( + player, + iterator7 + .next() + .replace( + "%PLAYER%", + player.getName()) + .replace( + "%BALANCE%", + new StringBuilder() + .append(Main.economy + .getBalance(player)) + .toString()) + .replace( + "%PLAYERLEVEL%", + new StringBuilder() + .append(player + .getLevel()) + .toString()) + .replace( + "%COMMANDSCOST%", + new StringBuilder() + .append(value) + .toString())))); + } + } + itemMeta.setLore(lore); + itemStack.setItemMeta(itemMeta); + if (!s4.isEmpty()) { + itemStack.addUnsafeEnchantment( + Enchantment.getByName(split2[0]), + Integer.parseInt(split2[1])); + } + inventory.setItem(int4, itemStack); + } else { + ItemStack itemStack2 = new ItemStack( + Material.getMaterial(split[0]), + Integer.parseInt(split[1]), + (byte) Integer.parseInt(split[2])); + ItemMeta itemMeta2 = itemStack2.getItemMeta(); + itemMeta2 + .setDisplayName(ChatColor.translateAlternateColorCodes( + '&', + this.sendMessage( + player, + string5.replace( + "%PLAYER%", + player.getName()) + .replace( + "%BALANCE%", + new StringBuilder() + .append(Main.economy + .getBalance(player)) + .toString()) + .replace( + "%PLAYERLEVEL%", + new StringBuilder() + .append(player + .getLevel()) + .toString()) + .replace( + "%COMMANDSCOST%", + new StringBuilder() + .append(value) + .toString())))); + ArrayList lore2 = new ArrayList(); + if (!stringList4.isEmpty()) { + Iterator iterator8 = stringList4 + .iterator(); + while (iterator8.hasNext()) { + lore2.add(ChatColor.translateAlternateColorCodes( + '&', + this.sendMessage( + player, + iterator8 + .next() + .replace( + "%PLAYER%", + player.getName()) + .replace( + "%BALANCE%", + new StringBuilder() + .append(Main.economy + .getBalance(player)) + .toString()) + .replace( + "%PLAYERLEVEL%", + new StringBuilder() + .append(player + .getLevel()) + .toString()) + .replace( + "%COMMANDSCOST%", + new StringBuilder() + .append(value) + .toString())))); + } + } + itemMeta2.setLore(lore2); + itemStack2.setItemMeta(itemMeta2); + if (!s4.isEmpty()) { + itemStack2.addUnsafeEnchantment( + Enchantment.getByName(split2[0]), + Integer.parseInt(split2[1])); + } + inventory.setItem(int4, itemStack2); + } + } else if (player.hasPermission(string6) + && !player.isOp() + && this.getConfig().getBoolean( + "GUI." + s2 + ".PermissionItem")) { + if (split3[0].equalsIgnoreCase("SKULL_ITEM")) { + ItemStack itemStack3 = new ItemStack( + Material.SKULL_ITEM, + Integer.parseInt(split3[1]), (short) 3); + SkullMeta itemMeta3 = (SkullMeta) itemStack3 + .getItemMeta(); + itemMeta3.setOwner(split3[2].replace( + "%PLAYER%", player.getName())); + itemMeta3 + .setDisplayName(ChatColor.translateAlternateColorCodes( + '&', + this.sendMessage( + player, + string7.replace( + "%PLAYER%", + player.getName()) + .replace( + "%BALANCE%", + new StringBuilder() + .append(Main.economy + .getBalance(player)) + .toString()) + .replace( + "%PLAYERLEVEL%", + new StringBuilder() + .append(player + .getLevel()) + .toString()) + .replace( + "%COMMANDSCOST%", + new StringBuilder() + .append(value2) + .toString())))); + ArrayList lore3 = new ArrayList(); + if (!stringList5.isEmpty()) { + Iterator iterator9 = stringList5 + .iterator(); + while (iterator9.hasNext()) { + lore3.add(ChatColor.translateAlternateColorCodes( + '&', + this.sendMessage( + player, + iterator9 + .next() + .replace( + "%PLAYER%", + player.getName()) + .replace( + "%BALANCE%", + new StringBuilder() + .append(Main.economy + .getBalance(player)) + .toString()) + .replace( + "%PLAYERLEVEL%", + new StringBuilder() + .append(player + .getLevel()) + .toString()) + .replace( + "%COMMANDSCOST%", + new StringBuilder() + .append(value2) + .toString())))); + } + } + itemMeta3.setLore(lore3); + itemStack3.setItemMeta(itemMeta3); + if (!s5.isEmpty()) { + itemStack3.addUnsafeEnchantment( + Enchantment.getByName(split4[0]), + Integer.parseInt(split4[1])); + } + inventory.setItem(int4, itemStack3); + } else { + ItemStack itemStack4 = new ItemStack( + Material.getMaterial(split3[0]), + Integer.parseInt(split3[1]), + (byte) Integer.parseInt(split3[2])); + ItemMeta itemMeta4 = itemStack4.getItemMeta(); + itemMeta4 + .setDisplayName(ChatColor.translateAlternateColorCodes( + '&', + this.sendMessage( + player, + string7.replace( + "%PLAYER%", + player.getName()) + .replace( + "%BALANCE%", + new StringBuilder() + .append(Main.economy + .getBalance(player)) + .toString()) + .replace( + "%PLAYERLEVEL%", + new StringBuilder() + .append(player + .getLevel()) + .toString()) + .replace( + "%COMMANDSCOST%", + new StringBuilder() + .append(value2) + .toString())))); + ArrayList lore4 = new ArrayList(); + if (!stringList5.isEmpty()) { + Iterator iterator10 = stringList5 + .iterator(); + while (iterator10.hasNext()) { + lore4.add(ChatColor.translateAlternateColorCodes( + '&', + this.sendMessage( + player, + iterator10 + .next() + .replace( + "%PLAYER%", + player.getName()) + .replace( + "%BALANCE%", + new StringBuilder() + .append(Main.economy + .getBalance(player)) + .toString()) + .replace( + "%PLAYERLEVEL%", + new StringBuilder() + .append(player + .getLevel()) + .toString()) + .replace( + "%COMMANDSCOST%", + new StringBuilder() + .append(value2) + .toString())))); + } + } + itemMeta4.setLore(lore4); + itemStack4.setItemMeta(itemMeta4); + if (!s5.isEmpty()) { + itemStack4.addUnsafeEnchantment( + Enchantment.getByName(split4[0]), + Integer.parseInt(split4[1])); + } + inventory.setItem(int4, itemStack4); + } + } else if (Main.economy.getBalance(player) >= int2 + && this.getConfig().getBoolean( + "GUI." + s2 + ".BalanceItem") + && int2 != 0 + && this.getServer().getPluginManager() + .getPlugin("Vault") != null) { + if (split5[0].equalsIgnoreCase("SKULL_ITEM")) { + ItemStack itemStack5 = new ItemStack( + Material.SKULL_ITEM, + Integer.parseInt(split5[1]), (short) 3); + SkullMeta itemMeta5 = (SkullMeta) itemStack5 + .getItemMeta(); + itemMeta5.setOwner(split5[2].replace( + "%PLAYER%", player.getName())); + itemMeta5 + .setDisplayName(ChatColor.translateAlternateColorCodes( + '&', + this.sendMessage( + player, + string8.replace( + "%PLAYER%", + player.getName()) + .replace( + "%BALANCE%", + new StringBuilder() + .append(Main.economy + .getBalance(player)) + .toString()) + .replace( + "%PLAYERLEVEL%", + new StringBuilder() + .append(player + .getLevel()) + .toString()) + .replace( + "%COMMANDSCOST%", + new StringBuilder() + .append(value3) + .toString())))); + ArrayList lore5 = new ArrayList(); + if (!stringList6.isEmpty()) { + Iterator iterator11 = stringList6 + .iterator(); + while (iterator11.hasNext()) { + lore5.add(ChatColor.translateAlternateColorCodes( + '&', + this.sendMessage( + player, + iterator11 + .next() + .replace( + "%PLAYER%", + player.getName()) + .replace( + "%BALANCE%", + new StringBuilder() + .append(Main.economy + .getBalance(player)) + .toString()) + .replace( + "%PLAYERLEVEL%", + new StringBuilder() + .append(player + .getLevel()) + .toString()) + .replace( + "%COMMANDSCOST%", + new StringBuilder() + .append(value3) + .toString())))); + } + } + itemMeta5.setLore(lore5); + itemStack5.setItemMeta(itemMeta5); + if (!s6.isEmpty()) { + itemStack5.addUnsafeEnchantment( + Enchantment.getByName(split6[0]), + Integer.parseInt(split6[1])); + } + inventory.setItem(int4, itemStack5); + } else { + ItemStack itemStack6 = new ItemStack( + Material.getMaterial(split5[0]), + Integer.parseInt(split5[1]), + (byte) Integer.parseInt(split5[2])); + ItemMeta itemMeta6 = itemStack6.getItemMeta(); + itemMeta6 + .setDisplayName(ChatColor.translateAlternateColorCodes( + '&', + this.sendMessage( + player, + string8.replace( + "%PLAYER%", + player.getName()) + .replace( + "%BALANCE%", + new StringBuilder() + .append(Main.economy + .getBalance(player)) + .toString()) + .replace( + "%PLAYERLEVEL%", + new StringBuilder() + .append(player + .getLevel()) + .toString()) + .replace( + "%COMMANDSCOST%", + new StringBuilder() + .append(value3) + .toString())))); + ArrayList lore6 = new ArrayList(); + if (!stringList6.isEmpty()) { + Iterator iterator12 = stringList6 + .iterator(); + while (iterator12.hasNext()) { + lore6.add(ChatColor.translateAlternateColorCodes( + '&', + this.sendMessage( + player, + iterator12 + .next() + .replace( + "%PLAYER%", + player.getName()) + .replace( + "%BALANCE%", + new StringBuilder() + .append(Main.economy + .getBalance(player)) + .toString()) + .replace( + "%PLAYERLEVEL%", + new StringBuilder() + .append(player + .getLevel()) + .toString()) + .replace( + "%COMMANDSCOST%", + new StringBuilder() + .append(value3) + .toString())))); + } + } + itemMeta6.setLore(lore6); + itemStack6.setItemMeta(itemMeta6); + if (!s6.isEmpty()) { + itemStack6.addUnsafeEnchantment( + Enchantment.getByName(split6[0]), + Integer.parseInt(split6[1])); + } + inventory.setItem(int4, itemStack6); + } + } else if (player.getLevel() >= int3 + && this.getConfig().getBoolean( + "GUI." + s2 + ".EXPItem")) { + if (split7[0].equalsIgnoreCase("SKULL_ITEM")) { + ItemStack itemStack7 = new ItemStack( + Material.SKULL_ITEM, + Integer.parseInt(split7[1]), (short) 3); + SkullMeta itemMeta7 = (SkullMeta) itemStack7 + .getItemMeta(); + itemMeta7.setOwner(split7[2].replace( + "%PLAYER%", player.getName())); + itemMeta7 + .setDisplayName(ChatColor.translateAlternateColorCodes( + '&', + this.sendMessage( + player, + string9.replace( + "%PLAYER%", + player.getName()) + .replace( + "%BALANCE%", + new StringBuilder() + .append(Main.economy + .getBalance(player)) + .toString()) + .replace( + "%PLAYERLEVEL%", + new StringBuilder() + .append(player + .getLevel()) + .toString()) + .replace( + "%COMMANDSCOST%", + new StringBuilder() + .append(value4) + .toString())))); + ArrayList lore7 = new ArrayList(); + if (!stringList7.isEmpty()) { + Iterator iterator13 = stringList7 + .iterator(); + while (iterator13.hasNext()) { + lore7.add(ChatColor.translateAlternateColorCodes( + '&', + this.sendMessage( + player, + iterator13 + .next() + .replace( + "%PLAYER%", + player.getName()) + .replace( + "%BALANCE%", + new StringBuilder() + .append(Main.economy + .getBalance(player)) + .toString()) + .replace( + "%PLAYERLEVEL%", + new StringBuilder() + .append(player + .getLevel()) + .toString()) + .replace( + "%COMMANDSCOST%", + new StringBuilder() + .append(value4) + .toString())))); + } + } + itemMeta7.setLore(lore7); + itemStack7.setItemMeta(itemMeta7); + if (!s7.isEmpty()) { + itemStack7.addUnsafeEnchantment( + Enchantment.getByName(split8[0]), + Integer.parseInt(split8[1])); + } + inventory.setItem(int4, itemStack7); + } else { + ItemStack itemStack8 = new ItemStack( + Material.getMaterial(split7[0]), + Integer.parseInt(split7[1]), + (byte) Integer.parseInt(split7[2])); + ItemMeta itemMeta8 = itemStack8.getItemMeta(); + itemMeta8 + .setDisplayName(ChatColor.translateAlternateColorCodes( + '&', + this.sendMessage( + player, + string9.replace( + "%PLAYER%", + player.getName()) + .replace( + "%BALANCE%", + new StringBuilder() + .append(Main.economy + .getBalance(player)) + .toString()) + .replace( + "%PLAYERLEVEL%", + new StringBuilder() + .append(player + .getLevel()) + .toString()) + .replace( + "%COMMANDSCOST%", + new StringBuilder() + .append(value4) + .toString())))); + ArrayList lore8 = new ArrayList(); + if (!stringList7.isEmpty()) { + Iterator iterator14 = stringList7 + .iterator(); + while (iterator14.hasNext()) { + lore8.add(ChatColor.translateAlternateColorCodes( + '&', + this.sendMessage( + player, + iterator14 + .next() + .replace( + "%PLAYER%", + player.getName()) + .replace( + "%BALANCE%", + new StringBuilder() + .append(Main.economy + .getBalance(player)) + .toString()) + .replace( + "%PLAYERLEVEL%", + new StringBuilder() + .append(player + .getLevel()) + .toString()) + .replace( + "%COMMANDSCOST%", + new StringBuilder() + .append(value4) + .toString())))); + } + } + itemMeta8.setLore(lore8); + itemStack8.setItemMeta(itemMeta8); + if (!s7.isEmpty()) { + itemStack8.addUnsafeEnchantment( + Enchantment.getByName(split8[0]), + Integer.parseInt(split8[1])); + } + inventory.setItem(int4, itemStack8); + } + } else if (split9[0].equalsIgnoreCase("SKULL_ITEM")) { + ItemStack itemStack9 = new ItemStack( + Material.SKULL_ITEM, + Integer.parseInt(split9[1]), (short) 3); + SkullMeta itemMeta9 = (SkullMeta) itemStack9 + .getItemMeta(); + itemMeta9.setOwner(split9[2].replace("%PLAYER%", + player.getName())); + itemMeta9 + .setDisplayName(ChatColor + .translateAlternateColorCodes( + '&', + this.sendMessage( + player, + string10.replace( + "%PLAYER%", + player.getName()) + .replace( + "%BALANCE%", + new StringBuilder() + .append(Main.economy + .getBalance(player)) + .toString()) + .replace( + "%PLAYERLEVEL%", + new StringBuilder() + .append(player + .getLevel()) + .toString()) + .replace( + "%COMMANDSCOST%", + new StringBuilder() + .append(value5) + .toString())))); + ArrayList lore9 = new ArrayList(); + if (!stringList8.isEmpty()) { + Iterator iterator15 = stringList8 + .iterator(); + while (iterator15.hasNext()) { + lore9.add(ChatColor + .translateAlternateColorCodes( + '&', + this.sendMessage( + player, + iterator15 + .next() + .replace( + "%PLAYER%", + player.getName()) + .replace( + "%BALANCE%", + new StringBuilder() + .append(Main.economy + .getBalance(player)) + .toString()) + .replace( + "%PLAYERLEVEL%", + new StringBuilder() + .append(player + .getLevel()) + .toString()) + .replace( + "%COMMANDSCOST%", + new StringBuilder() + .append(value5) + .toString())))); + } + } + itemMeta9.setLore(lore9); + itemStack9.setItemMeta(itemMeta9); + if (!s8.isEmpty()) { + itemStack9.addUnsafeEnchantment( + Enchantment.getByName(split10[0]), + Integer.parseInt(split10[1])); + } + inventory.setItem(int4, itemStack9); + } else { + ItemStack itemStack10 = new ItemStack( + Material.getMaterial(split9[0]), + Integer.parseInt(split9[1]), + (byte) Integer.parseInt(split9[2])); + ItemMeta itemMeta10 = itemStack10.getItemMeta(); + itemMeta10 + .setDisplayName(ChatColor + .translateAlternateColorCodes( + '&', + this.sendMessage( + player, + string10.replace( + "%PLAYER%", + player.getName()) + .replace( + "%BALANCE%", + new StringBuilder() + .append(Main.economy + .getBalance(player)) + .toString()) + .replace( + "%PLAYERLEVEL%", + new StringBuilder() + .append(player + .getLevel()) + .toString()) + .replace( + "%COMMANDSCOST%", + new StringBuilder() + .append(value5) + .toString())))); + ArrayList lore10 = new ArrayList(); + if (!stringList8.isEmpty()) { + Iterator iterator16 = stringList8 + .iterator(); + while (iterator16.hasNext()) { + lore10.add(ChatColor + .translateAlternateColorCodes( + '&', + this.sendMessage( + player, + iterator16 + .next() + .replace( + "%PLAYER%", + player.getName()) + .replace( + "%BALANCE%", + new StringBuilder() + .append(Main.economy + .getBalance(player)) + .toString()) + .replace( + "%PLAYERLEVEL%", + new StringBuilder() + .append(player + .getLevel()) + .toString()) + .replace( + "%COMMANDSCOST%", + new StringBuilder() + .append(value5) + .toString())))); + } + } + itemMeta10.setLore(lore10); + itemStack10.setItemMeta(itemMeta10); + if (!s8.isEmpty()) { + itemStack10.addUnsafeEnchantment( + Enchantment.getByName(s8), + Integer.parseInt(split10[1])); + } + inventory.setItem(int4, itemStack10); + } + } + player.openInventory(inventory); + String upperCase = this.getConfig() + .getString("GUI." + s2 + ".OpenSound", "") + .toUpperCase(); + if (upperCase.isEmpty() || upperCase == null) { + continue; + } + float n = 1.0f; + player.playSound(player.getLocation(), + Sound.valueOf(upperCase), n, n); + } else { + player.sendMessage(ChatColor.translateAlternateColorCodes( + '&', + this.sendMessage( + player, + this.messagesFile + .getString("NoPermsCommandMessage") + .replace("%PLAYER%", + player.getName()) + .replace( + "%BALANCE%", + new StringBuilder() + .append(Main.economy + .getBalance(player)) + .toString()) + .replace( + "%PLAYERLEVEL%", + new StringBuilder().append( + player.getLevel()) + .toString())))); + } + } else { + player.sendMessage(ChatColor.translateAlternateColorCodes( + '&', + this.sendMessage( + player, + this.messagesFile + .getString("WhitelistedWorldMessage") + .replace("%PLAYER%", player.getName()) + .replace( + "%BALANCE%", + new StringBuilder() + .append(Main.economy + .getBalance(player)) + .toString()) + .replace( + "%PLAYERLEVEL%", + new StringBuilder().append( + player.getLevel()) + .toString())))); + } + } else { + player.sendMessage(ChatColor.translateAlternateColorCodes( + '&', + this.sendMessage( + player, + this.messagesFile + .getString("InvalidGUIMessage") + .replace("%PLAYER%", player.getName()) + .replace( + "%BALANCE%", + new StringBuilder() + .append(Main.economy + .getBalance(player)) + .toString()) + .replace( + "%PLAYERLEVEL%", + new StringBuilder().append( + player.getLevel()) + .toString())))); + } + } + } + } + } else if (player.hasPermission("customgui.help")) { + player.sendMessage(ChatColor.translateAlternateColorCodes('&', this.sendMessage( + player, + this.messagesFile + .getString("UnknownCommandMessage") + .replace("%PLAYER%", player.getName()) + .replace( + "%BALANCE%", + new StringBuilder().append(Main.economy.getBalance(player)) + .toString()) + .replace("%PLAYERLEVEL%", + new StringBuilder().append(player.getLevel()).toString())))); + } else { + player.sendMessage(ChatColor.translateAlternateColorCodes('&', this.sendMessage( + player, + this.messagesFile + .getString("NoPermsCommandMessage") + .replace("%PLAYER%", player.getName()) + .replace( + "%BALANCE%", + new StringBuilder().append(Main.economy.getBalance(player)) + .toString()) + .replace("%PLAYERLEVEL%", + new StringBuilder().append(player.getLevel()).toString())))); + } + } + return false; + } +} diff --git a/src/plugin.yml b/src/plugin.yml new file mode 100644 index 0000000..2c12155 --- /dev/null +++ b/src/plugin.yml @@ -0,0 +1,8 @@ +name: CustomGUI +version: 1.4.3.4 +main: me.jacobculley.customgui.Main +depend: [Vault, PlaceholderAPI] + +commands: + customgui: + description: Reloads the plugin \ No newline at end of file