Package com.iCo6.handlers

Examples of com.iCo6.handlers.Empty


            Player player = (Player) sender;

            if(player == null)
                return false;

            Account account = new Account(player.getName());
            account.getHoldings().showBalance(null);
            return false;
        }

        if(!hasPermissions(sender, "money+"))
            throw new InvalidUsage("You do not have permission to do that.");

        if(!Accounts.exists(name)) {
            template.set(Template.Node.ERROR_ACCOUNT);
            template.add("name", name);

            Messaging.send(sender, tag + template.parse());
            return false;
        }

        Account account = new Account(name);
        account.getHoldings().showBalance(sender);
        return false;
    }
View Full Code Here


        Messaging.send(sender, template.parse());

        template.set(Template.Node.TOP_ITEM);
        List<Account> top = Accounts.getTopAccounts(5);
        for (int i = 0; i < top.size(); i++) {
            Account account = top.get(i);
            template.add("i", i + 1);
            template.add("name", account.name);
            template.add("amount", account.getHoldings().toString());
            Messaging.send(sender, template.parse());
        }

        return false;
    }
View Full Code Here

            Messaging.send(sender, tag + template.parse());
            return false;
        }

        Account account = new Account(name);

        if(arguments.get("status").getStringValue().equalsIgnoreCase("empty")) {
            int current = account.getStatus();

            if(self)
                template.set(Template.Node.PERSONAL_STATUS);
            else {
                template.set(Template.Node.PLAYER_STATUS);
                template.add("name", name);
            }

            template.add("status", current);
            Messaging.send(sender, tag + template.parse());

        } else {
            if(!hasPermissions(sender, "status+"))
                throw new InvalidUsage("You do not have permission to do that.");

            int status = arguments.get("status").getIntegerValue();
            account.setStatus(status);

            template.set(Template.Node.ACCOUNTS_STATUS);
            template.add("status", status);
            Messaging.send(sender, tag + template.parse());
        }
View Full Code Here

            Messaging.send(sender, tag + template.parse());
            return false;
        }

        Account account = new Account(name);
        account.getHoldings().setBalance(amount);

        template.set(Template.Node.PLAYER_SET);
        template.add("name", name);
        template.add("amount", account.getHoldings().toString());

        Messaging.send(sender, tag + template.parse());
        return false;
    }
View Full Code Here

            Messaging.send(sender, tag + template.parse());
            return false;
        }

        Account account = new Account(name);
        account.getHoldings().subtract(amount);

        template.set(Template.Node.PLAYER_DEBIT);
        template.add("name", name);
        template.add("amount", iConomy.format(amount));
View Full Code Here

            Messaging.send(sender, tag + template.parse());
            return false;
        }

        Account account = new Account(name);
        account.getHoldings().add(amount);

        template.set(Template.Node.PLAYER_CREDIT);
        template.add("name", name);
        template.add("amount", iConomy.format(amount));
View Full Code Here

    @Override
    public boolean transfer(String playerFrom, String playerTo, double amount) {
        this.checkExist(playerTo);
        this.checkExist(playerFrom);
        if (this.canAfford(playerFrom, amount)) {
            Account p1 = new Accounts().get(playerFrom);
            Account p2 = new Accounts().get(playerTo);
            p1.getHoldings().subtract(amount);
            p2.getHoldings().add(amount);
            return true;
        }
        return false;
    }
View Full Code Here

public class players implements Listener {

    @EventHandler
    public void onPlayerJoin(PlayerJoinEvent event) {
        Accounts accounts = new Accounts();
        Player player = event.getPlayer();

        if(player != null)
            if(!accounts.exists(player.getName()))
                accounts.create(player.getName());
    }
View Full Code Here

            Plugin ec = plugin.getServer().getPluginManager().getPlugin("iConomy");
            if (ec != null && ec.isEnabled() && ec.getClass().getName().equals("com.iCo6.iConomy")) {
                String version = ec.getDescription().getVersion().split("\\.")[0];
                name += version;
                economy = (iConomy) ec;
                accounts = new Accounts();
                log.info(String.format("[%s][Economy] %s hooked.", plugin.getDescription().getName(), name));
            }
        }
    }
View Full Code Here

                Plugin ec = event.getPlugin();
                if (ec.getClass().getName().equals("com.iCo6.iConomy")) {
                    String version = ec.getDescription().getVersion().split("\\.")[0];
                    name += version;
                    economy.economy = (iConomy) ec;
                    accounts = new Accounts();
                    log.info(String.format("[%s][Economy] %s hooked.", plugin.getDescription().getName(), economy.name));
                }
            }
        }
View Full Code Here

TOP

Related Classes of com.iCo6.handlers.Empty

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.