package Sdf1_login; import java.util.List; public class IPGroupManager { private final Main plugin; private int maxAccounts; public IPGroupManager(Main plugin, int maxAccounts) { this.plugin = plugin; this.maxAccounts = maxAccounts; } public int getMaxAccounts() { return maxAccounts; } public void setMaxAccounts(int max) { this.maxAccounts = max; } public List getAccountsByIP(String ip) { return plugin.getDb().getAccountsByIP(ip); } public int getAccountCount(String ip) { if (ip == null) return 0; return getAccountsByIP(ip).size(); } public boolean canRegister(String ip) { if (maxAccounts <= 0) return true; return getAccountCount(ip) < maxAccounts; } }