Add a scoreboard that can be given to people by default when they join as specified in issue #79.
This was hacked together as I wanted more functionality. Should probably make this prettier and better later.
This commit is contained in:
@@ -11,6 +11,7 @@ import org.bukkit.Bukkit;
|
||||
import org.bukkit.OfflinePlayer;
|
||||
import org.bukkit.plugin.RegisteredServiceProvider;
|
||||
|
||||
import java.text.DecimalFormat;
|
||||
import java.util.HashSet;
|
||||
import java.util.Set;
|
||||
import java.util.UUID;
|
||||
@@ -384,6 +385,12 @@ public class Econ {
|
||||
return econ.getBalance(Bukkit.getOfflinePlayer(account));
|
||||
}
|
||||
|
||||
private static final DecimalFormat format = new DecimalFormat("#,###");
|
||||
|
||||
public static String getFriendlyBalance(UUID uuid) {
|
||||
return format.format(econ.getBalance(Bukkit.getOfflinePlayer(uuid)));
|
||||
}
|
||||
|
||||
public static boolean setBalance(String account, double amount) {
|
||||
double current = econ.getBalance(Bukkit.getOfflinePlayer(account));
|
||||
if (current > amount) {
|
||||
|
||||
Reference in New Issue
Block a user