Package net.milkbowl.vault.economy

Examples of net.milkbowl.vault.economy.Economy.format()


                if (portal.getPrice() != 0D && !p.hasPermission(portal.getExempt())) {
                    shouldPay = true;
                    if (portal.getPrice() < 0D || (vaultEco != null && vaultEco.has(p.getName(), portal.getPrice())) || (bank != null && bank.hasEnough(event.getPlayer(), portal.getPrice(), portal.getCurrency(), "You need " + bank.getFormattedAmount(event.getPlayer(), portal.getPrice(), portal.getCurrency()) + " to enter the " + portal.getName() + " portal."))) {
                        canAfford = true;
                    } else if (vaultEco != null) {
                        p.sendMessage("You need " + vaultEco.format(portal.getPrice()) + " to enter the " + portal.getName() + " portal.");
                        event.setCancelled(true);
                        return;
                    } else if (bank != null) {
                        event.setCancelled(true);
                        return;
View Full Code Here


                        return;
                    } else {
                        if (shouldPay) {
                            if (vaultEco != null) {
                                if (portal.getPrice() < 0D) {
                                    p.sendMessage(String.format("You have earned %s for using %s.", vaultEco.format(-portal.getPrice()), portal.getName()));
                                    vaultEco.depositPlayer(event.getPlayer().getName(), -portal.getPrice());
                                } else {
                                    p.sendMessage(String.format("You have been charged %s for using %s.", vaultEco.format(portal.getPrice()), portal.getName()));
                                    vaultEco.withdrawPlayer(event.getPlayer().getName(), portal.getPrice());
                                }
View Full Code Here

                            if (vaultEco != null) {
                                if (portal.getPrice() < 0D) {
                                    p.sendMessage(String.format("You have earned %s for using %s.", vaultEco.format(-portal.getPrice()), portal.getName()));
                                    vaultEco.depositPlayer(event.getPlayer().getName(), -portal.getPrice());
                                } else {
                                    p.sendMessage(String.format("You have been charged %s for using %s.", vaultEco.format(portal.getPrice()), portal.getName()));
                                    vaultEco.withdrawPlayer(event.getPlayer().getName(), portal.getPrice());
                                }
                            } else {
                                if (portal.getPrice() < 0D) {
                                    bank.give(event.getPlayer(), -portal.getPrice(), portal.getCurrency());
View Full Code Here

                    MVPortalEvent portalEvent = new MVPortalEvent(d, event.getPlayer(), agent, portal);
                    this.plugin.getServer().getPluginManager().callEvent(portalEvent);
                    if (!portalEvent.isCancelled()) {
                        if (vaultEco != null) {
                            if (portal.getPrice() < 0D) {
                                p.sendMessage(String.format("You have earned %s for using %s.", vaultEco.format(-portal.getPrice()), portal.getName()));
                                vaultEco.depositPlayer(event.getPlayer().getName(), -portal.getPrice());
                            } else {
                                p.sendMessage(String.format("You have been charged %s for using %s.", vaultEco.format(portal.getPrice()), portal.getName()));
                                vaultEco.withdrawPlayer(event.getPlayer().getName(), portal.getPrice());
                            }
View Full Code Here

                        if (vaultEco != null) {
                            if (portal.getPrice() < 0D) {
                                p.sendMessage(String.format("You have earned %s for using %s.", vaultEco.format(-portal.getPrice()), portal.getName()));
                                vaultEco.depositPlayer(event.getPlayer().getName(), -portal.getPrice());
                            } else {
                                p.sendMessage(String.format("You have been charged %s for using %s.", vaultEco.format(portal.getPrice()), portal.getName()));
                                vaultEco.withdrawPlayer(event.getPlayer().getName(), portal.getPrice());
                            }
                        } else {
                            if (portal.getPrice() < 0D) {
                                bank.give(event.getPlayer(), -portal.getPrice(), portal.getCurrency());
View Full Code Here

                            }
                        }
                        helper.performTeleport(event.getPlayer(), event.getTo(), ps, d);
                    }
                } else if (vaultEco != null) {
                    p.sendMessage("You need " + vaultEco.format(portal.getPrice()) + " to enter the " + portal.getName() + " portal.");
                }
            } else {
                // call event for other plugins
                TravelAgent agent = new MVTravelAgent(this.plugin.getCore(), d, event.getPlayer());
                MVPortalEvent portalEvent = new MVPortalEvent(d, event.getPlayer(), agent, portal);
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.