@@ -0,0 +1,2007 @@
+/*%0A * To change this template, choose Tools %7C Templates%0A * and open the template in the editor.%0A */%0Apackage net.new_liberty.itemconomy.commands;%0A%0Aimport com.google.common.base.Joiner;%0Aimport net.new_liberty.itemconomy.ICInventory;%0Aimport org.bukkit.Bukkit;%0Aimport org.bukkit.ChatColor;%0Aimport org.bukkit.command.Command;%0Aimport org.bukkit.command.CommandExecutor;%0Aimport org.bukkit.command.CommandSender;%0Aimport org.bukkit.entity.Player;%0A%0A/**%0A *%0A * @author simplyianm%0A */%0Apublic class ICSignBuy implements CommandExecutor %7B%0A%0A    @Override%0A    public boolean onCommand(CommandSender sender, Command command, String label, String%5B%5D args) %7B%0A        if (!sender.hasPermission(%22itemconomy.console%22)) %7B%0A            sender.sendMessage(ChatColor.RED + %22Not allowed...%22);%0A            return true;%0A        %7D%0A%0A        if (args.length %3C 3) %7B%0A            sender.sendMessage(ChatColor.RED + %22Usage: /icsignbuy %3Cplayer%3E %3Cprice%3E %3Ccmd%3E%22);%0A            return true;%0A        %7D%0A%0A        Player p = Bukkit.getPlayerExact(args%5B0%5D);%0A        if (p == null) %7B%0A            sender.sendMessage(ChatColor.RED + %22No such player '%22 + args%5B0%5D + %22'!%22);%0A            return true;%0A        %7D%0A%0A        int price = 0;%0A        try %7B%0A            price = Integer.parseInt(args%5B1%5D);%0A        %7D catch (NumberFormatException e) %7B%0A            sender.sendMessage(ChatColor.RED + %22'%22 + args%5B1%5D + %22' is not a valid integer price!%22);%0A            return true;%0A        %7D%0A%0A%0A        ICInventory i = new ICInventory(p);%0A        int balance = i.balance();%0A        if (balance %3C price) %7B%0A            p.sendMessage(ChatColor.RED + %22You don't have enough currency to buy this! (Requires %22 + price + %22; you only have %22 + balance + %22)%22);%0A            return true;%0A        %7D%0A%0A        i.remove(price);%0A%0A        String%5B%5D cmdArray = new String%5Bargs.length - 2%5D;%0A        System.arraycopy(args, 2, cmdArray, 0, cmdArray.length);%0A        String cmd = Joiner.on(' ').join(cmdArray);%0A%0A        Bukkit.dispatchCommand(Bukkit.getConsoleSender(), cmd);%0A%0A        return true;%0A    %7D%0A%0A%7D%0A

Add buy command