Refactor managers

This commit is contained in:
Luck 2016-11-25 18:28:00 +00:00
parent a9f29da4f8
commit 443906da55
No known key found for this signature in database
GPG Key ID: EFA9B3EC5FD90F8B
127 changed files with 495 additions and 296 deletions

View File

@ -36,7 +36,7 @@ import me.lucko.luckperms.common.calculators.PermissionProcessor;
import me.lucko.luckperms.common.calculators.processors.MapProcessor; import me.lucko.luckperms.common.calculators.processors.MapProcessor;
import me.lucko.luckperms.common.calculators.processors.RegexProcessor; import me.lucko.luckperms.common.calculators.processors.RegexProcessor;
import me.lucko.luckperms.common.calculators.processors.WildcardProcessor; import me.lucko.luckperms.common.calculators.processors.WildcardProcessor;
import me.lucko.luckperms.common.users.User; import me.lucko.luckperms.common.core.model.User;
import java.util.UUID; import java.util.UUID;

View File

@ -25,7 +25,7 @@ package me.lucko.luckperms.bukkit;
import me.lucko.luckperms.bukkit.inject.Injector; import me.lucko.luckperms.bukkit.inject.Injector;
import me.lucko.luckperms.bukkit.model.LPPermissible; import me.lucko.luckperms.bukkit.model.LPPermissible;
import me.lucko.luckperms.common.constants.Message; import me.lucko.luckperms.common.constants.Message;
import me.lucko.luckperms.common.users.User; import me.lucko.luckperms.common.core.model.User;
import me.lucko.luckperms.common.utils.AbstractListener; import me.lucko.luckperms.common.utils.AbstractListener;
import org.bukkit.entity.Player; import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler; import org.bukkit.event.EventHandler;

View File

