dev.the_fireplace.grandeconomy.nativeeconomy.AccountManager Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of GrandEconomy Show documentation
Show all versions of GrandEconomy Show documentation
A server-side economy mod/api for Minecraft.
package dev.the_fireplace.grandeconomy.nativeeconomy;
import java.util.Map;
import java.util.UUID;
import java.util.concurrent.ConcurrentHashMap;
public class AccountManager {
private static final Map ACCOUNT_INSTANCES = new ConcurrentHashMap<>();
public static BalanceTracker get(UUID accountId) {
return ACCOUNT_INSTANCES.computeIfAbsent(accountId, BalanceTracker::create);
}
public static boolean delete(UUID accountId) {
BalanceTracker account = ACCOUNT_INSTANCES.remove(accountId);
if (account != null) {
account.delete();
return true;
}
return false;
}
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy