Examples of payTo()


Examples of com.palmergames.bukkit.towny.object.Nation.payTo()

    Nation oldNation = new Nation(oldName);

    if (plugin.isEcoActive())
      try {
        nation.pay(nation.getHoldingBalance(), "Rename Nation - Empty account of new nation name.");
        oldNation.payTo(oldNation.getHoldingBalance(), nation, "Rename Nation - Transfer to new account");
      } catch (EconomyException e) {
      }

    for (Town town : toSave) {
      saveTown(town);
View Full Code Here

Examples of com.palmergames.bukkit.towny.object.Resident.payTo()

                            return;
                        }
                }
               
                // Show message if we are using iConomy and are charging for spawn travel.
                if (travelCost > 0 && TownySettings.isUsingEconomy() && resident.payTo(travelCost, town, String.format("Town Spawn (%s)", townSpawnPermission))) {
                  TownyMessaging.sendMsg(player, String.format(TownySettings.getLangString("msg_cost_spawn"),
                        TownyEconomyObject.getFormattedBalance(travelCost))); // + TownyEconomyObject.getEconomyCurrency()));
                }
               
               
View Full Code Here

Examples of com.palmergames.bukkit.towny.object.Resident.payTo()

                        }
                       
                        if (amount < 0)
                                throw new TownyException(TownySettings.getLangString("msg_err_negative_money"));
                       
                        if (!resident.payTo(amount, town, "Town Deposit"))
                                throw new TownyException(TownySettings.getLangString("msg_insuf_funds"));
                       
                        TownyMessaging.sendTownMessage(town, String.format(TownySettings.getLangString("msg_xx_deposited_xx"), resident.getName(), amount, "town"));
                } catch (TownyException x) {
                        TownyMessaging.sendErrorMsg(player, x.getMessage());
View Full Code Here

Examples of com.palmergames.bukkit.towny.object.Resident.payTo()

        try {
          Resident resident = townBlock.getResident();
          if (town.isMayor(resident) || town.hasAssistant(resident)) {
            continue;
          }
          if (!resident.payTo(townBlock.getType().getTax(town), town, String.format("Plot Tax (%s)", townBlock.getType()))) {
            TownyMessaging.sendTownMessage(town, String.format(TownySettings.getLangString("msg_couldnt_pay_plot_taxes"), resident));
            townBlock.setResident(null);
            TownyUniverse.getDataSource().saveResident(resident);
            TownyUniverse.getDataSource().saveWorld(townBlock.getWorld());
          }// else {
View Full Code Here

Examples of com.palmergames.bukkit.towny.object.Resident.payTo()

      }

      if (amount < 0)
        throw new TownyException(TownySettings.getLangString("msg_err_negative_money"));

      if (!resident.payTo(amount, nation, "Nation Deposit"))
        throw new TownyException(TownySettings.getLangString("msg_insuf_funds"));

      TownyMessaging.sendNationMessage(nation, String.format(TownySettings.getLangString("msg_xx_deposited_xx"), resident.getName(), amount, "nation"));
    } catch (TownyException x) {
      TownyMessaging.sendErrorMsg(player, x.getMessage());
View Full Code Here

Examples of com.palmergames.bukkit.towny.object.Town.payTo()

            plugin.updateCache();
            return true;
          } else if (town.isMayor(resident) || town.hasAssistant(resident)) {
            //Plot isn't for sale but re-possessing for town.
           
            if (TownySettings.isUsingEconomy() && !town.payTo(0.0, owner, "Plot - Buy Back"))
              throw new TownyException(TownySettings.getLangString("msg_town_no_money_purchase_plot"));
           
            TownyMessaging.sendTownMessage(town, TownySettings.getBuyResidentPlotMsg(town.getName(), owner.getName(), 0.0));
            townBlock.setResident(null);
            townBlock.setPlotPrice(-1);
View Full Code Here

Examples of com.palmergames.bukkit.towny.object.Town.payTo()

    Town oldTown = new Town(oldName);

    try {
      town.pay(town.getHoldingBalance(), "Rename Town - Empty account of new town name.");
      oldTown.payTo(oldTown.getHoldingBalance(), town, "Rename Town - Transfer to new account");
    } catch (EconomyException e) {
    }

    for (Resident resident : toSave) {
      saveResident(resident);
View Full Code Here

Examples of com.palmergames.bukkit.towny.object.Town.payTo()

            } catch (NotRegisteredException e) {
              plugin.getTownyUniverse().getWarEvent().remove(town);
            }
          } else
            TownyMessaging.sendTownMessage(town, defenderResident.getName() + "'s wallet couldn't satisfy " + attackerResident.getName() + ". " + townPrice + " taken from town bank.");
          town.payTo(townPrice, attackerResident, String.format("Death Payment (War) (%s couldn't pay)", defenderResident.getName()));
        }
      } catch (NotRegisteredException e) {
      } catch (EconomyException e) {
        TownyMessaging.sendErrorMsg(attackerPlayer, "Could not take wartime death funds.");
        TownyMessaging.sendErrorMsg(defenderPlayer, "Could not take wartime death funds.");
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.