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, 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, 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, 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, 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)