1
0
mirror of https://github.com/essentials/Essentials.git synced 2025-08-17 03:54:19 +02:00

missed this from checkin oops

This commit is contained in:
ementalo
2011-07-08 12:29:06 +01:00
parent 2230159dae
commit 6c09217489

View File

@@ -6,7 +6,6 @@ import java.util.Calendar;
import java.util.GregorianCalendar;
import java.util.logging.Logger;
import org.bukkit.ChatColor;
import org.bukkit.Location;
import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player;
@@ -77,6 +76,11 @@ public class User extends UserData implements Comparable<User>, IReplyTo, IUser
}
public void giveMoney(double value)
{
giveMoney(value, null);
}
public void giveMoney(double value, CommandSender initiator)
{
if (value == 0)
{
@@ -84,6 +88,10 @@ public class User extends UserData implements Comparable<User>, IReplyTo, IUser
}
setMoney(getMoney() + value);
sendMessage(Util.format("addedToAccount", Util.formatCurrency(value)));
if (initiator != null)
{
initiator.sendMessage((Util.format("addedToAccount", Util.formatCurrency(value))));
}
}
public void payUser(User reciever, double value) throws Exception
@@ -106,6 +114,10 @@ public class User extends UserData implements Comparable<User>, IReplyTo, IUser
}
public void takeMoney(double value)
{
takeMoney(value, null);
}
public void takeMoney(double value, CommandSender initiator)
{
if (value == 0)
{
@@ -113,6 +125,10 @@ public class User extends UserData implements Comparable<User>, IReplyTo, IUser
}
setMoney(getMoney() - value);
sendMessage(Util.format("takenFromAccount", Util.formatCurrency(value)));
if (initiator != null)
{
initiator.sendMessage((Util.format("addedToAccount", Util.formatCurrency(value))));
}
}
public boolean canAfford(double cost)