@ -45,16 +45,19 @@ import me.lucko.luckperms.common.constants.Permission;
import me.lucko.luckperms.common.contexts.ContextManager; import me.lucko.luckperms.common.contexts.ContextManager;
import me.lucko.luckperms.common.contexts.ServerCalculator; import me.lucko.luckperms.common.contexts.ServerCalculator;
import me.lucko.luckperms.common.core.UuidCache; import me.lucko.luckperms.common.core.UuidCache;
import me.lucko.luckperms.common.core.model.User;
import me.lucko.luckperms.common.data.Importer; import me.lucko.luckperms.common.data.Importer;
import me.lucko.luckperms.common.groups.GroupManager; import me.lucko.luckperms.common.managers.GroupManager;
import me.lucko.luckperms.common.managers.TrackManager;
import me.lucko.luckperms.common.managers.UserManager;
import me.lucko.luckperms.common.managers.impl.GenericGroupManager;
import me.lucko.luckperms.common.managers.impl.GenericTrackManager;
import me.lucko.luckperms.common.managers.impl.GenericUserManager;
import me.lucko.luckperms.common.messaging.RedisMessaging; import me.lucko.luckperms.common.messaging.RedisMessaging;
import me.lucko.luckperms.common.storage.Storage; import me.lucko.luckperms.common.storage.Storage;
import me.lucko.luckperms.common.storage.StorageFactory; import me.lucko.luckperms.common.storage.StorageFactory;
import me.lucko.luckperms.common.tasks.ExpireTemporaryTask; import me.lucko.luckperms.common.tasks.ExpireTemporaryTask;
import me.lucko.luckperms.common.tasks.UpdateTask; import me.lucko.luckperms.common.tasks.UpdateTask;
import me.lucko.luckperms.common.tracks.TrackManager;
import me.lucko.luckperms.common.users.User;
import me.lucko.luckperms.common.users.UserManager;
import me.lucko.luckperms.common.utils.*; import me.lucko.luckperms.common.utils.*;
import org.bukkit.World; import org.bukkit.World;
import org.bukkit.command.PluginCommand; import org.bukkit.command.PluginCommand;
@ -197,9 +200,9 @@ public class LPBukkitPlugin extends JavaPlugin implements LuckPermsPlugin {
// load internal managers // load internal managers
getLog().info("Loading internal permission managers..."); getLog().info("Loading internal permission managers...");
uuidCache = new UuidCache(getConfiguration().isOnlineMode()); uuidCache = new UuidCache(getConfiguration().isOnlineMode());
userManager = new UserManager(this); userManager = new GenericUserManager(this);
groupManager = new GroupManager(this); groupManager = new GenericGroupManager(this);
trackManager = new TrackManager(); trackManager = new GenericTrackManager();
importer = new Importer(commandManager); importer = new Importer(commandManager);
consecutiveExecutor = new ConsecutiveExecutor(commandManager); consecutiveExecutor = new ConsecutiveExecutor(commandManager);
calculatorFactory = new BukkitCalculatorFactory(this); calculatorFactory = new BukkitCalculatorFactory(this);

View File

@ -31,7 +31,8 @@ import me.lucko.luckperms.common.commands.CommandResult;
import me.lucko.luckperms.common.commands.SubCommand; import me.lucko.luckperms.common.commands.SubCommand;
import me.lucko.luckperms.common.commands.sender.Sender; import me.lucko.luckperms.common.commands.sender.Sender;
import me.lucko.luckperms.common.constants.Constants; import me.lucko.luckperms.common.constants.Constants;
import me.lucko.luckperms.common.core.PermissionHolder; import me.lucko.luckperms.common.core.model.PermissionHolder;
import me.lucko.luckperms.common.core.model.User;
import me.lucko.luckperms.common.data.LogEntry; import me.lucko.luckperms.common.data.LogEntry;
import me.lucko.luckperms.common.utils.Predicates; import me.lucko.luckperms.common.utils.Predicates;
import me.lucko.luckperms.exceptions.ObjectAlreadyHasException; import me.lucko.luckperms.exceptions.ObjectAlreadyHasException;
@ -123,7 +124,7 @@ public class MigrationBPermissions extends SubCommand<Object> {
// Make a LuckPerms group for the one being migrated. // Make a LuckPerms group for the one being migrated.
plugin.getStorage().createAndLoadGroup(groupName).join(); plugin.getStorage().createAndLoadGroup(groupName).join();
me.lucko.luckperms.common.groups.Group lpGroup = plugin.getGroupManager().get(groupName); me.lucko.luckperms.common.core.model.Group lpGroup = plugin.getGroupManager().get(groupName);
try { try {
LogEntry.build() LogEntry.build()
.actor(Constants.getConsoleUUID()).actorName(Constants.getConsoleName()) .actor(Constants.getConsoleUUID()).actorName(Constants.getConsoleName())
@ -159,7 +160,7 @@ public class MigrationBPermissions extends SubCommand<Object> {
// Make a LuckPerms user for the one being migrated. // Make a LuckPerms user for the one being migrated.
plugin.getStorage().loadUser(uuid, "null").join(); plugin.getStorage().loadUser(uuid, "null").join();
me.lucko.luckperms.common.users.User lpUser = plugin.getUserManager().get(uuid); User lpUser = plugin.getUserManager().get(uuid);
migrateHolder(plugin, world, user, lpUser); migrateHolder(plugin, world, user, lpUser);

View File

@ -73,7 +73,7 @@ public class MigrationGroupManager extends SubCommand<Object> {
for (Group g : gg.getGroupList()) { for (Group g : gg.getGroupList()) {
plugin.getStorage().createAndLoadGroup(g.getName().toLowerCase()).join(); plugin.getStorage().createAndLoadGroup(g.getName().toLowerCase()).join();
me.lucko.luckperms.common.groups.Group group = plugin.getGroupManager().get(g.getName().toLowerCase()); me.lucko.luckperms.common.core.model.Group group = plugin.getGroupManager().get(g.getName().toLowerCase());
try { try {
LogEntry.build() LogEntry.build()
.actor(Constants.getConsoleUUID()).actorName(Constants.getConsoleName()) .actor(Constants.getConsoleUUID()).actorName(Constants.getConsoleName())
@ -196,7 +196,7 @@ public class MigrationGroupManager extends SubCommand<Object> {
for (Map.Entry<String, Map<Map.Entry<String, String>, Boolean>> e : groups.entrySet()) { for (Map.Entry<String, Map<Map.Entry<String, String>, Boolean>> e : groups.entrySet()) {
plugin.getStorage().createAndLoadGroup(e.getKey()).join(); plugin.getStorage().createAndLoadGroup(e.getKey()).join();
me.lucko.luckperms.common.groups.Group group = plugin.getGroupManager().get(e.getKey()); me.lucko.luckperms.common.core.model.Group group = plugin.getGroupManager().get(e.getKey());
try { try {
LogEntry.build() LogEntry.build()
.actor(Constants.getConsoleUUID()).actorName(Constants.getConsoleName()) .actor(Constants.getConsoleUUID()).actorName(Constants.getConsoleName())
@ -239,7 +239,7 @@ public class MigrationGroupManager extends SubCommand<Object> {
for (Map.Entry<UUID, Map<Map.Entry<String, String>, Boolean>> e : users.entrySet()) { for (Map.Entry<UUID, Map<Map.Entry<String, String>, Boolean>> e : users.entrySet()) {
plugin.getStorage().loadUser(e.getKey(), "null").join(); plugin.getStorage().loadUser(e.getKey(), "null").join();
me.lucko.luckperms.common.users.User user = plugin.getUserManager().get(e.getKey()); me.lucko.luckperms.common.core.model.User user = plugin.getUserManager().get(e.getKey());
for (Map.Entry<Map.Entry<String, String>, Boolean> n : e.getValue().entrySet()) { for (Map.Entry<Map.Entry<String, String>, Boolean> n : e.getValue().entrySet()) {
// n.key.key = world // n.key.key = world

View File

@ -33,9 +33,9 @@ import me.lucko.luckperms.common.commands.SubCommand;
import me.lucko.luckperms.common.commands.sender.Sender; import me.lucko.luckperms.common.commands.sender.Sender;
import me.lucko.luckperms.common.constants.Constants; import me.lucko.luckperms.common.constants.Constants;
import me.lucko.luckperms.common.constants.Permission; import me.lucko.luckperms.common.constants.Permission;
import me.lucko.luckperms.common.core.model.Group;
import me.lucko.luckperms.common.core.model.User;
import me.lucko.luckperms.common.data.LogEntry; import me.lucko.luckperms.common.data.LogEntry;
import me.lucko.luckperms.common.groups.Group;
import me.lucko.luckperms.common.users.User;
import me.lucko.luckperms.common.utils.Predicates; import me.lucko.luckperms.common.utils.Predicates;
import me.lucko.luckperms.exceptions.ObjectAlreadyHasException; import me.lucko.luckperms.exceptions.ObjectAlreadyHasException;
import ru.tehkode.permissions.NativeInterface; import ru.tehkode.permissions.NativeInterface;

View File

@ -36,9 +36,9 @@ import me.lucko.luckperms.common.commands.CommandResult;
import me.lucko.luckperms.common.commands.SubCommand; import me.lucko.luckperms.common.commands.SubCommand;
import me.lucko.luckperms.common.commands.sender.Sender; import me.lucko.luckperms.common.commands.sender.Sender;
import me.lucko.luckperms.common.constants.Constants; import me.lucko.luckperms.common.constants.Constants;
import me.lucko.luckperms.common.core.PermissionHolder; import me.lucko.luckperms.common.core.model.PermissionHolder;
import me.lucko.luckperms.common.core.model.User;
import me.lucko.luckperms.common.data.LogEntry; import me.lucko.luckperms.common.data.LogEntry;
import me.lucko.luckperms.common.users.User;
import me.lucko.luckperms.common.utils.Predicates; import me.lucko.luckperms.common.utils.Predicates;
import me.lucko.luckperms.exceptions.ObjectAlreadyHasException; import me.lucko.luckperms.exceptions.ObjectAlreadyHasException;
@ -252,7 +252,7 @@ public class MigrationPowerfulPerms extends SubCommand<Object> {
Map<Integer, Group> groups = pm.getGroups(); // All versions Map<Integer, Group> groups = pm.getGroups(); // All versions
for (Group g : groups.values()) { for (Group g : groups.values()) {
plugin.getStorage().createAndLoadGroup(g.getName().toLowerCase()).join(); plugin.getStorage().createAndLoadGroup(g.getName().toLowerCase()).join();
final me.lucko.luckperms.common.groups.Group group = plugin.getGroupManager().get(g.getName().toLowerCase()); final me.lucko.luckperms.common.core.model.Group group = plugin.getGroupManager().get(g.getName().toLowerCase());
try { try {
LogEntry.build() LogEntry.build()
.actor(Constants.getConsoleUUID()).actorName(Constants.getConsoleName()) .actor(Constants.getConsoleUUID()).actorName(Constants.getConsoleName())

View File

@ -30,10 +30,10 @@ import me.lucko.luckperms.common.commands.SubCommand;
import me.lucko.luckperms.common.commands.sender.Sender; import me.lucko.luckperms.common.commands.sender.Sender;
import me.lucko.luckperms.common.constants.Permission; import me.lucko.luckperms.common.constants.Permission;
import me.lucko.luckperms.common.core.NodeFactory; import me.lucko.luckperms.common.core.NodeFactory;
import me.lucko.luckperms.common.core.PermissionHolder; import me.lucko.luckperms.common.core.model.Group;
import me.lucko.luckperms.common.groups.Group; import me.lucko.luckperms.common.core.model.PermissionHolder;
import me.lucko.luckperms.common.tracks.Track; import me.lucko.luckperms.common.core.model.Track;
import me.lucko.luckperms.common.users.User; import me.lucko.luckperms.common.core.model.User;
import me.lucko.luckperms.common.utils.Predicates; import me.lucko.luckperms.common.utils.Predicates;
import me.lucko.luckperms.exceptions.ObjectAlreadyHasException; import me.lucko.luckperms.exceptions.ObjectAlreadyHasException;
import org.tyrannyofheaven.bukkit.zPermissions.ZPermissionsService; import org.tyrannyofheaven.bukkit.zPermissions.ZPermissionsService;

View File

@ -27,7 +27,7 @@ import lombok.NonNull;
import me.lucko.luckperms.api.Contexts; import me.lucko.luckperms.api.Contexts;
import me.lucko.luckperms.api.Tristate; import me.lucko.luckperms.api.Tristate;
import me.lucko.luckperms.bukkit.LPBukkitPlugin; import me.lucko.luckperms.bukkit.LPBukkitPlugin;
import me.lucko.luckperms.common.users.User; import me.lucko.luckperms.common.core.model.User;
import org.bukkit.Bukkit; import org.bukkit.Bukkit;
import org.bukkit.entity.Player; import org.bukkit.entity.Player;
import org.bukkit.permissions.*; import org.bukkit.permissions.*;

View File

@ -29,9 +29,9 @@ import me.lucko.luckperms.api.caching.MetaData;
import me.lucko.luckperms.api.context.ContextSet; import me.lucko.luckperms.api.context.ContextSet;
import me.lucko.luckperms.common.core.NodeBuilder; import me.lucko.luckperms.common.core.NodeBuilder;
import me.lucko.luckperms.common.core.NodeFactory; import me.lucko.luckperms.common.core.NodeFactory;
import me.lucko.luckperms.common.core.PermissionHolder; import me.lucko.luckperms.common.core.model.Group;
import me.lucko.luckperms.common.groups.Group; import me.lucko.luckperms.common.core.model.PermissionHolder;
import me.lucko.luckperms.common.users.User; import me.lucko.luckperms.common.core.model.User;
import me.lucko.luckperms.common.utils.ExtractedContexts; import me.lucko.luckperms.common.utils.ExtractedContexts;
import me.lucko.luckperms.exceptions.ObjectAlreadyHasException; import me.lucko.luckperms.exceptions.ObjectAlreadyHasException;
import me.lucko.luckperms.exceptions.ObjectLacksException; import me.lucko.luckperms.exceptions.ObjectLacksException;

View File

@ -33,9 +33,9 @@ import me.lucko.luckperms.api.Tristate;
import me.lucko.luckperms.api.caching.PermissionData; import me.lucko.luckperms.api.caching.PermissionData;
import me.lucko.luckperms.api.context.ContextSet; import me.lucko.luckperms.api.context.ContextSet;
import me.lucko.luckperms.bukkit.LPBukkitPlugin; import me.lucko.luckperms.bukkit.LPBukkitPlugin;
import me.lucko.luckperms.common.core.PermissionHolder; import me.lucko.luckperms.common.core.model.Group;
import me.lucko.luckperms.common.groups.Group; import me.lucko.luckperms.common.core.model.PermissionHolder;
import me.lucko.luckperms.common.users.User; import me.lucko.luckperms.common.core.model.User;
import me.lucko.luckperms.exceptions.ObjectAlreadyHasException; import me.lucko.luckperms.exceptions.ObjectAlreadyHasException;
import me.lucko.luckperms.exceptions.ObjectLacksException; import me.lucko.luckperms.exceptions.ObjectLacksException;
import net.milkbowl.vault.permission.Permission; import net.milkbowl.vault.permission.Permission;

View File

@ -31,7 +31,7 @@ import me.lucko.luckperms.common.calculators.PermissionProcessor;
import me.lucko.luckperms.common.calculators.processors.MapProcessor; import me.lucko.luckperms.common.calculators.processors.MapProcessor;
import me.lucko.luckperms.common.calculators.processors.RegexProcessor; import me.lucko.luckperms.common.calculators.processors.RegexProcessor;
import me.lucko.luckperms.common.calculators.processors.WildcardProcessor; import me.lucko.luckperms.common.calculators.processors.WildcardProcessor;
import me.lucko.luckperms.common.users.User; import me.lucko.luckperms.common.core.model.User;
@AllArgsConstructor @AllArgsConstructor
public class BungeeCalculatorFactory implements CalculatorFactory { public class BungeeCalculatorFactory implements CalculatorFactory {

View File

@ -26,8 +26,8 @@ import me.lucko.luckperms.api.Contexts;
import me.lucko.luckperms.api.event.events.UserFirstLoginEvent; import me.lucko.luckperms.api.event.events.UserFirstLoginEvent;
import me.lucko.luckperms.common.constants.Message; import me.lucko.luckperms.common.constants.Message;
import me.lucko.luckperms.common.core.UuidCache; import me.lucko.luckperms.common.core.UuidCache;
import me.lucko.luckperms.common.core.model.User;
import me.lucko.luckperms.common.defaults.Rule; import me.lucko.luckperms.common.defaults.Rule;
import me.lucko.luckperms.common.users.User;
import me.lucko.luckperms.common.utils.AbstractListener; import me.lucko.luckperms.common.utils.AbstractListener;
import net.md_5.bungee.api.chat.TextComponent; import net.md_5.bungee.api.chat.TextComponent;
import net.md_5.bungee.api.connection.PendingConnection; import net.md_5.bungee.api.connection.PendingConnection;

View File

@ -39,16 +39,19 @@ import me.lucko.luckperms.common.config.LPConfiguration;
import me.lucko.luckperms.common.contexts.ContextManager; import me.lucko.luckperms.common.contexts.ContextManager;
import me.lucko.luckperms.common.contexts.ServerCalculator; import me.lucko.luckperms.common.contexts.ServerCalculator;
import me.lucko.luckperms.common.core.UuidCache; import me.lucko.luckperms.common.core.UuidCache;
import me.lucko.luckperms.common.core.model.User;
import me.lucko.luckperms.common.data.Importer; import me.lucko.luckperms.common.data.Importer;
import me.lucko.luckperms.common.groups.GroupManager; import me.lucko.luckperms.common.managers.GroupManager;
import me.lucko.luckperms.common.managers.TrackManager;
import me.lucko.luckperms.common.managers.UserManager;
import me.lucko.luckperms.common.managers.impl.GenericGroupManager;
import me.lucko.luckperms.common.managers.impl.GenericTrackManager;
import me.lucko.luckperms.common.managers.impl.GenericUserManager;
import me.lucko.luckperms.common.messaging.RedisMessaging; import me.lucko.luckperms.common.messaging.RedisMessaging;
import me.lucko.luckperms.common.storage.Storage; import me.lucko.luckperms.common.storage.Storage;
import me.lucko.luckperms.common.storage.StorageFactory; import me.lucko.luckperms.common.storage.StorageFactory;
import me.lucko.luckperms.common.tasks.ExpireTemporaryTask; import me.lucko.luckperms.common.tasks.ExpireTemporaryTask;
import me.lucko.luckperms.common.tasks.UpdateTask; import me.lucko.luckperms.common.tasks.UpdateTask;
import me.lucko.luckperms.common.tracks.TrackManager;
import me.lucko.luckperms.common.users.User;
import me.lucko.luckperms.common.users.UserManager;
import me.lucko.luckperms.common.utils.*; import me.lucko.luckperms.common.utils.*;
import net.md_5.bungee.api.config.ServerInfo; import net.md_5.bungee.api.config.ServerInfo;
import net.md_5.bungee.api.connection.ProxiedPlayer; import net.md_5.bungee.api.connection.ProxiedPlayer;
@ -150,9 +153,9 @@ public class LPBungeePlugin extends Plugin implements LuckPermsPlugin {
// load internal managers // load internal managers
getLog().info("Loading internal permission managers..."); getLog().info("Loading internal permission managers...");
uuidCache = new UuidCache(getConfiguration().isOnlineMode()); uuidCache = new UuidCache(getConfiguration().isOnlineMode());
userManager = new UserManager(this); userManager = new GenericUserManager(this);
groupManager = new GroupManager(this); groupManager = new GenericGroupManager(this);
trackManager = new TrackManager(); trackManager = new GenericTrackManager();
importer = new Importer(commandManager); importer = new Importer(commandManager);
consecutiveExecutor = new ConsecutiveExecutor(commandManager); consecutiveExecutor = new ConsecutiveExecutor(commandManager);
calculatorFactory = new BungeeCalculatorFactory(this); calculatorFactory = new BungeeCalculatorFactory(this);

View File

@ -65,7 +65,7 @@ public class MigrationBungeePerms extends SubCommand<Object> {
// Make a LuckPerms group for the one being migrated // Make a LuckPerms group for the one being migrated
plugin.getStorage().createAndLoadGroup(g.getName().toLowerCase()).join(); plugin.getStorage().createAndLoadGroup(g.getName().toLowerCase()).join();
me.lucko.luckperms.common.groups.Group group = plugin.getGroupManager().get(g.getName().toLowerCase()); me.lucko.luckperms.common.core.model.Group group = plugin.getGroupManager().get(g.getName().toLowerCase());
try { try {
LogEntry.build() LogEntry.build()
.actor(Constants.getConsoleUUID()).actorName(Constants.getConsoleName()) .actor(Constants.getConsoleUUID()).actorName(Constants.getConsoleName())
@ -189,7 +189,7 @@ public class MigrationBungeePerms extends SubCommand<Object> {
// Make a LuckPerms user for the one being migrated. // Make a LuckPerms user for the one being migrated.
plugin.getStorage().loadUser(u.getUUID(), "null").join(); plugin.getStorage().loadUser(u.getUUID(), "null").join();
me.lucko.luckperms.common.users.User user = plugin.getUserManager().get(u.getUUID()); me.lucko.luckperms.common.core.model.User user = plugin.getUserManager().get(u.getUUID());
// Migrate global perms // Migrate global perms
for (String perm : u.getPerms()) { for (String perm : u.getPerms()) {

View File

@ -34,13 +34,13 @@ import me.lucko.luckperms.common.config.LPConfiguration;
import me.lucko.luckperms.common.constants.Message; import me.lucko.luckperms.common.constants.Message;
import me.lucko.luckperms.common.contexts.ContextManager; import me.lucko.luckperms.common.contexts.ContextManager;
import me.lucko.luckperms.common.core.UuidCache; import me.lucko.luckperms.common.core.UuidCache;
import me.lucko.luckperms.common.core.model.User;
import me.lucko.luckperms.common.data.Importer; import me.lucko.luckperms.common.data.Importer;
import me.lucko.luckperms.common.groups.GroupManager; import me.lucko.luckperms.common.managers.GroupManager;
import me.lucko.luckperms.common.managers.TrackManager;
import me.lucko.luckperms.common.managers.UserManager;
import me.lucko.luckperms.common.messaging.RedisMessaging; import me.lucko.luckperms.common.messaging.RedisMessaging;
import me.lucko.luckperms.common.storage.Storage; import me.lucko.luckperms.common.storage.Storage;
import me.lucko.luckperms.common.tracks.TrackManager;
import me.lucko.luckperms.common.users.User;
import me.lucko.luckperms.common.users.UserManager;
import me.lucko.luckperms.common.utils.BufferedRequest; import me.lucko.luckperms.common.utils.BufferedRequest;
import me.lucko.luckperms.common.utils.DebugHandler; import me.lucko.luckperms.common.utils.DebugHandler;
import me.lucko.luckperms.common.utils.LocaleManager; import me.lucko.luckperms.common.utils.LocaleManager;

View File

@ -33,7 +33,7 @@ import me.lucko.luckperms.api.event.LPListener;
import me.lucko.luckperms.common.LuckPermsPlugin; import me.lucko.luckperms.common.LuckPermsPlugin;
import me.lucko.luckperms.common.api.internal.*; import me.lucko.luckperms.common.api.internal.*;
import me.lucko.luckperms.common.core.NodeBuilder; import me.lucko.luckperms.common.core.NodeBuilder;
import me.lucko.luckperms.common.users.UserIdentifier; import me.lucko.luckperms.common.core.UserIdentifier;
import java.util.Optional; import java.util.Optional;
import java.util.Set; import java.util.Set;
@ -127,7 +127,7 @@ public class ApiProvider implements LuckPermsApi {
@Override @Override
public User getUser(@NonNull UUID uuid) { public User getUser(@NonNull UUID uuid) {
final me.lucko.luckperms.common.users.User user = plugin.getUserManager().get(uuid); final me.lucko.luckperms.common.core.model.User user = plugin.getUserManager().get(uuid);
return user == null ? null : new UserLink(user); return user == null ? null : new UserLink(user);
} }
@ -138,7 +138,7 @@ public class ApiProvider implements LuckPermsApi {
@Override @Override
public User getUser(@NonNull String name) { public User getUser(@NonNull String name) {
final me.lucko.luckperms.common.users.User user = plugin.getUserManager().get(name); final me.lucko.luckperms.common.core.model.User user = plugin.getUserManager().get(name);
return user == null ? null : new UserLink(user); return user == null ? null : new UserLink(user);
} }
@ -165,7 +165,7 @@ public class ApiProvider implements LuckPermsApi {
@Override @Override
public Group getGroup(@NonNull String name) { public Group getGroup(@NonNull String name) {
final me.lucko.luckperms.common.groups.Group group = plugin.getGroupManager().get(name); final me.lucko.luckperms.common.core.model.Group group = plugin.getGroupManager().get(name);
return group == null ? null : new GroupLink(group); return group == null ? null : new GroupLink(group);
} }
@ -186,7 +186,7 @@ public class ApiProvider implements LuckPermsApi {
@Override @Override
public Track getTrack(@NonNull String name) { public Track getTrack(@NonNull String name) {
final me.lucko.luckperms.common.tracks.Track track = plugin.getTrackManager().get(name); final me.lucko.luckperms.common.core.model.Track track = plugin.getTrackManager().get(name);
return track == null ? null : new TrackLink(track); return track == null ? null : new TrackLink(track);
} }

View File

@ -35,19 +35,19 @@ import java.util.List;
import static me.lucko.luckperms.common.api.internal.Utils.*; import static me.lucko.luckperms.common.api.internal.Utils.*;
/** /**
* Provides a link between {@link Group} and {@link me.lucko.luckperms.common.groups.Group} * Provides a link between {@link Group} and {@link me.lucko.luckperms.common.core.model.Group}
*/ */
@EqualsAndHashCode(of = {"name"}, callSuper = false) @EqualsAndHashCode(of = {"name"}, callSuper = false)
@SuppressWarnings("unused") @SuppressWarnings("unused")
public class GroupLink extends PermissionHolderLink implements Group { public class GroupLink extends PermissionHolderLink implements Group {
@Getter(AccessLevel.PACKAGE) @Getter(AccessLevel.PACKAGE)
private final me.lucko.luckperms.common.groups.Group master; private final me.lucko.luckperms.common.core.model.Group master;
@Getter @Getter
private final String name; private final String name;
public GroupLink(@NonNull me.lucko.luckperms.common.groups.Group master) { public GroupLink(@NonNull me.lucko.luckperms.common.core.model.Group master) {
super(master); super(master);
this.master = master; this.master = master;
this.name = master.getName(); this.name = master.getName();

View File

@ -33,15 +33,15 @@ import me.lucko.luckperms.exceptions.ObjectLacksException;
import java.util.*; import java.util.*;
import static me.lucko.luckperms.common.api.internal.Utils.*; import static me.lucko.luckperms.common.api.internal.Utils.*;
import static me.lucko.luckperms.common.core.PermissionHolder.exportToLegacy; import static me.lucko.luckperms.common.core.model.PermissionHolder.exportToLegacy;
/** /**
* Provides a link between {@link PermissionHolder} and {@link me.lucko.luckperms.common.core.PermissionHolder} * Provides a link between {@link PermissionHolder} and {@link me.lucko.luckperms.common.core.model.PermissionHolder}
*/ */
@SuppressWarnings("unused") @SuppressWarnings("unused")
@AllArgsConstructor @AllArgsConstructor
public class PermissionHolderLink implements PermissionHolder { public class PermissionHolderLink implements PermissionHolder {
private final me.lucko.luckperms.common.core.PermissionHolder master; private final me.lucko.luckperms.common.core.model.PermissionHolder master;
@Override @Override
public String getObjectName() { public String getObjectName() {

View File

@ -36,19 +36,19 @@ import java.util.List;
import static me.lucko.luckperms.common.api.internal.Utils.checkGroup; import static me.lucko.luckperms.common.api.internal.Utils.checkGroup;
/** /**
* Provides a link between {@link Track} and {@link me.lucko.luckperms.common.tracks.Track} * Provides a link between {@link Track} and {@link me.lucko.luckperms.common.core.model.Track}
*/ */
@EqualsAndHashCode(of = {"name"}) @EqualsAndHashCode(of = {"name"})
@SuppressWarnings("unused") @SuppressWarnings("unused")
public class TrackLink implements Track { public class TrackLink implements Track {
@Getter(AccessLevel.PACKAGE) @Getter(AccessLevel.PACKAGE)
private final me.lucko.luckperms.common.tracks.Track master; private final me.lucko.luckperms.common.core.model.Track master;
@Getter @Getter
private final String name; private final String name;
public TrackLink(@NonNull me.lucko.luckperms.common.tracks.Track master) { public TrackLink(@NonNull me.lucko.luckperms.common.core.model.Track master) {
this.master = master; this.master = master;
this.name = master.getName(); this.name = master.getName();
} }

View File

@ -38,19 +38,19 @@ import java.util.UUID;
import static me.lucko.luckperms.common.api.internal.Utils.*; import static me.lucko.luckperms.common.api.internal.Utils.*;
/** /**
* Provides a link between {@link User} and {@link me.lucko.luckperms.common.users.User} * Provides a link between {@link User} and {@link me.lucko.luckperms.common.core.model.User}
*/ */
@EqualsAndHashCode(of = {"uuid"}, callSuper = false) @EqualsAndHashCode(of = {"uuid"}, callSuper = false)
@SuppressWarnings("unused") @SuppressWarnings("unused")
public class UserLink extends PermissionHolderLink implements User { public class UserLink extends PermissionHolderLink implements User {
@Getter @Getter
private final me.lucko.luckperms.common.users.User master; private final me.lucko.luckperms.common.core.model.User master;
@Getter @Getter
private final UUID uuid; private final UUID uuid;
public UserLink(@NonNull me.lucko.luckperms.common.users.User master) { public UserLink(@NonNull me.lucko.luckperms.common.core.model.User master) {
super(master); super(master);
this.master = master; this.master = master;
this.uuid = master.getUuid(); this.uuid = master.getUuid();

View File

@ -29,7 +29,7 @@ import me.lucko.luckperms.api.Tristate;
import me.lucko.luckperms.api.caching.PermissionData; import me.lucko.luckperms.api.caching.PermissionData;
import me.lucko.luckperms.common.calculators.CalculatorFactory; import me.lucko.luckperms.common.calculators.CalculatorFactory;
import me.lucko.luckperms.common.calculators.PermissionCalculator; import me.lucko.luckperms.common.calculators.PermissionCalculator;
import me.lucko.luckperms.common.users.User; import me.lucko.luckperms.common.core.model.User;
import java.util.Map; import java.util.Map;
import java.util.concurrent.ConcurrentHashMap; import java.util.concurrent.ConcurrentHashMap;

View File

@ -35,7 +35,7 @@ import me.lucko.luckperms.api.caching.MetaData;
import me.lucko.luckperms.api.caching.PermissionData; import me.lucko.luckperms.api.caching.PermissionData;
import me.lucko.luckperms.api.caching.UserData; import me.lucko.luckperms.api.caching.UserData;
import me.lucko.luckperms.common.calculators.CalculatorFactory; import me.lucko.luckperms.common.calculators.CalculatorFactory;
import me.lucko.luckperms.common.users.User; import me.lucko.luckperms.common.core.model.User;
import me.lucko.luckperms.common.utils.ExtractedContexts; import me.lucko.luckperms.common.utils.ExtractedContexts;
import java.util.Set; import java.util.Set;

View File

@ -23,7 +23,7 @@
package me.lucko.luckperms.common.calculators; package me.lucko.luckperms.common.calculators;
import me.lucko.luckperms.api.Contexts; import me.lucko.luckperms.api.Contexts;
import me.lucko.luckperms.common.users.User; import me.lucko.luckperms.common.core.model.User;
/** /**
* Creates a calculator instance given a set of contexts * Creates a calculator instance given a set of contexts

View File

@ -29,9 +29,9 @@ import me.lucko.luckperms.common.commands.sender.Sender;
import me.lucko.luckperms.common.commands.utils.Util; import me.lucko.luckperms.common.commands.utils.Util;
import me.lucko.luckperms.common.constants.Message; import me.lucko.luckperms.common.constants.Message;
import me.lucko.luckperms.common.constants.Permission; import me.lucko.luckperms.common.constants.Permission;
import me.lucko.luckperms.common.groups.Group; import me.lucko.luckperms.common.core.model.Group;
import me.lucko.luckperms.common.tracks.Track; import me.lucko.luckperms.common.core.model.Track;
import me.lucko.luckperms.common.users.User; import me.lucko.luckperms.common.core.model.User;
import me.lucko.luckperms.common.utils.PermissionCache; import me.lucko.luckperms.common.utils.PermissionCache;
import java.util.*; import java.util.*;

View File

@ -30,7 +30,7 @@ import me.lucko.luckperms.common.commands.sender.Sender;
import me.lucko.luckperms.common.commands.utils.ArgumentUtils; import me.lucko.luckperms.common.commands.utils.ArgumentUtils;
import me.lucko.luckperms.common.commands.utils.Util; import me.lucko.luckperms.common.commands.utils.Util;
import me.lucko.luckperms.common.constants.Message; import me.lucko.luckperms.common.constants.Message;
import me.lucko.luckperms.common.core.PermissionHolder; import me.lucko.luckperms.common.core.model.PermissionHolder;
import me.lucko.luckperms.common.utils.Predicates; import me.lucko.luckperms.common.utils.Predicates;
import java.util.ArrayList; import java.util.ArrayList;

View File

@ -33,9 +33,9 @@ import me.lucko.luckperms.common.commands.SubCommand;
import me.lucko.luckperms.common.commands.sender.Sender; import me.lucko.luckperms.common.commands.sender.Sender;
import me.lucko.luckperms.common.commands.utils.Util; import me.lucko.luckperms.common.commands.utils.Util;
import me.lucko.luckperms.common.constants.Permission; import me.lucko.luckperms.common.constants.Permission;
import me.lucko.luckperms.common.core.PermissionHolder; import me.lucko.luckperms.common.core.model.Group;
import me.lucko.luckperms.common.groups.Group; import me.lucko.luckperms.common.core.model.PermissionHolder;
import me.lucko.luckperms.common.users.User; import me.lucko.luckperms.common.core.model.User;
import java.util.Collections; import java.util.Collections;
import java.util.List; import java.util.List;

View File

@ -25,7 +25,7 @@ package me.lucko.luckperms.common.commands.generic.meta;
import com.google.common.collect.ImmutableList; import com.google.common.collect.ImmutableList;
import me.lucko.luckperms.common.commands.generic.SharedMainCommand; import me.lucko.luckperms.common.commands.generic.SharedMainCommand;
import me.lucko.luckperms.common.commands.generic.SharedSubCommand; import me.lucko.luckperms.common.commands.generic.SharedSubCommand;
import me.lucko.luckperms.common.core.PermissionHolder; import me.lucko.luckperms.common.core.model.PermissionHolder;
public class CommandMeta<T extends PermissionHolder> extends SharedMainCommand<T> { public class CommandMeta<T extends PermissionHolder> extends SharedMainCommand<T> {
public CommandMeta(boolean user) { public CommandMeta(boolean user) {

View File

@ -33,7 +33,7 @@ import me.lucko.luckperms.common.commands.utils.ArgumentUtils;
import me.lucko.luckperms.common.commands.utils.ContextHelper; import me.lucko.luckperms.common.commands.utils.ContextHelper;
import me.lucko.luckperms.common.constants.Message; import me.lucko.luckperms.common.constants.Message;
import me.lucko.luckperms.common.constants.Permission; import me.lucko.luckperms.common.constants.Permission;
import me.lucko.luckperms.common.core.PermissionHolder; import me.lucko.luckperms.common.core.model.PermissionHolder;
import me.lucko.luckperms.common.data.LogEntry; import me.lucko.luckperms.common.data.LogEntry;
import me.lucko.luckperms.common.utils.Predicates; import me.lucko.luckperms.common.utils.Predicates;
import me.lucko.luckperms.exceptions.ObjectAlreadyHasException; import me.lucko.luckperms.exceptions.ObjectAlreadyHasException;

View File

@ -33,7 +33,7 @@ import me.lucko.luckperms.common.commands.utils.ArgumentUtils;
import me.lucko.luckperms.common.commands.utils.ContextHelper; import me.lucko.luckperms.common.commands.utils.ContextHelper;
import me.lucko.luckperms.common.constants.Message; import me.lucko.luckperms.common.constants.Message;
import me.lucko.luckperms.common.constants.Permission; import me.lucko.luckperms.common.constants.Permission;
import me.lucko.luckperms.common.core.PermissionHolder; import me.lucko.luckperms.common.core.model.PermissionHolder;
import me.lucko.luckperms.common.data.LogEntry; import me.lucko.luckperms.common.data.LogEntry;
import me.lucko.luckperms.common.utils.Predicates; import me.lucko.luckperms.common.utils.Predicates;
import me.lucko.luckperms.exceptions.ObjectAlreadyHasException; import me.lucko.luckperms.exceptions.ObjectAlreadyHasException;

View File

@ -33,7 +33,7 @@ import me.lucko.luckperms.common.commands.utils.ArgumentUtils;
import me.lucko.luckperms.common.commands.utils.ContextHelper; import me.lucko.luckperms.common.commands.utils.ContextHelper;
import me.lucko.luckperms.common.constants.Message; import me.lucko.luckperms.common.constants.Message;
import me.lucko.luckperms.common.constants.Permission; import me.lucko.luckperms.common.constants.Permission;
import me.lucko.luckperms.common.core.PermissionHolder; import me.lucko.luckperms.common.core.model.PermissionHolder;
import me.lucko.luckperms.common.data.LogEntry; import me.lucko.luckperms.common.data.LogEntry;
import me.lucko.luckperms.common.utils.DateUtil; import me.lucko.luckperms.common.utils.DateUtil;
import me.lucko.luckperms.common.utils.Predicates; import me.lucko.luckperms.common.utils.Predicates;

View File

@ -33,7 +33,7 @@ import me.lucko.luckperms.common.commands.utils.ArgumentUtils;
import me.lucko.luckperms.common.commands.utils.ContextHelper; import me.lucko.luckperms.common.commands.utils.ContextHelper;
import me.lucko.luckperms.common.constants.Message; import me.lucko.luckperms.common.constants.Message;
import me.lucko.luckperms.common.constants.Permission; import me.lucko.luckperms.common.constants.Permission;
import me.lucko.luckperms.common.core.PermissionHolder; import me.lucko.luckperms.common.core.model.PermissionHolder;
import me.lucko.luckperms.common.data.LogEntry; import me.lucko.luckperms.common.data.LogEntry;
import me.lucko.luckperms.common.utils.DateUtil; import me.lucko.luckperms.common.utils.DateUtil;
import me.lucko.luckperms.common.utils.Predicates; import me.lucko.luckperms.common.utils.Predicates;

View File

@ -32,7 +32,7 @@ import me.lucko.luckperms.common.commands.utils.ArgumentUtils;
import me.lucko.luckperms.common.commands.utils.ContextHelper; import me.lucko.luckperms.common.commands.utils.ContextHelper;
import me.lucko.luckperms.common.constants.Message; import me.lucko.luckperms.common.constants.Message;
import me.lucko.luckperms.common.constants.Permission; import me.lucko.luckperms.common.constants.Permission;
import me.lucko.luckperms.common.core.PermissionHolder; import me.lucko.luckperms.common.core.model.PermissionHolder;
import me.lucko.luckperms.common.data.LogEntry; import me.lucko.luckperms.common.data.LogEntry;
import me.lucko.luckperms.common.utils.Predicates; import me.lucko.luckperms.common.utils.Predicates;

View File

@ -32,7 +32,7 @@ import me.lucko.luckperms.common.commands.sender.Sender;
import me.lucko.luckperms.common.commands.utils.Util; import me.lucko.luckperms.common.commands.utils.Util;
import me.lucko.luckperms.common.constants.Message; import me.lucko.luckperms.common.constants.Message;
import me.lucko.luckperms.common.constants.Permission; import me.lucko.luckperms.common.constants.Permission;
import me.lucko.luckperms.common.core.PermissionHolder; import me.lucko.luckperms.common.core.model.PermissionHolder;
import me.lucko.luckperms.common.utils.ExtractedContexts; import me.lucko.luckperms.common.utils.ExtractedContexts;
import me.lucko.luckperms.common.utils.Predicates; import me.lucko.luckperms.common.utils.Predicates;

View File

@ -34,7 +34,7 @@ import me.lucko.luckperms.common.commands.utils.ArgumentUtils;
import me.lucko.luckperms.common.commands.utils.ContextHelper; import me.lucko.luckperms.common.commands.utils.ContextHelper;
import me.lucko.luckperms.common.constants.Message; import me.lucko.luckperms.common.constants.Message;
import me.lucko.luckperms.common.constants.Permission; import me.lucko.luckperms.common.constants.Permission;
import me.lucko.luckperms.common.core.PermissionHolder; import me.lucko.luckperms.common.core.model.PermissionHolder;
import me.lucko.luckperms.common.data.LogEntry; import me.lucko.luckperms.common.data.LogEntry;
import me.lucko.luckperms.common.utils.Predicates; import me.lucko.luckperms.common.utils.Predicates;
import me.lucko.luckperms.exceptions.ObjectLacksException; import me.lucko.luckperms.exceptions.ObjectLacksException;

View File

@ -34,7 +34,7 @@ import me.lucko.luckperms.common.commands.utils.ArgumentUtils;
import me.lucko.luckperms.common.commands.utils.ContextHelper; import me.lucko.luckperms.common.commands.utils.ContextHelper;
import me.lucko.luckperms.common.constants.Message; import me.lucko.luckperms.common.constants.Message;
import me.lucko.luckperms.common.constants.Permission; import me.lucko.luckperms.common.constants.Permission;
import me.lucko.luckperms.common.core.PermissionHolder; import me.lucko.luckperms.common.core.model.PermissionHolder;
import me.lucko.luckperms.common.data.LogEntry; import me.lucko.luckperms.common.data.LogEntry;
import me.lucko.luckperms.common.utils.Predicates; import me.lucko.luckperms.common.utils.Predicates;
import me.lucko.luckperms.exceptions.ObjectLacksException; import me.lucko.luckperms.exceptions.ObjectLacksException;

View File

@ -34,7 +34,7 @@ import me.lucko.luckperms.common.commands.utils.ArgumentUtils;
import me.lucko.luckperms.common.commands.utils.ContextHelper; import me.lucko.luckperms.common.commands.utils.ContextHelper;
import me.lucko.luckperms.common.constants.Message; import me.lucko.luckperms.common.constants.Message;
import me.lucko.luckperms.common.constants.Permission; import me.lucko.luckperms.common.constants.Permission;
import me.lucko.luckperms.common.core.PermissionHolder; import me.lucko.luckperms.common.core.model.PermissionHolder;
import me.lucko.luckperms.common.data.LogEntry; import me.lucko.luckperms.common.data.LogEntry;
import me.lucko.luckperms.common.utils.Predicates; import me.lucko.luckperms.common.utils.Predicates;
import me.lucko.luckperms.exceptions.ObjectLacksException; import me.lucko.luckperms.exceptions.ObjectLacksException;

View File

@ -34,7 +34,7 @@ import me.lucko.luckperms.common.commands.utils.ArgumentUtils;
import me.lucko.luckperms.common.commands.utils.ContextHelper; import me.lucko.luckperms.common.commands.utils.ContextHelper;
import me.lucko.luckperms.common.constants.Message; import me.lucko.luckperms.common.constants.Message;
import me.lucko.luckperms.common.constants.Permission; import me.lucko.luckperms.common.constants.Permission;
import me.lucko.luckperms.common.core.PermissionHolder; import me.lucko.luckperms.common.core.model.PermissionHolder;
import me.lucko.luckperms.common.data.LogEntry; import me.lucko.luckperms.common.data.LogEntry;
import me.lucko.luckperms.common.utils.Predicates; import me.lucko.luckperms.common.utils.Predicates;
import me.lucko.luckperms.exceptions.ObjectLacksException; import me.lucko.luckperms.exceptions.ObjectLacksException;

View File

@ -34,7 +34,7 @@ import me.lucko.luckperms.common.commands.utils.ContextHelper;
import me.lucko.luckperms.common.constants.Message; import me.lucko.luckperms.common.constants.Message;
import me.lucko.luckperms.common.constants.Permission; import me.lucko.luckperms.common.constants.Permission;
import me.lucko.luckperms.common.core.NodeFactory; import me.lucko.luckperms.common.core.NodeFactory;
import me.lucko.luckperms.common.core.PermissionHolder; import me.lucko.luckperms.common.core.model.PermissionHolder;
import me.lucko.luckperms.common.data.LogEntry; import me.lucko.luckperms.common.data.LogEntry;
import me.lucko.luckperms.common.utils.Predicates; import me.lucko.luckperms.common.utils.Predicates;
import me.lucko.luckperms.exceptions.ObjectAlreadyHasException; import me.lucko.luckperms.exceptions.ObjectAlreadyHasException;

View File

@ -34,7 +34,7 @@ import me.lucko.luckperms.common.commands.utils.ContextHelper;
import me.lucko.luckperms.common.constants.Message; import me.lucko.luckperms.common.constants.Message;
import me.lucko.luckperms.common.constants.Permission; import me.lucko.luckperms.common.constants.Permission;
import me.lucko.luckperms.common.core.NodeFactory; import me.lucko.luckperms.common.core.NodeFactory;
import me.lucko.luckperms.common.core.PermissionHolder; import me.lucko.luckperms.common.core.model.PermissionHolder;
import me.lucko.luckperms.common.data.LogEntry; import me.lucko.luckperms.common.data.LogEntry;
import me.lucko.luckperms.common.utils.DateUtil; import me.lucko.luckperms.common.utils.DateUtil;
import me.lucko.luckperms.common.utils.Predicates; import me.lucko.luckperms.common.utils.Predicates;

View File

@ -32,7 +32,7 @@ import me.lucko.luckperms.common.commands.utils.ArgumentUtils;
import me.lucko.luckperms.common.commands.utils.ContextHelper; import me.lucko.luckperms.common.commands.utils.ContextHelper;
import me.lucko.luckperms.common.constants.Message; import me.lucko.luckperms.common.constants.Message;
import me.lucko.luckperms.common.constants.Permission; import me.lucko.luckperms.common.constants.Permission;
import me.lucko.luckperms.common.core.PermissionHolder; import me.lucko.luckperms.common.core.model.PermissionHolder;
import me.lucko.luckperms.common.data.LogEntry; import me.lucko.luckperms.common.data.LogEntry;
import me.lucko.luckperms.common.utils.Predicates; import me.lucko.luckperms.common.utils.Predicates;

View File

@ -32,7 +32,7 @@ import me.lucko.luckperms.common.commands.utils.ArgumentUtils;
import me.lucko.luckperms.common.commands.utils.ContextHelper; import me.lucko.luckperms.common.commands.utils.ContextHelper;
import me.lucko.luckperms.common.constants.Message; import me.lucko.luckperms.common.constants.Message;
import me.lucko.luckperms.common.constants.Permission; import me.lucko.luckperms.common.constants.Permission;
import me.lucko.luckperms.common.core.PermissionHolder; import me.lucko.luckperms.common.core.model.PermissionHolder;
import me.lucko.luckperms.common.data.LogEntry; import me.lucko.luckperms.common.data.LogEntry;
import me.lucko.luckperms.common.utils.Predicates; import me.lucko.luckperms.common.utils.Predicates;

View File

@ -31,7 +31,7 @@ import me.lucko.luckperms.common.commands.sender.Sender;
import me.lucko.luckperms.common.commands.utils.Util; import me.lucko.luckperms.common.commands.utils.Util;
import me.lucko.luckperms.common.constants.Message; import me.lucko.luckperms.common.constants.Message;
import me.lucko.luckperms.common.constants.Permission; import me.lucko.luckperms.common.constants.Permission;
import me.lucko.luckperms.common.core.PermissionHolder; import me.lucko.luckperms.common.core.model.PermissionHolder;
import me.lucko.luckperms.common.utils.Predicates; import me.lucko.luckperms.common.utils.Predicates;
import java.util.List; import java.util.List;

View File

@ -25,7 +25,7 @@ package me.lucko.luckperms.common.commands.generic.parent;
import com.google.common.collect.ImmutableList; import com.google.common.collect.ImmutableList;
import me.lucko.luckperms.common.commands.generic.SharedMainCommand; import me.lucko.luckperms.common.commands.generic.SharedMainCommand;
import me.lucko.luckperms.common.commands.generic.SharedSubCommand; import me.lucko.luckperms.common.commands.generic.SharedSubCommand;
import me.lucko.luckperms.common.core.PermissionHolder; import me.lucko.luckperms.common.core.model.PermissionHolder;
public class CommandParent<T extends PermissionHolder> extends SharedMainCommand<T> { public class CommandParent<T extends PermissionHolder> extends SharedMainCommand<T> {
public CommandParent(boolean user) { public CommandParent(boolean user) {

View File

@ -32,9 +32,9 @@ import me.lucko.luckperms.common.commands.utils.ArgumentUtils;
import me.lucko.luckperms.common.commands.utils.ContextHelper; import me.lucko.luckperms.common.commands.utils.ContextHelper;
import me.lucko.luckperms.common.constants.Message; import me.lucko.luckperms.common.constants.Message;
import me.lucko.luckperms.common.constants.Permission; import me.lucko.luckperms.common.constants.Permission;
import me.lucko.luckperms.common.core.PermissionHolder; import me.lucko.luckperms.common.core.model.Group;
import me.lucko.luckperms.common.core.model.PermissionHolder;
import me.lucko.luckperms.common.data.LogEntry; import me.lucko.luckperms.common.data.LogEntry;
import me.lucko.luckperms.common.groups.Group;
import me.lucko.luckperms.common.utils.Predicates; import me.lucko.luckperms.common.utils.Predicates;
import me.lucko.luckperms.exceptions.ObjectAlreadyHasException; import me.lucko.luckperms.exceptions.ObjectAlreadyHasException;

View File

@ -32,9 +32,9 @@ import me.lucko.luckperms.common.commands.utils.ArgumentUtils;
import me.lucko.luckperms.common.commands.utils.ContextHelper; import me.lucko.luckperms.common.commands.utils.ContextHelper;
import me.lucko.luckperms.common.constants.Message; import me.lucko.luckperms.common.constants.Message;
import me.lucko.luckperms.common.constants.Permission; import me.lucko.luckperms.common.constants.Permission;
import me.lucko.luckperms.common.core.PermissionHolder; import me.lucko.luckperms.common.core.model.Group;
import me.lucko.luckperms.common.core.model.PermissionHolder;
import me.lucko.luckperms.common.data.LogEntry; import me.lucko.luckperms.common.data.LogEntry;
import me.lucko.luckperms.common.groups.Group;
import me.lucko.luckperms.common.utils.DateUtil; import me.lucko.luckperms.common.utils.DateUtil;
import me.lucko.luckperms.common.utils.Predicates; import me.lucko.luckperms.common.utils.Predicates;
import me.lucko.luckperms.exceptions.ObjectAlreadyHasException; import me.lucko.luckperms.exceptions.ObjectAlreadyHasException;

View File

@ -30,7 +30,7 @@ import me.lucko.luckperms.common.commands.sender.Sender;
import me.lucko.luckperms.common.commands.utils.Util; import me.lucko.luckperms.common.commands.utils.Util;
import me.lucko.luckperms.common.constants.Message; import me.lucko.luckperms.common.constants.Message;
import me.lucko.luckperms.common.constants.Permission; import me.lucko.luckperms.common.constants.Permission;
import me.lucko.luckperms.common.core.PermissionHolder; import me.lucko.luckperms.common.core.model.PermissionHolder;
import me.lucko.luckperms.common.utils.Predicates; import me.lucko.luckperms.common.utils.Predicates;
import java.util.List; import java.util.List;

View File

@ -32,9 +32,9 @@ import me.lucko.luckperms.common.commands.utils.ArgumentUtils;
import me.lucko.luckperms.common.commands.utils.ContextHelper; import me.lucko.luckperms.common.commands.utils.ContextHelper;
import me.lucko.luckperms.common.constants.Message; import me.lucko.luckperms.common.constants.Message;
import me.lucko.luckperms.common.constants.Permission; import me.lucko.luckperms.common.constants.Permission;
import me.lucko.luckperms.common.core.PermissionHolder; import me.lucko.luckperms.common.core.model.PermissionHolder;
import me.lucko.luckperms.common.core.model.User;
import me.lucko.luckperms.common.data.LogEntry; import me.lucko.luckperms.common.data.LogEntry;
import me.lucko.luckperms.common.users.User;
import me.lucko.luckperms.common.utils.Predicates; import me.lucko.luckperms.common.utils.Predicates;
import me.lucko.luckperms.exceptions.ObjectLacksException; import me.lucko.luckperms.exceptions.ObjectLacksException;

View File

@ -32,7 +32,7 @@ import me.lucko.luckperms.common.commands.utils.ArgumentUtils;
import me.lucko.luckperms.common.commands.utils.ContextHelper; import me.lucko.luckperms.common.commands.utils.ContextHelper;
import me.lucko.luckperms.common.constants.Message; import me.lucko.luckperms.common.constants.Message;
import me.lucko.luckperms.common.constants.Permission; import me.lucko.luckperms.common.constants.Permission;
import me.lucko.luckperms.common.core.PermissionHolder; import me.lucko.luckperms.common.core.model.PermissionHolder;
import me.lucko.luckperms.common.data.LogEntry; import me.lucko.luckperms.common.data.LogEntry;
import me.lucko.luckperms.common.utils.Predicates; import me.lucko.luckperms.common.utils.Predicates;
import me.lucko.luckperms.exceptions.ObjectLacksException; import me.lucko.luckperms.exceptions.ObjectLacksException;

View File

@ -32,10 +32,10 @@ import me.lucko.luckperms.common.commands.utils.ArgumentUtils;
import me.lucko.luckperms.common.commands.utils.ContextHelper; import me.lucko.luckperms.common.commands.utils.ContextHelper;
import me.lucko.luckperms.common.constants.Message; import me.lucko.luckperms.common.constants.Message;
import me.lucko.luckperms.common.constants.Permission; import me.lucko.luckperms.common.constants.Permission;
import me.lucko.luckperms.common.core.PermissionHolder; import me.lucko.luckperms.common.core.model.Group;
import me.lucko.luckperms.common.core.model.PermissionHolder;
import me.lucko.luckperms.common.core.model.User;
import me.lucko.luckperms.common.data.LogEntry; import me.lucko.luckperms.common.data.LogEntry;
import me.lucko.luckperms.common.groups.Group;
import me.lucko.luckperms.common.users.User;
import me.lucko.luckperms.common.utils.Predicates; import me.lucko.luckperms.common.utils.Predicates;
import me.lucko.luckperms.exceptions.ObjectAlreadyHasException; import me.lucko.luckperms.exceptions.ObjectAlreadyHasException;

View File

@ -25,7 +25,7 @@ package me.lucko.luckperms.common.commands.generic.permission;
import com.google.common.collect.ImmutableList; import com.google.common.collect.ImmutableList;
import me.lucko.luckperms.common.commands.generic.SharedMainCommand; import me.lucko.luckperms.common.commands.generic.SharedMainCommand;
import me.lucko.luckperms.common.commands.generic.SharedSubCommand; import me.lucko.luckperms.common.commands.generic.SharedSubCommand;
import me.lucko.luckperms.common.core.PermissionHolder; import me.lucko.luckperms.common.core.model.PermissionHolder;
public class CommandPermission<T extends PermissionHolder> extends SharedMainCommand<T> { public class CommandPermission<T extends PermissionHolder> extends SharedMainCommand<T> {
public CommandPermission(boolean user) { public CommandPermission(boolean user) {

View File

@ -33,7 +33,7 @@ import me.lucko.luckperms.common.commands.utils.ContextHelper;
import me.lucko.luckperms.common.commands.utils.Util; import me.lucko.luckperms.common.commands.utils.Util;
import me.lucko.luckperms.common.constants.Permission; import me.lucko.luckperms.common.constants.Permission;
import me.lucko.luckperms.common.core.NodeBuilder; import me.lucko.luckperms.common.core.NodeBuilder;
import me.lucko.luckperms.common.core.PermissionHolder; import me.lucko.luckperms.common.core.model.PermissionHolder;
import me.lucko.luckperms.common.utils.Predicates; import me.lucko.luckperms.common.utils.Predicates;
import java.util.List; import java.util.List;

View File

@ -34,7 +34,7 @@ import me.lucko.luckperms.common.commands.utils.Util;
import me.lucko.luckperms.common.constants.Permission; import me.lucko.luckperms.common.constants.Permission;
import me.lucko.luckperms.common.core.InheritanceInfo; import me.lucko.luckperms.common.core.InheritanceInfo;
import me.lucko.luckperms.common.core.NodeBuilder; import me.lucko.luckperms.common.core.NodeBuilder;
import me.lucko.luckperms.common.core.PermissionHolder; import me.lucko.luckperms.common.core.model.PermissionHolder;
import me.lucko.luckperms.common.utils.Predicates; import me.lucko.luckperms.common.utils.Predicates;
import java.util.List; import java.util.List;

View File

@ -30,7 +30,7 @@ import me.lucko.luckperms.common.commands.sender.Sender;
import me.lucko.luckperms.common.commands.utils.Util; import me.lucko.luckperms.common.commands.utils.Util;
import me.lucko.luckperms.common.constants.Message; import me.lucko.luckperms.common.constants.Message;
import me.lucko.luckperms.common.constants.Permission; import me.lucko.luckperms.common.constants.Permission;
import me.lucko.luckperms.common.core.PermissionHolder; import me.lucko.luckperms.common.core.model.PermissionHolder;
import me.lucko.luckperms.common.utils.Predicates; import me.lucko.luckperms.common.utils.Predicates;
import java.util.List; import java.util.List;

View File

@ -32,7 +32,7 @@ import me.lucko.luckperms.common.commands.utils.ArgumentUtils;
import me.lucko.luckperms.common.commands.utils.ContextHelper; import me.lucko.luckperms.common.commands.utils.ContextHelper;
import me.lucko.luckperms.common.constants.Message; import me.lucko.luckperms.common.constants.Message;
import me.lucko.luckperms.common.constants.Permission; import me.lucko.luckperms.common.constants.Permission;
import me.lucko.luckperms.common.core.PermissionHolder; import me.lucko.luckperms.common.core.model.PermissionHolder;
import me.lucko.luckperms.common.data.LogEntry; import me.lucko.luckperms.common.data.LogEntry;
import me.lucko.luckperms.common.utils.Predicates; import me.lucko.luckperms.common.utils.Predicates;
import me.lucko.luckperms.exceptions.ObjectAlreadyHasException; import me.lucko.luckperms.exceptions.ObjectAlreadyHasException;

View File

@ -32,7 +32,7 @@ import me.lucko.luckperms.common.commands.utils.ArgumentUtils;
import me.lucko.luckperms.common.commands.utils.ContextHelper; import me.lucko.luckperms.common.commands.utils.ContextHelper;
import me.lucko.luckperms.common.constants.Message; import me.lucko.luckperms.common.constants.Message;
import me.lucko.luckperms.common.constants.Permission; import me.lucko.luckperms.common.constants.Permission;
import me.lucko.luckperms.common.core.PermissionHolder; import me.lucko.luckperms.common.core.model.PermissionHolder;
import me.lucko.luckperms.common.data.LogEntry; import me.lucko.luckperms.common.data.LogEntry;
import me.lucko.luckperms.common.utils.DateUtil; import me.lucko.luckperms.common.utils.DateUtil;
import me.lucko.luckperms.common.utils.Predicates; import me.lucko.luckperms.common.utils.Predicates;

View File

@ -32,7 +32,7 @@ import me.lucko.luckperms.common.commands.utils.ArgumentUtils;
import me.lucko.luckperms.common.commands.utils.ContextHelper; import me.lucko.luckperms.common.commands.utils.ContextHelper;
import me.lucko.luckperms.common.constants.Message; import me.lucko.luckperms.common.constants.Message;
import me.lucko.luckperms.common.constants.Permission; import me.lucko.luckperms.common.constants.Permission;
import me.lucko.luckperms.common.core.PermissionHolder; import me.lucko.luckperms.common.core.model.PermissionHolder;
import me.lucko.luckperms.common.data.LogEntry; import me.lucko.luckperms.common.data.LogEntry;
import me.lucko.luckperms.common.utils.Predicates; import me.lucko.luckperms.common.utils.Predicates;
import me.lucko.luckperms.exceptions.ObjectLacksException; import me.lucko.luckperms.exceptions.ObjectLacksException;

View File

@ -32,7 +32,7 @@ import me.lucko.luckperms.common.commands.utils.ArgumentUtils;
import me.lucko.luckperms.common.commands.utils.ContextHelper; import me.lucko.luckperms.common.commands.utils.ContextHelper;
import me.lucko.luckperms.common.constants.Message; import me.lucko.luckperms.common.constants.Message;
import me.lucko.luckperms.common.constants.Permission; import me.lucko.luckperms.common.constants.Permission;
import me.lucko.luckperms.common.core.PermissionHolder; import me.lucko.luckperms.common.core.model.PermissionHolder;
import me.lucko.luckperms.common.data.LogEntry; import me.lucko.luckperms.common.data.LogEntry;
import me.lucko.luckperms.common.utils.Predicates; import me.lucko.luckperms.common.utils.Predicates;
import me.lucko.luckperms.exceptions.ObjectLacksException; import me.lucko.luckperms.exceptions.ObjectLacksException;

View File

@ -29,8 +29,8 @@ import me.lucko.luckperms.common.commands.SingleCommand;
import me.lucko.luckperms.common.commands.sender.Sender; import me.lucko.luckperms.common.commands.sender.Sender;
import me.lucko.luckperms.common.constants.Message; import me.lucko.luckperms.common.constants.Message;
import me.lucko.luckperms.common.constants.Permission; import me.lucko.luckperms.common.constants.Permission;
import me.lucko.luckperms.common.core.model.Group;
import me.lucko.luckperms.common.data.LogEntry; import me.lucko.luckperms.common.data.LogEntry;
import me.lucko.luckperms.common.groups.Group;
import me.lucko.luckperms.common.utils.Predicates; import me.lucko.luckperms.common.utils.Predicates;
import java.util.ArrayList; import java.util.ArrayList;

View File

@ -32,7 +32,7 @@ import me.lucko.luckperms.common.commands.sender.Sender;
import me.lucko.luckperms.common.constants.Message; import me.lucko.luckperms.common.constants.Message;
import me.lucko.luckperms.common.constants.Permission; import me.lucko.luckperms.common.constants.Permission;
import me.lucko.luckperms.common.core.NodeFactory; import me.lucko.luckperms.common.core.NodeFactory;
import me.lucko.luckperms.common.groups.Group; import me.lucko.luckperms.common.core.model.Group;
import me.lucko.luckperms.common.utils.Predicates; import me.lucko.luckperms.common.utils.Predicates;
import me.lucko.luckperms.exceptions.ObjectAlreadyHasException; import me.lucko.luckperms.exceptions.ObjectAlreadyHasException;
import me.lucko.luckperms.exceptions.ObjectLacksException; import me.lucko.luckperms.exceptions.ObjectLacksException;

View File

@ -32,8 +32,8 @@ import me.lucko.luckperms.common.commands.utils.ArgumentUtils;
import me.lucko.luckperms.common.commands.utils.ContextHelper; import me.lucko.luckperms.common.commands.utils.ContextHelper;
import me.lucko.luckperms.common.constants.Message; import me.lucko.luckperms.common.constants.Message;
import me.lucko.luckperms.common.constants.Permission; import me.lucko.luckperms.common.constants.Permission;
import me.lucko.luckperms.common.core.model.Group;
import me.lucko.luckperms.common.data.LogEntry; import me.lucko.luckperms.common.data.LogEntry;
import me.lucko.luckperms.common.groups.Group;
import me.lucko.luckperms.common.utils.Predicates; import me.lucko.luckperms.common.utils.Predicates;
import java.util.List; import java.util.List;

View File

@ -30,8 +30,8 @@ import me.lucko.luckperms.common.commands.SubCommand;
import me.lucko.luckperms.common.commands.sender.Sender; import me.lucko.luckperms.common.commands.sender.Sender;
import me.lucko.luckperms.common.constants.Message; import me.lucko.luckperms.common.constants.Message;
import me.lucko.luckperms.common.constants.Permission; import me.lucko.luckperms.common.constants.Permission;
import me.lucko.luckperms.common.core.model.Group;
import me.lucko.luckperms.common.data.LogEntry; import me.lucko.luckperms.common.data.LogEntry;
import me.lucko.luckperms.common.groups.Group;
import me.lucko.luckperms.common.utils.ArgumentChecker; import me.lucko.luckperms.common.utils.ArgumentChecker;
import me.lucko.luckperms.common.utils.Predicates; import me.lucko.luckperms.common.utils.Predicates;

View File

@ -29,7 +29,7 @@ import me.lucko.luckperms.common.commands.SubCommand;
import me.lucko.luckperms.common.commands.sender.Sender; import me.lucko.luckperms.common.commands.sender.Sender;
import me.lucko.luckperms.common.constants.Message; import me.lucko.luckperms.common.constants.Message;
import me.lucko.luckperms.common.constants.Permission; import me.lucko.luckperms.common.constants.Permission;
import me.lucko.luckperms.common.groups.Group; import me.lucko.luckperms.common.core.model.Group;
import me.lucko.luckperms.common.utils.Predicates; import me.lucko.luckperms.common.utils.Predicates;
import java.util.List; import java.util.List;

View File

@ -32,7 +32,7 @@ import me.lucko.luckperms.common.commands.generic.parent.CommandParent;
import me.lucko.luckperms.common.commands.generic.permission.CommandPermission; import me.lucko.luckperms.common.commands.generic.permission.CommandPermission;
import me.lucko.luckperms.common.commands.sender.Sender; import me.lucko.luckperms.common.commands.sender.Sender;
import me.lucko.luckperms.common.constants.Message; import me.lucko.luckperms.common.constants.Message;
import me.lucko.luckperms.common.groups.Group; import me.lucko.luckperms.common.core.model.Group;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;

View File

@ -30,8 +30,8 @@ import me.lucko.luckperms.common.commands.SubCommand;
import me.lucko.luckperms.common.commands.sender.Sender; import me.lucko.luckperms.common.commands.sender.Sender;
import me.lucko.luckperms.common.constants.Message; import me.lucko.luckperms.common.constants.Message;
import me.lucko.luckperms.common.constants.Permission; import me.lucko.luckperms.common.constants.Permission;
import me.lucko.luckperms.common.core.model.Group;
import me.lucko.luckperms.common.data.LogEntry; import me.lucko.luckperms.common.data.LogEntry;
import me.lucko.luckperms.common.groups.Group;
import me.lucko.luckperms.common.utils.ArgumentChecker; import me.lucko.luckperms.common.utils.ArgumentChecker;
import me.lucko.luckperms.common.utils.Predicates; import me.lucko.luckperms.common.utils.Predicates;

View File

@ -29,7 +29,7 @@ import me.lucko.luckperms.common.commands.sender.Sender;
import me.lucko.luckperms.common.commands.utils.Util; import me.lucko.luckperms.common.commands.utils.Util;
import me.lucko.luckperms.common.constants.Message; import me.lucko.luckperms.common.constants.Message;
import me.lucko.luckperms.common.constants.Permission; import me.lucko.luckperms.common.constants.Permission;
import me.lucko.luckperms.common.groups.Group; import me.lucko.luckperms.common.core.model.Group;
import me.lucko.luckperms.common.utils.Predicates; import me.lucko.luckperms.common.utils.Predicates;
import java.util.ArrayList; import java.util.ArrayList;

View File

@ -32,10 +32,10 @@ import me.lucko.luckperms.common.commands.sender.Sender;
import me.lucko.luckperms.common.constants.Constants; import me.lucko.luckperms.common.constants.Constants;
import me.lucko.luckperms.common.constants.Message; import me.lucko.luckperms.common.constants.Message;
import me.lucko.luckperms.common.constants.Permission; import me.lucko.luckperms.common.constants.Permission;
import me.lucko.luckperms.common.groups.Group; import me.lucko.luckperms.common.core.model.Group;
import me.lucko.luckperms.common.core.model.Track;
import me.lucko.luckperms.common.core.model.User;
import me.lucko.luckperms.common.storage.Storage; import me.lucko.luckperms.common.storage.Storage;
import me.lucko.luckperms.common.tracks.Track;
import me.lucko.luckperms.common.users.User;
import me.lucko.luckperms.common.utils.Predicates; import me.lucko.luckperms.common.utils.Predicates;
import java.io.BufferedWriter; import java.io.BufferedWriter;

View File

@ -29,8 +29,8 @@ import me.lucko.luckperms.common.commands.SingleCommand;
import me.lucko.luckperms.common.commands.sender.Sender; import me.lucko.luckperms.common.commands.sender.Sender;
import me.lucko.luckperms.common.constants.Message; import me.lucko.luckperms.common.constants.Message;
import me.lucko.luckperms.common.constants.Permission; import me.lucko.luckperms.common.constants.Permission;
import me.lucko.luckperms.common.core.model.Track;
import me.lucko.luckperms.common.data.LogEntry; import me.lucko.luckperms.common.data.LogEntry;
import me.lucko.luckperms.common.tracks.Track;
import me.lucko.luckperms.common.utils.Predicates; import me.lucko.luckperms.common.utils.Predicates;
import java.util.ArrayList; import java.util.ArrayList;

View File

@ -31,9 +31,9 @@ import me.lucko.luckperms.common.commands.sender.Sender;
import me.lucko.luckperms.common.commands.utils.Util; import me.lucko.luckperms.common.commands.utils.Util;
import me.lucko.luckperms.common.constants.Message; import me.lucko.luckperms.common.constants.Message;
import me.lucko.luckperms.common.constants.Permission; import me.lucko.luckperms.common.constants.Permission;
import me.lucko.luckperms.common.core.model.Group;
import me.lucko.luckperms.common.core.model.Track;
import me.lucko.luckperms.common.data.LogEntry; import me.lucko.luckperms.common.data.LogEntry;
import me.lucko.luckperms.common.groups.Group;
import me.lucko.luckperms.common.tracks.Track;
import me.lucko.luckperms.common.utils.ArgumentChecker; import me.lucko.luckperms.common.utils.ArgumentChecker;
import me.lucko.luckperms.common.utils.Predicates; import me.lucko.luckperms.common.utils.Predicates;
import me.lucko.luckperms.exceptions.ObjectAlreadyHasException; import me.lucko.luckperms.exceptions.ObjectAlreadyHasException;

View File

@ -29,8 +29,8 @@ import me.lucko.luckperms.common.commands.SubCommand;
import me.lucko.luckperms.common.commands.sender.Sender; import me.lucko.luckperms.common.commands.sender.Sender;
import me.lucko.luckperms.common.constants.Message; import me.lucko.luckperms.common.constants.Message;
import me.lucko.luckperms.common.constants.Permission; import me.lucko.luckperms.common.constants.Permission;
import me.lucko.luckperms.common.core.model.Track;
import me.lucko.luckperms.common.data.LogEntry; import me.lucko.luckperms.common.data.LogEntry;
import me.lucko.luckperms.common.tracks.Track;
import me.lucko.luckperms.common.utils.Predicates; import me.lucko.luckperms.common.utils.Predicates;
import java.util.List; import java.util.List;

View File

@ -30,8 +30,8 @@ import me.lucko.luckperms.common.commands.SubCommand;
import me.lucko.luckperms.common.commands.sender.Sender; import me.lucko.luckperms.common.commands.sender.Sender;
import me.lucko.luckperms.common.constants.Message; import me.lucko.luckperms.common.constants.Message;
import me.lucko.luckperms.common.constants.Permission; import me.lucko.luckperms.common.constants.Permission;
import me.lucko.luckperms.common.core.model.Track;
import me.lucko.luckperms.common.data.LogEntry; import me.lucko.luckperms.common.data.LogEntry;
import me.lucko.luckperms.common.tracks.Track;
import me.lucko.luckperms.common.utils.ArgumentChecker; import me.lucko.luckperms.common.utils.ArgumentChecker;
import me.lucko.luckperms.common.utils.Predicates; import me.lucko.luckperms.common.utils.Predicates;

View File

@ -30,7 +30,7 @@ import me.lucko.luckperms.common.commands.sender.Sender;
import me.lucko.luckperms.common.commands.utils.Util; import me.lucko.luckperms.common.commands.utils.Util;
import me.lucko.luckperms.common.constants.Message; import me.lucko.luckperms.common.constants.Message;
import me.lucko.luckperms.common.constants.Permission; import me.lucko.luckperms.common.constants.Permission;
import me.lucko.luckperms.common.tracks.Track; import me.lucko.luckperms.common.core.model.Track;
import me.lucko.luckperms.common.utils.Predicates; import me.lucko.luckperms.common.utils.Predicates;
import java.util.List; import java.util.List;

View File

@ -31,9 +31,9 @@ import me.lucko.luckperms.common.commands.sender.Sender;
import me.lucko.luckperms.common.commands.utils.Util; import me.lucko.luckperms.common.commands.utils.Util;
import me.lucko.luckperms.common.constants.Message; import me.lucko.luckperms.common.constants.Message;
import me.lucko.luckperms.common.constants.Permission; import me.lucko.luckperms.common.constants.Permission;
import me.lucko.luckperms.common.core.model.Group;
import me.lucko.luckperms.common.core.model.Track;
import me.lucko.luckperms.common.data.LogEntry; import me.lucko.luckperms.common.data.LogEntry;
import me.lucko.luckperms.common.groups.Group;
import me.lucko.luckperms.common.tracks.Track;
import me.lucko.luckperms.common.utils.ArgumentChecker; import me.lucko.luckperms.common.utils.ArgumentChecker;
import me.lucko.luckperms.common.utils.Predicates; import me.lucko.luckperms.common.utils.Predicates;
import me.lucko.luckperms.exceptions.ObjectAlreadyHasException; import me.lucko.luckperms.exceptions.ObjectAlreadyHasException;

View File

@ -28,7 +28,7 @@ import me.lucko.luckperms.common.commands.Command;
import me.lucko.luckperms.common.commands.MainCommand; import me.lucko.luckperms.common.commands.MainCommand;
import me.lucko.luckperms.common.commands.sender.Sender; import me.lucko.luckperms.common.commands.sender.Sender;
import me.lucko.luckperms.common.constants.Message; import me.lucko.luckperms.common.constants.Message;
import me.lucko.luckperms.common.tracks.Track; import me.lucko.luckperms.common.core.model.Track;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;

View File

@ -31,8 +31,8 @@ import me.lucko.luckperms.common.commands.sender.Sender;
import me.lucko.luckperms.common.commands.utils.Util; import me.lucko.luckperms.common.commands.utils.Util;
import me.lucko.luckperms.common.constants.Message; import me.lucko.luckperms.common.constants.Message;
import me.lucko.luckperms.common.constants.Permission; import me.lucko.luckperms.common.constants.Permission;
import me.lucko.luckperms.common.core.model.Track;
import me.lucko.luckperms.common.data.LogEntry; import me.lucko.luckperms.common.data.LogEntry;
import me.lucko.luckperms.common.tracks.Track;
import me.lucko.luckperms.common.utils.ArgumentChecker; import me.lucko.luckperms.common.utils.ArgumentChecker;
import me.lucko.luckperms.common.utils.Predicates; import me.lucko.luckperms.common.utils.Predicates;
import me.lucko.luckperms.exceptions.ObjectLacksException; import me.lucko.luckperms.exceptions.ObjectLacksException;

View File

@ -30,8 +30,8 @@ import me.lucko.luckperms.common.commands.SubCommand;
import me.lucko.luckperms.common.commands.sender.Sender; import me.lucko.luckperms.common.commands.sender.Sender;
import me.lucko.luckperms.common.constants.Message; import me.lucko.luckperms.common.constants.Message;
import me.lucko.luckperms.common.constants.Permission; import me.lucko.luckperms.common.constants.Permission;
import me.lucko.luckperms.common.core.model.Track;
import me.lucko.luckperms.common.data.LogEntry; import me.lucko.luckperms.common.data.LogEntry;
import me.lucko.luckperms.common.tracks.Track;
import me.lucko.luckperms.common.utils.ArgumentChecker; import me.lucko.luckperms.common.utils.ArgumentChecker;
import me.lucko.luckperms.common.utils.Predicates; import me.lucko.luckperms.common.utils.Predicates;

View File

@ -32,7 +32,7 @@ import me.lucko.luckperms.common.commands.sender.Sender;
import me.lucko.luckperms.common.constants.Message; import me.lucko.luckperms.common.constants.Message;
import me.lucko.luckperms.common.constants.Permission; import me.lucko.luckperms.common.constants.Permission;
import me.lucko.luckperms.common.core.NodeFactory; import me.lucko.luckperms.common.core.NodeFactory;
import me.lucko.luckperms.common.users.User; import me.lucko.luckperms.common.core.model.User;
import me.lucko.luckperms.common.utils.Predicates; import me.lucko.luckperms.common.utils.Predicates;
import me.lucko.luckperms.exceptions.ObjectAlreadyHasException; import me.lucko.luckperms.exceptions.ObjectAlreadyHasException;
import me.lucko.luckperms.exceptions.ObjectLacksException; import me.lucko.luckperms.exceptions.ObjectLacksException;

View File

@ -32,8 +32,8 @@ import me.lucko.luckperms.common.commands.utils.ArgumentUtils;
import me.lucko.luckperms.common.commands.utils.ContextHelper; import me.lucko.luckperms.common.commands.utils.ContextHelper;
import me.lucko.luckperms.common.constants.Message; import me.lucko.luckperms.common.constants.Message;
import me.lucko.luckperms.common.constants.Permission; import me.lucko.luckperms.common.constants.Permission;
import me.lucko.luckperms.common.core.model.User;
import me.lucko.luckperms.common.data.LogEntry; import me.lucko.luckperms.common.data.LogEntry;
import me.lucko.luckperms.common.users.User;
import me.lucko.luckperms.common.utils.Predicates; import me.lucko.luckperms.common.utils.Predicates;
import java.util.List; import java.util.List;

View File

@ -38,10 +38,10 @@ import me.lucko.luckperms.common.commands.utils.Util;
import me.lucko.luckperms.common.constants.Message; import me.lucko.luckperms.common.constants.Message;
import me.lucko.luckperms.common.constants.Permission; import me.lucko.luckperms.common.constants.Permission;
import me.lucko.luckperms.common.core.NodeFactory; import me.lucko.luckperms.common.core.NodeFactory;
import me.lucko.luckperms.common.core.model.Group;
import me.lucko.luckperms.common.core.model.Track;
import me.lucko.luckperms.common.core.model.User;
import me.lucko.luckperms.common.data.LogEntry; import me.lucko.luckperms.common.data.LogEntry;
import me.lucko.luckperms.common.groups.Group;
import me.lucko.luckperms.common.tracks.Track;
import me.lucko.luckperms.common.users.User;
import me.lucko.luckperms.common.utils.ArgumentChecker; import me.lucko.luckperms.common.utils.ArgumentChecker;
import me.lucko.luckperms.common.utils.Predicates; import me.lucko.luckperms.common.utils.Predicates;
import me.lucko.luckperms.exceptions.ObjectAlreadyHasException; import me.lucko.luckperms.exceptions.ObjectAlreadyHasException;

View File

@ -29,7 +29,7 @@ import me.lucko.luckperms.common.commands.SubCommand;
import me.lucko.luckperms.common.commands.sender.Sender; import me.lucko.luckperms.common.commands.sender.Sender;
import me.lucko.luckperms.common.constants.Message; import me.lucko.luckperms.common.constants.Message;
import me.lucko.luckperms.common.constants.Permission; import me.lucko.luckperms.common.constants.Permission;
import me.lucko.luckperms.common.users.User; import me.lucko.luckperms.common.core.model.User;
import me.lucko.luckperms.common.utils.Predicates; import me.lucko.luckperms.common.utils.Predicates;
import java.util.List; import java.util.List;

View File

@ -34,7 +34,7 @@ import me.lucko.luckperms.common.commands.sender.Sender;
import me.lucko.luckperms.common.commands.utils.Util; import me.lucko.luckperms.common.commands.utils.Util;
import me.lucko.luckperms.common.constants.Message; import me.lucko.luckperms.common.constants.Message;
import me.lucko.luckperms.common.constants.Permission; import me.lucko.luckperms.common.constants.Permission;
import me.lucko.luckperms.common.users.User; import me.lucko.luckperms.common.core.model.User;
import me.lucko.luckperms.common.utils.DateUtil; import me.lucko.luckperms.common.utils.DateUtil;
import me.lucko.luckperms.common.utils.Predicates; import me.lucko.luckperms.common.utils.Predicates;

View File

@ -34,7 +34,7 @@ import me.lucko.luckperms.common.commands.sender.Sender;
import me.lucko.luckperms.common.commands.utils.Util; import me.lucko.luckperms.common.commands.utils.Util;
import me.lucko.luckperms.common.constants.Message; import me.lucko.luckperms.common.constants.Message;
import me.lucko.luckperms.common.constants.Patterns; import me.lucko.luckperms.common.constants.Patterns;
import me.lucko.luckperms.common.users.User; import me.lucko.luckperms.common.core.model.User;
import java.util.List; import java.util.List;
import java.util.UUID; import java.util.UUID;

View File

@ -38,10 +38,10 @@ import me.lucko.luckperms.common.commands.utils.Util;
import me.lucko.luckperms.common.constants.Message; import me.lucko.luckperms.common.constants.Message;
import me.lucko.luckperms.common.constants.Permission; import me.lucko.luckperms.common.constants.Permission;
import me.lucko.luckperms.common.core.NodeFactory; import me.lucko.luckperms.common.core.NodeFactory;
import me.lucko.luckperms.common.core.model.Group;
import me.lucko.luckperms.common.core.model.Track;
import me.lucko.luckperms.common.core.model.User;
import me.lucko.luckperms.common.data.LogEntry; import me.lucko.luckperms.common.data.LogEntry;
import me.lucko.luckperms.common.groups.Group;
import me.lucko.luckperms.common.tracks.Track;
import me.lucko.luckperms.common.users.User;
import me.lucko.luckperms.common.utils.ArgumentChecker; import me.lucko.luckperms.common.utils.ArgumentChecker;
import me.lucko.luckperms.common.utils.Predicates; import me.lucko.luckperms.common.utils.Predicates;
import me.lucko.luckperms.exceptions.ObjectAlreadyHasException; import me.lucko.luckperms.exceptions.ObjectAlreadyHasException;

View File

@ -30,9 +30,9 @@ import me.lucko.luckperms.common.commands.SubCommand;
import me.lucko.luckperms.common.commands.sender.Sender; import me.lucko.luckperms.common.commands.sender.Sender;
import me.lucko.luckperms.common.constants.Message; import me.lucko.luckperms.common.constants.Message;
import me.lucko.luckperms.common.constants.Permission; import me.lucko.luckperms.common.constants.Permission;
import me.lucko.luckperms.common.core.model.Group;
import me.lucko.luckperms.common.core.model.User;
import me.lucko.luckperms.common.data.LogEntry; import me.lucko.luckperms.common.data.LogEntry;
import me.lucko.luckperms.common.groups.Group;
import me.lucko.luckperms.common.users.User;
import me.lucko.luckperms.common.utils.Predicates; import me.lucko.luckperms.common.utils.Predicates;
import me.lucko.luckperms.exceptions.ObjectAlreadyHasException; import me.lucko.luckperms.exceptions.ObjectAlreadyHasException;

View File

@ -32,8 +32,8 @@ import me.lucko.luckperms.common.commands.sender.Sender;
import me.lucko.luckperms.common.constants.Message; import me.lucko.luckperms.common.constants.Message;
import me.lucko.luckperms.common.constants.Permission; import me.lucko.luckperms.common.constants.Permission;
import me.lucko.luckperms.common.core.NodeFactory; import me.lucko.luckperms.common.core.NodeFactory;
import me.lucko.luckperms.common.core.model.User;
import me.lucko.luckperms.common.storage.Storage; import me.lucko.luckperms.common.storage.Storage;
import me.lucko.luckperms.common.users.User;
import me.lucko.luckperms.common.utils.Predicates; import me.lucko.luckperms.common.utils.Predicates;
import me.lucko.luckperms.exceptions.ObjectAlreadyHasException; import me.lucko.luckperms.exceptions.ObjectAlreadyHasException;
import me.lucko.luckperms.exceptions.ObjectLacksException; import me.lucko.luckperms.exceptions.ObjectLacksException;

View File

@ -32,8 +32,8 @@ import me.lucko.luckperms.common.commands.sender.Sender;
import me.lucko.luckperms.common.constants.Message; import me.lucko.luckperms.common.constants.Message;
import me.lucko.luckperms.common.constants.Permission; import me.lucko.luckperms.common.constants.Permission;
import me.lucko.luckperms.common.core.NodeFactory; import me.lucko.luckperms.common.core.NodeFactory;
import me.lucko.luckperms.common.core.model.User;
import me.lucko.luckperms.common.storage.Storage; import me.lucko.luckperms.common.storage.Storage;
import me.lucko.luckperms.common.users.User;
import me.lucko.luckperms.common.utils.Predicates; import me.lucko.luckperms.common.utils.Predicates;
import me.lucko.luckperms.exceptions.ObjectAlreadyHasException; import me.lucko.luckperms.exceptions.ObjectAlreadyHasException;
import me.lucko.luckperms.exceptions.ObjectLacksException; import me.lucko.luckperms.exceptions.ObjectLacksException;

View File

@ -29,6 +29,7 @@ import me.lucko.luckperms.api.Node;
import me.lucko.luckperms.api.context.ContextSet; import me.lucko.luckperms.api.context.ContextSet;
import me.lucko.luckperms.api.context.MutableContextSet; import me.lucko.luckperms.api.context.MutableContextSet;
import me.lucko.luckperms.common.constants.Patterns; import me.lucko.luckperms.common.constants.Patterns;
import me.lucko.luckperms.common.core.model.ImmutableNode;
import me.lucko.luckperms.common.utils.ArgumentChecker; import me.lucko.luckperms.common.utils.ArgumentChecker;
import java.util.List; import java.util.List;

View File

@ -20,7 +20,7 @@
* SOFTWARE. * SOFTWARE.
*/ */
package me.lucko.luckperms.common.users; package me.lucko.luckperms.common.core;
import lombok.*; import lombok.*;
import me.lucko.luckperms.common.utils.Identifiable; import me.lucko.luckperms.common.utils.Identifiable;

View File

@ -20,13 +20,12 @@
* SOFTWARE. * SOFTWARE.
*/ */
package me.lucko.luckperms.common.groups; package me.lucko.luckperms.common.core.model;
import lombok.EqualsAndHashCode; import lombok.EqualsAndHashCode;
import lombok.Getter; import lombok.Getter;
import lombok.ToString; import lombok.ToString;
import me.lucko.luckperms.common.LuckPermsPlugin; import me.lucko.luckperms.common.LuckPermsPlugin;
import me.lucko.luckperms.common.core.PermissionHolder;
import me.lucko.luckperms.common.utils.Identifiable; import me.lucko.luckperms.common.utils.Identifiable;
@ToString(of = {"name"}) @ToString(of = {"name"})
@ -39,7 +38,7 @@ public class Group extends PermissionHolder implements Identifiable<String> {
@Getter @Getter
private final String name; private final String name;
Group(String name, LuckPermsPlugin plugin) { public Group(String name, LuckPermsPlugin plugin) {
super(name, plugin); super(name, plugin);
this.name = name; this.name = name;
} }

View File

@ -20,7 +20,7 @@
* SOFTWARE. * SOFTWARE.
*/ */
package me.lucko.luckperms.common.core; package me.lucko.luckperms.common.core.model;
import com.google.common.base.Preconditions; import com.google.common.base.Preconditions;
import com.google.common.base.Splitter; import com.google.common.base.Splitter;

View File

@ -20,7 +20,7 @@
* SOFTWARE. * SOFTWARE.
*/ */
package me.lucko.luckperms.common.core; package me.lucko.luckperms.common.core.model;
import com.google.common.collect.ImmutableMap; import com.google.common.collect.ImmutableMap;
import com.google.common.collect.ImmutableSet; import com.google.common.collect.ImmutableSet;
@ -39,7 +39,10 @@ import me.lucko.luckperms.common.api.internal.GroupLink;
import me.lucko.luckperms.common.api.internal.PermissionHolderLink; import me.lucko.luckperms.common.api.internal.PermissionHolderLink;
import me.lucko.luckperms.common.caching.MetaHolder; import me.lucko.luckperms.common.caching.MetaHolder;
import me.lucko.luckperms.common.commands.utils.Util; import me.lucko.luckperms.common.commands.utils.Util;
import me.lucko.luckperms.common.groups.Group; import me.lucko.luckperms.common.core.InheritanceInfo;
import me.lucko.luckperms.common.core.NodeBuilder;
import me.lucko.luckperms.common.core.NodeFactory;
import me.lucko.luckperms.common.core.PriorityComparator;
import me.lucko.luckperms.common.utils.Cache; import me.lucko.luckperms.common.utils.Cache;
import me.lucko.luckperms.common.utils.ExtractedContexts; import me.lucko.luckperms.common.utils.ExtractedContexts;
import me.lucko.luckperms.common.utils.ImmutableLocalizedNode; import me.lucko.luckperms.common.utils.ImmutableLocalizedNode;

View File

@ -20,14 +20,13 @@
* SOFTWARE. * SOFTWARE.
*/ */
package me.lucko.luckperms.common.tracks; package me.lucko.luckperms.common.core.model;
import com.google.common.collect.ImmutableList; import com.google.common.collect.ImmutableList;
import lombok.EqualsAndHashCode; import lombok.EqualsAndHashCode;
import lombok.Getter; import lombok.Getter;
import lombok.RequiredArgsConstructor; import lombok.RequiredArgsConstructor;
import lombok.ToString; import lombok.ToString;
import me.lucko.luckperms.common.groups.Group;
import me.lucko.luckperms.common.utils.Identifiable; import me.lucko.luckperms.common.utils.Identifiable;
import me.lucko.luckperms.exceptions.ObjectAlreadyHasException; import me.lucko.luckperms.exceptions.ObjectAlreadyHasException;
import me.lucko.luckperms.exceptions.ObjectLacksException; import me.lucko.luckperms.exceptions.ObjectLacksException;

View File

@ -20,7 +20,7 @@
* SOFTWARE. * SOFTWARE.
*/ */
package me.lucko.luckperms.common.users; package me.lucko.luckperms.common.core.model;
import lombok.EqualsAndHashCode; import lombok.EqualsAndHashCode;
import lombok.Getter; import lombok.Getter;
@ -31,7 +31,7 @@ import me.lucko.luckperms.api.event.events.UserPermissionRefreshEvent;
import me.lucko.luckperms.common.LuckPermsPlugin; import me.lucko.luckperms.common.LuckPermsPlugin;
import me.lucko.luckperms.common.api.internal.UserLink; import me.lucko.luckperms.common.api.internal.UserLink;
import me.lucko.luckperms.common.caching.UserCache; import me.lucko.luckperms.common.caching.UserCache;
import me.lucko.luckperms.common.core.PermissionHolder; import me.lucko.luckperms.common.core.UserIdentifier;
import me.lucko.luckperms.common.utils.BufferedRequest; import me.lucko.luckperms.common.utils.BufferedRequest;
import me.lucko.luckperms.common.utils.Identifiable; import me.lucko.luckperms.common.utils.Identifiable;
@ -76,13 +76,13 @@ public class User extends PermissionHolder implements Identifiable<UserIdentifie
} }
}; };
protected User(UUID uuid, LuckPermsPlugin plugin) { public User(UUID uuid, LuckPermsPlugin plugin) {
super(uuid.toString(), plugin); super(uuid.toString(), plugin);
this.uuid = uuid; this.uuid = uuid;
this.name = null; this.name = null;
} }
protected User(UUID uuid, String name, LuckPermsPlugin plugin) { public User(UUID uuid, String name, LuckPermsPlugin plugin) {
super(uuid.toString(), plugin); super(uuid.toString(), plugin);
this.uuid = uuid; this.uuid = uuid;
this.name = name; this.name = name;

View File

@ -27,10 +27,10 @@ import me.lucko.luckperms.common.LuckPermsPlugin;
import me.lucko.luckperms.common.commands.sender.Sender; import me.lucko.luckperms.common.commands.sender.Sender;
import me.lucko.luckperms.common.constants.Message; import me.lucko.luckperms.common.constants.Message;
import me.lucko.luckperms.common.constants.Permission; import me.lucko.luckperms.common.constants.Permission;
import me.lucko.luckperms.common.core.PermissionHolder; import me.lucko.luckperms.common.core.model.Group;
import me.lucko.luckperms.common.groups.Group; import me.lucko.luckperms.common.core.model.PermissionHolder;
import me.lucko.luckperms.common.tracks.Track; import me.lucko.luckperms.common.core.model.Track;
import me.lucko.luckperms.common.users.User; import me.lucko.luckperms.common.core.model.User;
import java.util.List; import java.util.List;

View File

@ -24,7 +24,7 @@ package me.lucko.luckperms.common.defaults;
import me.lucko.luckperms.api.Tristate; import me.lucko.luckperms.api.Tristate;
import me.lucko.luckperms.common.core.NodeFactory; import me.lucko.luckperms.common.core.NodeFactory;
import me.lucko.luckperms.common.core.PermissionHolder; import me.lucko.luckperms.common.core.model.PermissionHolder;
import javax.script.ScriptEngine; import javax.script.ScriptEngine;
import javax.script.ScriptEngineManager; import javax.script.ScriptEngineManager;

View File

@ -27,7 +27,7 @@ import lombok.Getter;
import lombok.ToString; import lombok.ToString;
import me.lucko.luckperms.api.Tristate; import me.lucko.luckperms.api.Tristate;
import me.lucko.luckperms.common.core.NodeFactory; import me.lucko.luckperms.common.core.NodeFactory;
import me.lucko.luckperms.common.users.User; import me.lucko.luckperms.common.core.model.User;
import me.lucko.luckperms.exceptions.ObjectAlreadyHasException; import me.lucko.luckperms.exceptions.ObjectAlreadyHasException;
import me.lucko.luckperms.exceptions.ObjectLacksException; import me.lucko.luckperms.exceptions.ObjectLacksException;

View File

@ -20,7 +20,7 @@
* SOFTWARE. * SOFTWARE.
*/ */
package me.lucko.luckperms.common.utils; package me.lucko.luckperms.common.managers;
import com.google.common.cache.CacheBuilder; import com.google.common.cache.CacheBuilder;
import com.google.common.cache.CacheLoader; import com.google.common.cache.CacheLoader;
@ -28,16 +28,16 @@ import com.google.common.cache.LoadingCache;
import com.google.common.collect.ImmutableMap; import com.google.common.collect.ImmutableMap;
import com.google.common.util.concurrent.Futures; import com.google.common.util.concurrent.Futures;
import com.google.common.util.concurrent.ListenableFuture; import com.google.common.util.concurrent.ListenableFuture;
import me.lucko.luckperms.common.utils.Identifiable;
import java.util.Map; import java.util.Map;
import java.util.function.Function;
/** /**
* An abstract manager class * An abstract manager class
* @param <I> the class used to identify each object held in this manager * @param <I> the class used to identify each object held in this manager
* @param <T> the class this manager is "managing" * @param <T> the class this manager is "managing"
*/ */
public abstract class AbstractManager<I, T extends Identifiable<I>> implements Function<I, T> { public abstract class AbstractManager<I, T extends Identifiable<I>> implements Manager<I, T> {
private final LoadingCache<I, T> objects = CacheBuilder.newBuilder() private final LoadingCache<I, T> objects = CacheBuilder.newBuilder()
.build(new CacheLoader<I, T>() { .build(new CacheLoader<I, T>() {
@ -52,51 +52,35 @@ public abstract class AbstractManager<I, T extends Identifiable<I>> implements F
} }
}); });
public final Map<I, T> getAll() { @Override
public Map<I, T> getAll() {
return ImmutableMap.copyOf(objects.asMap()); return ImmutableMap.copyOf(objects.asMap());
} }
/** @Override
* Get an object by id public T getOrMake(I id) {
* @param id The id to search by
* @return a {@link T} object if the object is loaded or makes and returns a new object
*/
public final T getOrMake(I id) {
return objects.getUnchecked(id); return objects.getUnchecked(id);
} }
/** @Override
* Get an object by id public T get(I id) {
* @param id The id to search by
* @return a {@link T} object if the object is loaded, returns null if the object is not loaded
*/
public final T get(I id) {
return objects.getIfPresent(id); return objects.getIfPresent(id);
} }
/** @Override
* Check to see if a object is loaded or not public boolean isLoaded(I id) {
* @param id The id of the object
* @return true if the object is loaded
*/
public final boolean isLoaded(I id) {
return objects.asMap().containsKey(id); return objects.asMap().containsKey(id);
} }
/** @Override
* Removes and unloads the object from the manager public void unload(T t) {
* @param t The object to unload
*/
public final void unload(T t) {
if (t != null) { if (t != null) {
objects.invalidate(t.getId()); objects.invalidate(t.getId());
} }
} }
/** @Override
* Unloads all objects from the manager public void unloadAll() {
*/
public final void unloadAll() {
objects.invalidateAll(); objects.invalidateAll();
} }

View File

@ -0,0 +1,29 @@
/*
* Copyright (c) 2016 Lucko (Luck) <luck@lucko.me>
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
package me.lucko.luckperms.common.managers;
import me.lucko.luckperms.common.core.model.Group;
public interface GroupManager extends Manager<String, Group> {
}

View File

@ -0,0 +1,75 @@
/*
* Copyright (c) 2016 Lucko (Luck) <luck@lucko.me>
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
package me.lucko.luckperms.common.managers;
import me.lucko.luckperms.common.utils.Identifiable;
import java.util.Map;
import java.util.function.Function;
/**
* A class which manages instances of a class
* @param <I> the class used to identify each object held in this manager
* @param <T> the class this manager is "managing"
*/
public interface Manager<I, T extends Identifiable<I>> extends Function<I, T> {
/**
* Gets a map containing all cached instances held by this manager.
* @return all instances held in this manager
*/
Map<I, T> getAll();
/**
* Gets or creates an object by id
* @param id The id to search by
* @return a {@link T} object if the object is loaded or makes and returns a new object
*/
T getOrMake(I id);
/**
* Get an object by id
* @param id The id to search by
* @return a {@link T} object if the object is loaded, returns null if the object is not loaded
*/
T get(I id);
/**
* Check to see if a object is loaded or not
* @param id The id of the object
* @return true if the object is loaded
*/
boolean isLoaded(I id);
/**
* Removes and unloads the object from the manager
* @param t The object to unload
*/
void unload(T t);
/**
* Unloads all objects from the manager
*/
void unloadAll();
}

View File

@ -0,0 +1,29 @@
/*
* Copyright (c) 2016 Lucko (Luck) <luck@lucko.me>
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
package me.lucko.luckperms.common.managers;
import me.lucko.luckperms.common.core.model.Track;
public interface TrackManager extends Manager<String, Track> {
}

Some files were not shown because too many files have changed in this diff Show More