Skip to content

Commit 92a9673

Browse files
committed
Restore original give/take Money API
1 parent 1164bbd commit 92a9673

File tree

2 files changed

+22
-2
lines changed

2 files changed

+22
-2
lines changed

Essentials/src/com/earth2me/essentials/IUser.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
import java.util.Set;
88
import net.ess3.api.ITeleport;
99
import org.bukkit.Location;
10+
import org.bukkit.command.CommandSender;
1011
import org.bukkit.entity.Player;
1112

1213

@@ -23,12 +24,16 @@ public interface IUser
2324
void giveMoney(BigDecimal value);
2425

2526
void giveMoney(final BigDecimal value, final CommandSource initiator);
27+
@Deprecated
28+
void giveMoney(final BigDecimal value, final CommandSender initiator);
2629

2730
void payUser(final User reciever, final BigDecimal value) throws Exception;
2831

2932
void takeMoney(BigDecimal value);
3033

3134
void takeMoney(final BigDecimal value, final CommandSource initiator);
35+
@Deprecated
36+
void takeMoney(final BigDecimal value, final CommandSender initiator);
3237

3338
boolean canAfford(BigDecimal value);
3439

Essentials/src/com/earth2me/essentials/User.java

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
import net.ess3.api.IEssentials;
1515
import org.bukkit.ChatColor;
1616
import org.bukkit.Location;
17+
import org.bukkit.command.CommandSender;
1718
import org.bukkit.entity.Player;
1819
import org.bukkit.event.player.PlayerTeleportEvent.TeleportCause;
1920
import org.bukkit.potion.PotionEffect;
@@ -132,7 +133,7 @@ public void healCooldown() throws Exception
132133
@Override
133134
public void giveMoney(final BigDecimal value)
134135
{
135-
giveMoney(value, null);
136+
giveMoney(value, (CommandSource) null);
136137
}
137138

138139
@Override
@@ -149,6 +150,13 @@ public void giveMoney(final BigDecimal value, final CommandSource initiator)
149150
initiator.sendMessage(_("addedToOthersAccount", NumberUtil.displayCurrency(value, ess), this.getDisplayName(), NumberUtil.displayCurrency(getMoney(), ess)));
150151
}
151152
}
153+
154+
@Override
155+
@Deprecated
156+
public void giveMoney(final BigDecimal value, final CommandSender initiator)
157+
{
158+
giveMoney(value, new CommandSource(initiator));
159+
}
152160

153161
@Override
154162
public void payUser(final User reciever, final BigDecimal value) throws ChargeException
@@ -173,7 +181,7 @@ public void payUser(final User reciever, final BigDecimal value) throws ChargeEx
173181
@Override
174182
public void takeMoney(final BigDecimal value)
175183
{
176-
takeMoney(value, null);
184+
takeMoney(value, (CommandSource) null);
177185
}
178186

179187
@Override
@@ -190,6 +198,13 @@ public void takeMoney(final BigDecimal value, final CommandSource initiator)
190198
initiator.sendMessage(_("takenFromOthersAccount", NumberUtil.displayCurrency(value, ess), this.getDisplayName(), NumberUtil.displayCurrency(getMoney(), ess)));
191199
}
192200
}
201+
202+
@Override
203+
@Deprecated
204+
public void takeMoney(final BigDecimal value, final CommandSender initiator)
205+
{
206+
takeMoney(value, new CommandSource(initiator));
207+
}
193208

194209
@Override
195210
public boolean canAfford(final BigDecimal cost)

0 commit comments

Comments
 (0)