mirror of
https://github.com/TotalFreedomMC/TF-EssentialsX.git
synced 2025-08-07 04:53:11 +00:00
missed this from checkin oops
This commit is contained in:
parent
962b6848c4
commit
8a1fb88ecd
1 changed files with 54 additions and 38 deletions
|
@ -6,7 +6,6 @@ import java.util.Calendar;
|
||||||
import java.util.GregorianCalendar;
|
import java.util.GregorianCalendar;
|
||||||
import java.util.logging.Logger;
|
import java.util.logging.Logger;
|
||||||
import org.bukkit.ChatColor;
|
import org.bukkit.ChatColor;
|
||||||
import org.bukkit.Location;
|
|
||||||
import org.bukkit.command.CommandSender;
|
import org.bukkit.command.CommandSender;
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
|
|
||||||
|
@ -77,6 +76,11 @@ public class User extends UserData implements Comparable<User>, IReplyTo, IUser
|
||||||
}
|
}
|
||||||
|
|
||||||
public void giveMoney(double value)
|
public void giveMoney(double value)
|
||||||
|
{
|
||||||
|
giveMoney(value, null);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void giveMoney(double value, CommandSender initiator)
|
||||||
{
|
{
|
||||||
if (value == 0)
|
if (value == 0)
|
||||||
{
|
{
|
||||||
|
@ -84,6 +88,10 @@ public class User extends UserData implements Comparable<User>, IReplyTo, IUser
|
||||||
}
|
}
|
||||||
setMoney(getMoney() + value);
|
setMoney(getMoney() + value);
|
||||||
sendMessage(Util.format("addedToAccount", Util.formatCurrency(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
|
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)
|
public void takeMoney(double value)
|
||||||
|
{
|
||||||
|
takeMoney(value, null);
|
||||||
|
}
|
||||||
|
public void takeMoney(double value, CommandSender initiator)
|
||||||
{
|
{
|
||||||
if (value == 0)
|
if (value == 0)
|
||||||
{
|
{
|
||||||
|
@ -113,6 +125,10 @@ public class User extends UserData implements Comparable<User>, IReplyTo, IUser
|
||||||
}
|
}
|
||||||
setMoney(getMoney() - value);
|
setMoney(getMoney() - value);
|
||||||
sendMessage(Util.format("takenFromAccount", Util.formatCurrency(value)));
|
sendMessage(Util.format("takenFromAccount", Util.formatCurrency(value)));
|
||||||
|
if (initiator != null)
|
||||||
|
{
|
||||||
|
initiator.sendMessage((Util.format("addedToAccount", Util.formatCurrency(value))));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean canAfford(double cost)
|
public boolean canAfford(double cost)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue