summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKHobbits <rob@khobbits.co.uk>2013-10-19 12:26:28 +0100
committerKHobbits <rob@khobbits.co.uk>2013-10-19 12:26:28 +0100
commit92a96736526021ec237e5bed670757e8eeb225ff (patch)
treefe1b6a8a24e0e5bb464759c7333d5f36b7f6fb94
parent1164bbd90d031a4950a19556229fe3b9d3976f93 (diff)
downloadEssentials-92a96736526021ec237e5bed670757e8eeb225ff.tar
Essentials-92a96736526021ec237e5bed670757e8eeb225ff.tar.gz
Essentials-92a96736526021ec237e5bed670757e8eeb225ff.tar.lz
Essentials-92a96736526021ec237e5bed670757e8eeb225ff.tar.xz
Essentials-92a96736526021ec237e5bed670757e8eeb225ff.zip
Restore original give/take Money API
-rw-r--r--Essentials/src/com/earth2me/essentials/IUser.java5
-rw-r--r--Essentials/src/com/earth2me/essentials/User.java19
2 files changed, 22 insertions, 2 deletions
diff --git a/Essentials/src/com/earth2me/essentials/IUser.java b/Essentials/src/com/earth2me/essentials/IUser.java
index cc5806022..a1c6ce55e 100644
--- a/Essentials/src/com/earth2me/essentials/IUser.java
+++ b/Essentials/src/com/earth2me/essentials/IUser.java
@@ -7,6 +7,7 @@ import java.util.Map;
import java.util.Set;
import net.ess3.api.ITeleport;
import org.bukkit.Location;
+import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player;
@@ -23,12 +24,16 @@ public interface IUser
void giveMoney(BigDecimal value);
void giveMoney(final BigDecimal value, final CommandSource initiator);
+ @Deprecated
+ void giveMoney(final BigDecimal value, final CommandSender initiator);
void payUser(final User reciever, final BigDecimal value) throws Exception;
void takeMoney(BigDecimal value);
void takeMoney(final BigDecimal value, final CommandSource initiator);
+ @Deprecated
+ void takeMoney(final BigDecimal value, final CommandSender initiator);
boolean canAfford(BigDecimal value);
diff --git a/Essentials/src/com/earth2me/essentials/User.java b/Essentials/src/com/earth2me/essentials/User.java
index c4e22fe86..9cfe5b7e7 100644
--- a/Essentials/src/com/earth2me/essentials/User.java
+++ b/Essentials/src/com/earth2me/essentials/User.java
@@ -14,6 +14,7 @@ import java.util.logging.Logger;
import net.ess3.api.IEssentials;
import org.bukkit.ChatColor;
import org.bukkit.Location;
+import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player;
import org.bukkit.event.player.PlayerTeleportEvent.TeleportCause;
import org.bukkit.potion.PotionEffect;
@@ -132,7 +133,7 @@ public class User extends UserData implements Comparable<User>, IReplyTo, net.es
@Override
public void giveMoney(final BigDecimal value)
{
- giveMoney(value, null);
+ giveMoney(value, (CommandSource) null);
}
@Override
@@ -149,6 +150,13 @@ public class User extends UserData implements Comparable<User>, IReplyTo, net.es
initiator.sendMessage(_("addedToOthersAccount", NumberUtil.displayCurrency(value, ess), this.getDisplayName(), NumberUtil.displayCurrency(getMoney(), ess)));
}
}
+
+ @Override
+ @Deprecated
+ public void giveMoney(final BigDecimal value, final CommandSender initiator)
+ {
+ giveMoney(value, new CommandSource(initiator));
+ }
@Override
public void payUser(final User reciever, final BigDecimal value) throws ChargeException
@@ -173,7 +181,7 @@ public class User extends UserData implements Comparable<User>, IReplyTo, net.es
@Override
public void takeMoney(final BigDecimal value)
{
- takeMoney(value, null);
+ takeMoney(value, (CommandSource) null);
}
@Override
@@ -190,6 +198,13 @@ public class User extends UserData implements Comparable<User>, IReplyTo, net.es
initiator.sendMessage(_("takenFromOthersAccount", NumberUtil.displayCurrency(value, ess), this.getDisplayName(), NumberUtil.displayCurrency(getMoney(), ess)));
}
}
+
+ @Override
+ @Deprecated
+ public void takeMoney(final BigDecimal value, final CommandSender initiator)
+ {
+ takeMoney(value, new CommandSource(initiator));
+ }
@Override
public boolean canAfford(final BigDecimal cost)