From 5d35754ed693e622914837a1759a8b9f0859e270 Mon Sep 17 00:00:00 2001 From: Olof Larsson Date: Tue, 3 Dec 2013 20:19:55 +0100 Subject: [PATCH] Money param reorder --- .../massivecraft/factions/entity/Faction.java | 2 +- .../factions/integration/Econ.java | 22 +++++++++---------- .../listeners/FactionsListenerEcon.java | 2 +- 3 files changed, 13 insertions(+), 13 deletions(-) diff --git a/src/com/massivecraft/factions/entity/Faction.java b/src/com/massivecraft/factions/entity/Faction.java index 93caab76..8f941f20 100644 --- a/src/com/massivecraft/factions/entity/Faction.java +++ b/src/com/massivecraft/factions/entity/Faction.java @@ -60,7 +60,7 @@ public class Faction extends Entity implements EconomyParticipator @Override public void preDetach(String id) { - Money.set(0, null, this); + Money.set(this, null, 0); String universe = this.getUniverse(); diff --git a/src/com/massivecraft/factions/integration/Econ.java b/src/com/massivecraft/factions/integration/Econ.java index b80b5006..217fdb0c 100644 --- a/src/com/massivecraft/factions/integration/Econ.java +++ b/src/com/massivecraft/factions/integration/Econ.java @@ -61,7 +61,7 @@ public class Econ if (!Money.exists(uconf.econUniverseAccount)) return; - Money.spawn(delta, null, uconf.econUniverseAccount); + Money.spawn(uconf.econUniverseAccount, null, delta); } public static void sendBalanceInfo(UPlayer to, EconomyParticipator about) @@ -102,9 +102,9 @@ public class Econ public static boolean transferMoney(EconomyParticipator invoker, EconomyParticipator from, EconomyParticipator to, double amount) { - return transferMoney(invoker, from, to, amount, true); + return transferMoney(from, to, invoker, amount, true); } - public static boolean transferMoney(EconomyParticipator invoker, EconomyParticipator from, EconomyParticipator to, double amount, boolean notify) + public static boolean transferMoney(EconomyParticipator from, EconomyParticipator to, EconomyParticipator by, double amount, boolean notify) { if (!isEnabled(from)) return false; @@ -119,34 +119,34 @@ public class Econ } // Check the rights - if ( ! canIControllYou(invoker, from)) return false; + if ( ! canIControllYou(by, from)) return false; // Is there enough money for the transaction to happen? if (Money.get(from) < amount) { // There was not enough money to pay - if (invoker != null && notify) + if (by != null && notify) { - invoker.msg("%s can't afford to transfer %s to %s.", from.describeTo(invoker, true), Money.format(amount), to.describeTo(invoker)); + by.msg("%s can't afford to transfer %s to %s.", from.describeTo(by, true), Money.format(amount), to.describeTo(by)); } return false; } // Transfer money - if (Money.move(amount, invoker, from, to)) + if (Money.move(from, to, by, amount)) { if (notify) { - sendTransferInfo(invoker, from, to, amount); + sendTransferInfo(by, from, to, amount); } return true; } else { // if we get here something with the transaction failed - if (invoker != null && notify) + if (by != null && notify) { - invoker.msg("Unable to transfer %s to %s from %s.", Money.format(amount), to.describeTo(invoker), from.describeTo(invoker, true)); + by.msg("Unable to transfer %s to %s from %s.", Money.format(amount), to.describeTo(by), from.describeTo(by, true)); } return false; } @@ -233,7 +233,7 @@ public class Econ boolean hasActionDesctription = (actionDescription != null && !actionDescription.isEmpty()); - if (Money.spawn(delta, null, ep)) + if (Money.spawn(ep, null, delta)) { modifyUniverseMoney(ep, -delta); diff --git a/src/com/massivecraft/factions/listeners/FactionsListenerEcon.java b/src/com/massivecraft/factions/listeners/FactionsListenerEcon.java index 987a2719..c95ee83c 100644 --- a/src/com/massivecraft/factions/listeners/FactionsListenerEcon.java +++ b/src/com/massivecraft/factions/listeners/FactionsListenerEcon.java @@ -85,7 +85,7 @@ public class FactionsListenerEcon implements Listener double amount = Money.get(faction); String amountString = Money.format(amount); - Econ.transferMoney(usender, faction, usender, amount, true); + Econ.transferMoney(faction, usender, usender, amount, true); usender.msg("You have been given the disbanded faction's bank, totaling %s.", amountString); Factions.get().log(usender.getName() + " has been given bank holdings of "+amountString+" from disbanding "+faction.getName()+".");