mirror of
https://github.com/SimplexDevelopment/FreedomNetworkSuite.git
synced 2025-07-01 21:26:41 +00:00
Updates 💯
This commit is contained in:
@ -0,0 +1,35 @@
|
||||
package me.totalfreedom.data;
|
||||
|
||||
import me.totalfreedom.security.ban.Ban;
|
||||
import me.totalfreedom.security.ban.BanID;
|
||||
import me.totalfreedom.sql.SQL;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
public class BanRegistry
|
||||
{
|
||||
private final List<Ban> bansList = new ArrayList<>();
|
||||
|
||||
public boolean addBan(Ban ban) {
|
||||
return bansList.add(ban);
|
||||
}
|
||||
|
||||
public boolean removeBan(Ban ban) {
|
||||
return bansList.remove(ban);
|
||||
}
|
||||
|
||||
@Nullable
|
||||
public Ban getBan(BanID banID)
|
||||
{
|
||||
for (Ban ban : bansList)
|
||||
{
|
||||
if (ban.getBanID().matches(banID))
|
||||
{
|
||||
return ban;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
@ -2,10 +2,25 @@ package me.totalfreedom.data;
|
||||
|
||||
import me.totalfreedom.config.Configuration;
|
||||
|
||||
import java.util.HashSet;
|
||||
import java.util.Set;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
public class ConfigRegistry
|
||||
{
|
||||
Set<Configuration> configurationSet = new HashSet<>();
|
||||
private final Map<String, Configuration> configurationList = new HashMap<>();
|
||||
|
||||
public void register(String name, Configuration configuration)
|
||||
{
|
||||
configurationList.put(name, configuration);
|
||||
}
|
||||
|
||||
public void unregister(String name)
|
||||
{
|
||||
configurationList.remove(name);
|
||||
}
|
||||
|
||||
public Configuration getConfiguration(String name)
|
||||
{
|
||||
return configurationList.get(name);
|
||||
}
|
||||
}
|
||||
|
@ -1,6 +1,6 @@
|
||||
package me.totalfreedom.data;
|
||||
|
||||
import me.totalfreedom.security.Group;
|
||||
import me.totalfreedom.security.perm.Group;
|
||||
import net.kyori.adventure.text.serializer.plain.PlainTextComponentSerializer;
|
||||
|
||||
import java.util.ArrayList;
|
||||
|
Reference in New Issue
Block a user