Refactoring & misc cleanup
This commit is contained in:
parent
07eb17f5d5
commit
1d5e3205ac
@ -30,8 +30,8 @@ import lombok.RequiredArgsConstructor;
|
|||||||
import me.lucko.luckperms.bukkit.model.Injector;
|
import me.lucko.luckperms.bukkit.model.Injector;
|
||||||
import me.lucko.luckperms.bukkit.model.LPPermissible;
|
import me.lucko.luckperms.bukkit.model.LPPermissible;
|
||||||
import me.lucko.luckperms.common.config.ConfigKeys;
|
import me.lucko.luckperms.common.config.ConfigKeys;
|
||||||
import me.lucko.luckperms.common.core.model.User;
|
|
||||||
import me.lucko.luckperms.common.locale.Message;
|
import me.lucko.luckperms.common.locale.Message;
|
||||||
|
import me.lucko.luckperms.common.model.User;
|
||||||
import me.lucko.luckperms.common.utils.LoginHelper;
|
import me.lucko.luckperms.common.utils.LoginHelper;
|
||||||
|
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
|
@ -34,51 +34,53 @@ import me.lucko.luckperms.api.PlatformType;
|
|||||||
import me.lucko.luckperms.api.context.ContextSet;
|
import me.lucko.luckperms.api.context.ContextSet;
|
||||||
import me.lucko.luckperms.api.context.ImmutableContextSet;
|
import me.lucko.luckperms.api.context.ImmutableContextSet;
|
||||||
import me.lucko.luckperms.api.context.MutableContextSet;
|
import me.lucko.luckperms.api.context.MutableContextSet;
|
||||||
|
import me.lucko.luckperms.bukkit.calculators.BukkitCalculatorFactory;
|
||||||
|
import me.lucko.luckperms.bukkit.contexts.WorldCalculator;
|
||||||
import me.lucko.luckperms.bukkit.messaging.BungeeMessagingService;
|
import me.lucko.luckperms.bukkit.messaging.BungeeMessagingService;
|
||||||
import me.lucko.luckperms.bukkit.messaging.LilyPadMessagingService;
|
import me.lucko.luckperms.bukkit.messaging.LilyPadMessagingService;
|
||||||
import me.lucko.luckperms.bukkit.model.ChildPermissionProvider;
|
|
||||||
import me.lucko.luckperms.bukkit.model.DefaultsProvider;
|
|
||||||
import me.lucko.luckperms.bukkit.model.Injector;
|
import me.lucko.luckperms.bukkit.model.Injector;
|
||||||
import me.lucko.luckperms.bukkit.model.LPPermissible;
|
import me.lucko.luckperms.bukkit.model.LPPermissible;
|
||||||
|
import me.lucko.luckperms.bukkit.processors.ChildPermissionProvider;
|
||||||
|
import me.lucko.luckperms.bukkit.processors.DefaultsProvider;
|
||||||
import me.lucko.luckperms.bukkit.vault.VaultHookManager;
|
import me.lucko.luckperms.bukkit.vault.VaultHookManager;
|
||||||
import me.lucko.luckperms.common.api.ApiHandler;
|
import me.lucko.luckperms.common.api.ApiHandler;
|
||||||
import me.lucko.luckperms.common.api.ApiProvider;
|
import me.lucko.luckperms.common.api.ApiProvider;
|
||||||
|
import me.lucko.luckperms.common.buffers.BufferedRequest;
|
||||||
import me.lucko.luckperms.common.caching.handlers.CachedStateManager;
|
import me.lucko.luckperms.common.caching.handlers.CachedStateManager;
|
||||||
import me.lucko.luckperms.common.calculators.CalculatorFactory;
|
import me.lucko.luckperms.common.calculators.CalculatorFactory;
|
||||||
import me.lucko.luckperms.common.commands.sender.Sender;
|
import me.lucko.luckperms.common.commands.sender.Sender;
|
||||||
import me.lucko.luckperms.common.config.ConfigKeys;
|
import me.lucko.luckperms.common.config.ConfigKeys;
|
||||||
import me.lucko.luckperms.common.config.LuckPermsConfiguration;
|
import me.lucko.luckperms.common.config.LuckPermsConfiguration;
|
||||||
import me.lucko.luckperms.common.constants.Permission;
|
import me.lucko.luckperms.common.constants.CommandPermission;
|
||||||
import me.lucko.luckperms.common.contexts.ContextManager;
|
import me.lucko.luckperms.common.contexts.ContextManager;
|
||||||
import me.lucko.luckperms.common.contexts.StaticCalculator;
|
import me.lucko.luckperms.common.contexts.LuckPermsCalculator;
|
||||||
import me.lucko.luckperms.common.core.UuidCache;
|
|
||||||
import me.lucko.luckperms.common.core.model.User;
|
|
||||||
import me.lucko.luckperms.common.dependencies.Dependency;
|
import me.lucko.luckperms.common.dependencies.Dependency;
|
||||||
import me.lucko.luckperms.common.dependencies.DependencyManager;
|
import me.lucko.luckperms.common.dependencies.DependencyManager;
|
||||||
import me.lucko.luckperms.common.locale.LocaleManager;
|
import me.lucko.luckperms.common.locale.LocaleManager;
|
||||||
import me.lucko.luckperms.common.locale.NoopLocaleManager;
|
import me.lucko.luckperms.common.locale.NoopLocaleManager;
|
||||||
import me.lucko.luckperms.common.locale.SimpleLocaleManager;
|
import me.lucko.luckperms.common.locale.SimpleLocaleManager;
|
||||||
|
import me.lucko.luckperms.common.logging.SenderLogger;
|
||||||
|
import me.lucko.luckperms.common.managers.GenericGroupManager;
|
||||||
|
import me.lucko.luckperms.common.managers.GenericTrackManager;
|
||||||
|
import me.lucko.luckperms.common.managers.GenericUserManager;
|
||||||
import me.lucko.luckperms.common.managers.GroupManager;
|
import me.lucko.luckperms.common.managers.GroupManager;
|
||||||
import me.lucko.luckperms.common.managers.TrackManager;
|
import me.lucko.luckperms.common.managers.TrackManager;
|
||||||
import me.lucko.luckperms.common.managers.UserManager;
|
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.InternalMessagingService;
|
import me.lucko.luckperms.common.messaging.InternalMessagingService;
|
||||||
import me.lucko.luckperms.common.messaging.NoopMessagingService;
|
import me.lucko.luckperms.common.messaging.NoopMessagingService;
|
||||||
import me.lucko.luckperms.common.messaging.RedisMessagingService;
|
import me.lucko.luckperms.common.messaging.RedisMessagingService;
|
||||||
|
import me.lucko.luckperms.common.model.User;
|
||||||
import me.lucko.luckperms.common.plugin.LuckPermsPlugin;
|
import me.lucko.luckperms.common.plugin.LuckPermsPlugin;
|
||||||
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.storage.StorageType;
|
import me.lucko.luckperms.common.storage.StorageType;
|
||||||
|
import me.lucko.luckperms.common.storage.backing.file.FileWatcher;
|
||||||
import me.lucko.luckperms.common.tasks.CacheHousekeepingTask;
|
import me.lucko.luckperms.common.tasks.CacheHousekeepingTask;
|
||||||
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.treeview.PermissionVault;
|
import me.lucko.luckperms.common.treeview.PermissionVault;
|
||||||
import me.lucko.luckperms.common.utils.BufferedRequest;
|
|
||||||
import me.lucko.luckperms.common.utils.FileWatcher;
|
|
||||||
import me.lucko.luckperms.common.utils.LoginHelper;
|
import me.lucko.luckperms.common.utils.LoginHelper;
|
||||||
import me.lucko.luckperms.common.utils.SenderLogger;
|
import me.lucko.luckperms.common.utils.UuidCache;
|
||||||
import me.lucko.luckperms.common.verbose.VerboseHandler;
|
import me.lucko.luckperms.common.verbose.VerboseHandler;
|
||||||
|
|
||||||
import org.bukkit.World;
|
import org.bukkit.World;
|
||||||
@ -287,7 +289,7 @@ public class LPBukkitPlugin extends JavaPlugin implements LuckPermsPlugin {
|
|||||||
groupManager = new GenericGroupManager(this);
|
groupManager = new GenericGroupManager(this);
|
||||||
trackManager = new GenericTrackManager(this);
|
trackManager = new GenericTrackManager(this);
|
||||||
calculatorFactory = new BukkitCalculatorFactory(this);
|
calculatorFactory = new BukkitCalculatorFactory(this);
|
||||||
cachedStateManager = new CachedStateManager(this);
|
cachedStateManager = new CachedStateManager();
|
||||||
|
|
||||||
contextManager = new ContextManager<Player>() {
|
contextManager = new ContextManager<Player>() {
|
||||||
@Override
|
@Override
|
||||||
@ -307,7 +309,7 @@ public class LPBukkitPlugin extends JavaPlugin implements LuckPermsPlugin {
|
|||||||
worldCalculator = new WorldCalculator(this);
|
worldCalculator = new WorldCalculator(this);
|
||||||
contextManager.registerCalculator(worldCalculator);
|
contextManager.registerCalculator(worldCalculator);
|
||||||
|
|
||||||
StaticCalculator<Player> staticCalculator = new StaticCalculator<>(getConfiguration());
|
LuckPermsCalculator<Player> staticCalculator = new LuckPermsCalculator<>(getConfiguration());
|
||||||
contextManager.registerCalculator(staticCalculator, true);
|
contextManager.registerCalculator(staticCalculator, true);
|
||||||
|
|
||||||
// Provide vault support
|
// Provide vault support
|
||||||
@ -665,10 +667,8 @@ public class LPBukkitPlugin extends JavaPlugin implements LuckPermsPlugin {
|
|||||||
private void registerPermissions(PermissionDefault def) {
|
private void registerPermissions(PermissionDefault def) {
|
||||||
PluginManager pm = getServer().getPluginManager();
|
PluginManager pm = getServer().getPluginManager();
|
||||||
|
|
||||||
for (Permission p : Permission.values()) {
|
for (CommandPermission p : CommandPermission.values()) {
|
||||||
for (String node : p.getNodes()) {
|
pm.addPermission(new org.bukkit.permissions.Permission(p.getPermission(), def));
|
||||||
pm.addPermission(new org.bukkit.permissions.Permission(node, def));
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -23,26 +23,27 @@
|
|||||||
* SOFTWARE.
|
* SOFTWARE.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package me.lucko.luckperms.bukkit;
|
package me.lucko.luckperms.bukkit.calculators;
|
||||||
|
|
||||||
import lombok.AllArgsConstructor;
|
import lombok.AllArgsConstructor;
|
||||||
|
|
||||||
import com.google.common.collect.ImmutableList;
|
import com.google.common.collect.ImmutableList;
|
||||||
|
|
||||||
import me.lucko.luckperms.api.Contexts;
|
import me.lucko.luckperms.api.Contexts;
|
||||||
import me.lucko.luckperms.bukkit.calculators.AttachmentProcessor;
|
import me.lucko.luckperms.bukkit.LPBukkitPlugin;
|
||||||
import me.lucko.luckperms.bukkit.calculators.ChildProcessor;
|
|
||||||
import me.lucko.luckperms.bukkit.calculators.DefaultsProcessor;
|
|
||||||
import me.lucko.luckperms.bukkit.model.Injector;
|
import me.lucko.luckperms.bukkit.model.Injector;
|
||||||
import me.lucko.luckperms.bukkit.model.LPPermissible;
|
import me.lucko.luckperms.bukkit.model.LPPermissible;
|
||||||
|
import me.lucko.luckperms.bukkit.processors.AttachmentProcessor;
|
||||||
|
import me.lucko.luckperms.bukkit.processors.ChildProcessor;
|
||||||
|
import me.lucko.luckperms.bukkit.processors.DefaultsProcessor;
|
||||||
import me.lucko.luckperms.common.calculators.AbstractCalculatorFactory;
|
import me.lucko.luckperms.common.calculators.AbstractCalculatorFactory;
|
||||||
import me.lucko.luckperms.common.calculators.PermissionCalculator;
|
import me.lucko.luckperms.common.calculators.PermissionCalculator;
|
||||||
import me.lucko.luckperms.common.calculators.PermissionProcessor;
|
|
||||||
import me.lucko.luckperms.common.calculators.processors.MapProcessor;
|
|
||||||
import me.lucko.luckperms.common.calculators.processors.RegexProcessor;
|
|
||||||
import me.lucko.luckperms.common.calculators.processors.WildcardProcessor;
|
|
||||||
import me.lucko.luckperms.common.config.ConfigKeys;
|
import me.lucko.luckperms.common.config.ConfigKeys;
|
||||||
import me.lucko.luckperms.common.core.model.User;
|
import me.lucko.luckperms.common.model.User;
|
||||||
|
import me.lucko.luckperms.common.processors.MapProcessor;
|
||||||
|
import me.lucko.luckperms.common.processors.PermissionProcessor;
|
||||||
|
import me.lucko.luckperms.common.processors.RegexProcessor;
|
||||||
|
import me.lucko.luckperms.common.processors.WildcardProcessor;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.UUID;
|
import java.util.UUID;
|
@ -23,7 +23,7 @@
|
|||||||
* SOFTWARE.
|
* SOFTWARE.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package me.lucko.luckperms.bukkit;
|
package me.lucko.luckperms.bukkit.contexts;
|
||||||
|
|
||||||
import lombok.RequiredArgsConstructor;
|
import lombok.RequiredArgsConstructor;
|
||||||
|
|
@ -39,14 +39,14 @@ import me.lucko.luckperms.common.commands.CommandResult;
|
|||||||
import me.lucko.luckperms.common.commands.abstraction.SubCommand;
|
import me.lucko.luckperms.common.commands.abstraction.SubCommand;
|
||||||
import me.lucko.luckperms.common.commands.impl.migration.MigrationUtils;
|
import me.lucko.luckperms.common.commands.impl.migration.MigrationUtils;
|
||||||
import me.lucko.luckperms.common.commands.sender.Sender;
|
import me.lucko.luckperms.common.commands.sender.Sender;
|
||||||
import me.lucko.luckperms.common.core.NodeFactory;
|
|
||||||
import me.lucko.luckperms.common.core.model.PermissionHolder;
|
|
||||||
import me.lucko.luckperms.common.core.model.User;
|
|
||||||
import me.lucko.luckperms.common.locale.CommandSpec;
|
import me.lucko.luckperms.common.locale.CommandSpec;
|
||||||
import me.lucko.luckperms.common.locale.LocaleManager;
|
import me.lucko.luckperms.common.locale.LocaleManager;
|
||||||
|
import me.lucko.luckperms.common.logging.ProgressLogger;
|
||||||
|
import me.lucko.luckperms.common.model.PermissionHolder;
|
||||||
|
import me.lucko.luckperms.common.model.User;
|
||||||
|
import me.lucko.luckperms.common.node.NodeFactory;
|
||||||
import me.lucko.luckperms.common.plugin.LuckPermsPlugin;
|
import me.lucko.luckperms.common.plugin.LuckPermsPlugin;
|
||||||
import me.lucko.luckperms.common.utils.Predicates;
|
import me.lucko.luckperms.common.utils.Predicates;
|
||||||
import me.lucko.luckperms.common.utils.ProgressLogger;
|
|
||||||
|
|
||||||
import org.bukkit.Bukkit;
|
import org.bukkit.Bukkit;
|
||||||
import org.bukkit.configuration.ConfigurationSection;
|
import org.bukkit.configuration.ConfigurationSection;
|
||||||
@ -59,7 +59,7 @@ import java.util.Set;
|
|||||||
import java.util.UUID;
|
import java.util.UUID;
|
||||||
import java.util.concurrent.atomic.AtomicInteger;
|
import java.util.concurrent.atomic.AtomicInteger;
|
||||||
|
|
||||||
import static me.lucko.luckperms.common.constants.Permission.MIGRATION;
|
import static me.lucko.luckperms.common.constants.CommandPermission.MIGRATION;
|
||||||
|
|
||||||
public class MigrationBPermissions extends SubCommand<Object> {
|
public class MigrationBPermissions extends SubCommand<Object> {
|
||||||
private static Field uConfigField;
|
private static Field uConfigField;
|
||||||
@ -139,7 +139,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, CreationCause.INTERNAL).join();
|
plugin.getStorage().createAndLoadGroup(groupName, CreationCause.INTERNAL).join();
|
||||||
me.lucko.luckperms.common.core.model.Group lpGroup = plugin.getGroupManager().getIfLoaded(groupName);
|
me.lucko.luckperms.common.model.Group lpGroup = plugin.getGroupManager().getIfLoaded(groupName);
|
||||||
|
|
||||||
MigrationUtils.setGroupWeight(lpGroup, group.getPriority());
|
MigrationUtils.setGroupWeight(lpGroup, group.getPriority());
|
||||||
migrateHolder(world, group, lpGroup);
|
migrateHolder(world, group, lpGroup);
|
||||||
|
@ -33,13 +33,13 @@ import me.lucko.luckperms.common.commands.CommandResult;
|
|||||||
import me.lucko.luckperms.common.commands.abstraction.SubCommand;
|
import me.lucko.luckperms.common.commands.abstraction.SubCommand;
|
||||||
import me.lucko.luckperms.common.commands.impl.migration.MigrationUtils;
|
import me.lucko.luckperms.common.commands.impl.migration.MigrationUtils;
|
||||||
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.CommandPermission;
|
||||||
import me.lucko.luckperms.common.core.NodeFactory;
|
|
||||||
import me.lucko.luckperms.common.locale.CommandSpec;
|
import me.lucko.luckperms.common.locale.CommandSpec;
|
||||||
import me.lucko.luckperms.common.locale.LocaleManager;
|
import me.lucko.luckperms.common.locale.LocaleManager;
|
||||||
|
import me.lucko.luckperms.common.logging.ProgressLogger;
|
||||||
|
import me.lucko.luckperms.common.node.NodeFactory;
|
||||||
import me.lucko.luckperms.common.plugin.LuckPermsPlugin;
|
import me.lucko.luckperms.common.plugin.LuckPermsPlugin;
|
||||||
import me.lucko.luckperms.common.utils.Predicates;
|
import me.lucko.luckperms.common.utils.Predicates;
|
||||||
import me.lucko.luckperms.common.utils.ProgressLogger;
|
|
||||||
|
|
||||||
import org.anjocaido.groupmanager.GlobalGroups;
|
import org.anjocaido.groupmanager.GlobalGroups;
|
||||||
import org.anjocaido.groupmanager.GroupManager;
|
import org.anjocaido.groupmanager.GroupManager;
|
||||||
@ -62,7 +62,7 @@ import java.util.stream.Collectors;
|
|||||||
|
|
||||||
public class MigrationGroupManager extends SubCommand<Object> {
|
public class MigrationGroupManager extends SubCommand<Object> {
|
||||||
public MigrationGroupManager(LocaleManager locale) {
|
public MigrationGroupManager(LocaleManager locale) {
|
||||||
super(CommandSpec.MIGRATION_GROUPMANAGER.spec(locale), "groupmanager", Permission.MIGRATION, Predicates.is(0));
|
super(CommandSpec.MIGRATION_GROUPMANAGER.spec(locale), "groupmanager", CommandPermission.MIGRATION, Predicates.is(0));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@ -97,7 +97,7 @@ public class MigrationGroupManager extends SubCommand<Object> {
|
|||||||
String groupName = MigrationUtils.standardizeName(g.getName());
|
String groupName = MigrationUtils.standardizeName(g.getName());
|
||||||
|
|
||||||
plugin.getStorage().createAndLoadGroup(groupName, CreationCause.INTERNAL).join();
|
plugin.getStorage().createAndLoadGroup(groupName, CreationCause.INTERNAL).join();
|
||||||
me.lucko.luckperms.common.core.model.Group group = plugin.getGroupManager().getIfLoaded(groupName);
|
me.lucko.luckperms.common.model.Group group = plugin.getGroupManager().getIfLoaded(groupName);
|
||||||
|
|
||||||
for (String node : g.getPermissionList()) {
|
for (String node : g.getPermissionList()) {
|
||||||
if (node.isEmpty()) {
|
if (node.isEmpty()) {
|
||||||
@ -248,7 +248,7 @@ public class MigrationGroupManager extends SubCommand<Object> {
|
|||||||
AtomicInteger groupCount = new AtomicInteger(0);
|
AtomicInteger groupCount = new AtomicInteger(0);
|
||||||
for (Map.Entry<String, Set<Node>> e : groups.entrySet()) {
|
for (Map.Entry<String, Set<Node>> e : groups.entrySet()) {
|
||||||
plugin.getStorage().createAndLoadGroup(e.getKey(), CreationCause.INTERNAL).join();
|
plugin.getStorage().createAndLoadGroup(e.getKey(), CreationCause.INTERNAL).join();
|
||||||
me.lucko.luckperms.common.core.model.Group group = plugin.getGroupManager().getIfLoaded(e.getKey());
|
me.lucko.luckperms.common.model.Group group = plugin.getGroupManager().getIfLoaded(e.getKey());
|
||||||
|
|
||||||
for (Node node : e.getValue()) {
|
for (Node node : e.getValue()) {
|
||||||
group.setPermission(node);
|
group.setPermission(node);
|
||||||
@ -263,7 +263,7 @@ public class MigrationGroupManager extends SubCommand<Object> {
|
|||||||
AtomicInteger userCount = new AtomicInteger(0);
|
AtomicInteger userCount = new AtomicInteger(0);
|
||||||
for (Map.Entry<UUID, Set<Node>> e : users.entrySet()) {
|
for (Map.Entry<UUID, Set<Node>> e : users.entrySet()) {
|
||||||
plugin.getStorage().loadUser(e.getKey(), "null").join();
|
plugin.getStorage().loadUser(e.getKey(), "null").join();
|
||||||
me.lucko.luckperms.common.core.model.User user = plugin.getUserManager().getIfLoaded(e.getKey());
|
me.lucko.luckperms.common.model.User user = plugin.getUserManager().getIfLoaded(e.getKey());
|
||||||
|
|
||||||
for (Node node : e.getValue()) {
|
for (Node node : e.getValue()) {
|
||||||
user.setPermission(node);
|
user.setPermission(node);
|
||||||
|
@ -31,16 +31,16 @@ import me.lucko.luckperms.common.commands.CommandResult;
|
|||||||
import me.lucko.luckperms.common.commands.abstraction.SubCommand;
|
import me.lucko.luckperms.common.commands.abstraction.SubCommand;
|
||||||
import me.lucko.luckperms.common.commands.impl.migration.MigrationUtils;
|
import me.lucko.luckperms.common.commands.impl.migration.MigrationUtils;
|
||||||
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.CommandPermission;
|
||||||
import me.lucko.luckperms.common.core.NodeFactory;
|
|
||||||
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.locale.CommandSpec;
|
import me.lucko.luckperms.common.locale.CommandSpec;
|
||||||
import me.lucko.luckperms.common.locale.LocaleManager;
|
import me.lucko.luckperms.common.locale.LocaleManager;
|
||||||
|
import me.lucko.luckperms.common.logging.ProgressLogger;
|
||||||
|
import me.lucko.luckperms.common.model.Group;
|
||||||
|
import me.lucko.luckperms.common.model.PermissionHolder;
|
||||||
|
import me.lucko.luckperms.common.model.User;
|
||||||
|
import me.lucko.luckperms.common.node.NodeFactory;
|
||||||
import me.lucko.luckperms.common.plugin.LuckPermsPlugin;
|
import me.lucko.luckperms.common.plugin.LuckPermsPlugin;
|
||||||
import me.lucko.luckperms.common.utils.Predicates;
|
import me.lucko.luckperms.common.utils.Predicates;
|
||||||
import me.lucko.luckperms.common.utils.ProgressLogger;
|
|
||||||
|
|
||||||
import org.bukkit.Bukkit;
|
import org.bukkit.Bukkit;
|
||||||
|
|
||||||
@ -59,7 +59,7 @@ import java.util.concurrent.atomic.AtomicInteger;
|
|||||||
|
|
||||||
public class MigrationPermissionsEx extends SubCommand<Object> {
|
public class MigrationPermissionsEx extends SubCommand<Object> {
|
||||||
public MigrationPermissionsEx(LocaleManager locale) {
|
public MigrationPermissionsEx(LocaleManager locale) {
|
||||||
super(CommandSpec.MIGRATION_COMMAND.spec(locale), "permissionsex", Permission.MIGRATION, Predicates.alwaysFalse());
|
super(CommandSpec.MIGRATION_COMMAND.spec(locale), "permissionsex", CommandPermission.MIGRATION, Predicates.alwaysFalse());
|
||||||
}
|
}
|
||||||
|
|
||||||
@SuppressWarnings("deprecation")
|
@SuppressWarnings("deprecation")
|
||||||
|
@ -41,17 +41,17 @@ import me.lucko.luckperms.common.commands.abstraction.SubCommand;
|
|||||||
import me.lucko.luckperms.common.commands.impl.migration.MigrationUtils;
|
import me.lucko.luckperms.common.commands.impl.migration.MigrationUtils;
|
||||||
import me.lucko.luckperms.common.commands.sender.Sender;
|
import me.lucko.luckperms.common.commands.sender.Sender;
|
||||||
import me.lucko.luckperms.common.config.ConfigKeys;
|
import me.lucko.luckperms.common.config.ConfigKeys;
|
||||||
import me.lucko.luckperms.common.core.NodeFactory;
|
|
||||||
import me.lucko.luckperms.common.core.model.PermissionHolder;
|
|
||||||
import me.lucko.luckperms.common.core.model.User;
|
|
||||||
import me.lucko.luckperms.common.dependencies.DependencyManager;
|
import me.lucko.luckperms.common.dependencies.DependencyManager;
|
||||||
import me.lucko.luckperms.common.locale.CommandSpec;
|
import me.lucko.luckperms.common.locale.CommandSpec;
|
||||||
import me.lucko.luckperms.common.locale.LocaleManager;
|
import me.lucko.luckperms.common.locale.LocaleManager;
|
||||||
|
import me.lucko.luckperms.common.logging.ProgressLogger;
|
||||||
|
import me.lucko.luckperms.common.model.PermissionHolder;
|
||||||
|
import me.lucko.luckperms.common.model.User;
|
||||||
|
import me.lucko.luckperms.common.node.NodeFactory;
|
||||||
import me.lucko.luckperms.common.plugin.LuckPermsPlugin;
|
import me.lucko.luckperms.common.plugin.LuckPermsPlugin;
|
||||||
import me.lucko.luckperms.common.storage.StorageType;
|
import me.lucko.luckperms.common.storage.StorageType;
|
||||||
import me.lucko.luckperms.common.utils.HikariSupplier;
|
import me.lucko.luckperms.common.utils.HikariSupplier;
|
||||||
import me.lucko.luckperms.common.utils.Predicates;
|
import me.lucko.luckperms.common.utils.Predicates;
|
||||||
import me.lucko.luckperms.common.utils.ProgressLogger;
|
|
||||||
|
|
||||||
import org.bukkit.Bukkit;
|
import org.bukkit.Bukkit;
|
||||||
|
|
||||||
@ -68,7 +68,7 @@ import java.util.UUID;
|
|||||||
import java.util.concurrent.Future;
|
import java.util.concurrent.Future;
|
||||||
import java.util.concurrent.atomic.AtomicInteger;
|
import java.util.concurrent.atomic.AtomicInteger;
|
||||||
|
|
||||||
import static me.lucko.luckperms.common.constants.Permission.MIGRATION;
|
import static me.lucko.luckperms.common.constants.CommandPermission.MIGRATION;
|
||||||
|
|
||||||
// Only supports the latest versions of the PP API. (it seems to change randomly almost every release)
|
// Only supports the latest versions of the PP API. (it seems to change randomly almost every release)
|
||||||
public class MigrationPowerfulPerms extends SubCommand<Object> {
|
public class MigrationPowerfulPerms extends SubCommand<Object> {
|
||||||
@ -167,7 +167,7 @@ public class MigrationPowerfulPerms extends SubCommand<Object> {
|
|||||||
|
|
||||||
final String groupName = MigrationUtils.standardizeName(g.getName());
|
final String groupName = MigrationUtils.standardizeName(g.getName());
|
||||||
plugin.getStorage().createAndLoadGroup(groupName, CreationCause.INTERNAL).join();
|
plugin.getStorage().createAndLoadGroup(groupName, CreationCause.INTERNAL).join();
|
||||||
final me.lucko.luckperms.common.core.model.Group group = plugin.getGroupManager().getIfLoaded(groupName);
|
final me.lucko.luckperms.common.model.Group group = plugin.getGroupManager().getIfLoaded(groupName);
|
||||||
|
|
||||||
MigrationUtils.setGroupWeight(group, g.getRank());
|
MigrationUtils.setGroupWeight(group, g.getRank());
|
||||||
|
|
||||||
|
@ -34,17 +34,17 @@ import me.lucko.luckperms.common.commands.abstraction.SubCommand;
|
|||||||
import me.lucko.luckperms.common.commands.impl.migration.MigrationUtils;
|
import me.lucko.luckperms.common.commands.impl.migration.MigrationUtils;
|
||||||
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.CommandPermission;
|
||||||
import me.lucko.luckperms.common.core.NodeFactory;
|
|
||||||
import me.lucko.luckperms.common.core.model.Group;
|
|
||||||
import me.lucko.luckperms.common.core.model.PermissionHolder;
|
|
||||||
import me.lucko.luckperms.common.core.model.Track;
|
|
||||||
import me.lucko.luckperms.common.core.model.User;
|
|
||||||
import me.lucko.luckperms.common.locale.CommandSpec;
|
import me.lucko.luckperms.common.locale.CommandSpec;
|
||||||
import me.lucko.luckperms.common.locale.LocaleManager;
|
import me.lucko.luckperms.common.locale.LocaleManager;
|
||||||
|
import me.lucko.luckperms.common.logging.ProgressLogger;
|
||||||
|
import me.lucko.luckperms.common.model.Group;
|
||||||
|
import me.lucko.luckperms.common.model.PermissionHolder;
|
||||||
|
import me.lucko.luckperms.common.model.Track;
|
||||||
|
import me.lucko.luckperms.common.model.User;
|
||||||
|
import me.lucko.luckperms.common.node.NodeFactory;
|
||||||
import me.lucko.luckperms.common.plugin.LuckPermsPlugin;
|
import me.lucko.luckperms.common.plugin.LuckPermsPlugin;
|
||||||
import me.lucko.luckperms.common.utils.Predicates;
|
import me.lucko.luckperms.common.utils.Predicates;
|
||||||
import me.lucko.luckperms.common.utils.ProgressLogger;
|
|
||||||
|
|
||||||
import org.bukkit.Bukkit;
|
import org.bukkit.Bukkit;
|
||||||
import org.tyrannyofheaven.bukkit.zPermissions.ZPermissionsService;
|
import org.tyrannyofheaven.bukkit.zPermissions.ZPermissionsService;
|
||||||
@ -65,7 +65,7 @@ import java.util.concurrent.atomic.AtomicInteger;
|
|||||||
|
|
||||||
public class MigrationZPermissions extends SubCommand<Object> {
|
public class MigrationZPermissions extends SubCommand<Object> {
|
||||||
public MigrationZPermissions(LocaleManager locale) {
|
public MigrationZPermissions(LocaleManager locale) {
|
||||||
super(CommandSpec.MIGRATION_COMMAND.spec(locale), "zpermissions", Permission.MIGRATION, Predicates.alwaysFalse());
|
super(CommandSpec.MIGRATION_COMMAND.spec(locale), "zpermissions", CommandPermission.MIGRATION, Predicates.alwaysFalse());
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -34,7 +34,7 @@ import me.lucko.luckperms.api.Tristate;
|
|||||||
import me.lucko.luckperms.bukkit.LPBukkitPlugin;
|
import me.lucko.luckperms.bukkit.LPBukkitPlugin;
|
||||||
import me.lucko.luckperms.common.caching.UserCache;
|
import me.lucko.luckperms.common.caching.UserCache;
|
||||||
import me.lucko.luckperms.common.config.ConfigKeys;
|
import me.lucko.luckperms.common.config.ConfigKeys;
|
||||||
import me.lucko.luckperms.common.core.model.User;
|
import me.lucko.luckperms.common.model.User;
|
||||||
|
|
||||||
import org.bukkit.Bukkit;
|
import org.bukkit.Bukkit;
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
|
@ -23,13 +23,13 @@
|
|||||||
* SOFTWARE.
|
* SOFTWARE.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package me.lucko.luckperms.bukkit.calculators;
|
package me.lucko.luckperms.bukkit.processors;
|
||||||
|
|
||||||
import lombok.AllArgsConstructor;
|
import lombok.AllArgsConstructor;
|
||||||
import lombok.Getter;
|
import lombok.Getter;
|
||||||
|
|
||||||
import me.lucko.luckperms.api.Tristate;
|
import me.lucko.luckperms.api.Tristate;
|
||||||
import me.lucko.luckperms.common.calculators.PermissionProcessor;
|
import me.lucko.luckperms.common.processors.PermissionProcessor;
|
||||||
|
|
||||||
import org.bukkit.permissions.PermissionAttachmentInfo;
|
import org.bukkit.permissions.PermissionAttachmentInfo;
|
||||||
|
|
@ -23,7 +23,7 @@
|
|||||||
* SOFTWARE.
|
* SOFTWARE.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package me.lucko.luckperms.bukkit.model;
|
package me.lucko.luckperms.bukkit.processors;
|
||||||
|
|
||||||
import lombok.Getter;
|
import lombok.Getter;
|
||||||
|
|
@ -23,15 +23,14 @@
|
|||||||
* SOFTWARE.
|
* SOFTWARE.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package me.lucko.luckperms.bukkit.calculators;
|
package me.lucko.luckperms.bukkit.processors;
|
||||||
|
|
||||||
import lombok.RequiredArgsConstructor;
|
import lombok.RequiredArgsConstructor;
|
||||||
|
|
||||||
import com.google.common.collect.Maps;
|
import com.google.common.collect.Maps;
|
||||||
|
|
||||||
import me.lucko.luckperms.api.Tristate;
|
import me.lucko.luckperms.api.Tristate;
|
||||||
import me.lucko.luckperms.bukkit.model.ChildPermissionProvider;
|
import me.lucko.luckperms.common.processors.PermissionProcessor;
|
||||||
import me.lucko.luckperms.common.calculators.PermissionProcessor;
|
|
||||||
|
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
import java.util.concurrent.ConcurrentHashMap;
|
import java.util.concurrent.ConcurrentHashMap;
|
@ -23,13 +23,12 @@
|
|||||||
* SOFTWARE.
|
* SOFTWARE.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package me.lucko.luckperms.bukkit.calculators;
|
package me.lucko.luckperms.bukkit.processors;
|
||||||
|
|
||||||
import lombok.AllArgsConstructor;
|
import lombok.AllArgsConstructor;
|
||||||
|
|
||||||
import me.lucko.luckperms.api.Tristate;
|
import me.lucko.luckperms.api.Tristate;
|
||||||
import me.lucko.luckperms.bukkit.model.DefaultsProvider;
|
import me.lucko.luckperms.common.processors.PermissionProcessor;
|
||||||
import me.lucko.luckperms.common.calculators.PermissionProcessor;
|
|
||||||
|
|
||||||
import org.bukkit.Bukkit;
|
import org.bukkit.Bukkit;
|
||||||
import org.bukkit.permissions.Permission;
|
import org.bukkit.permissions.Permission;
|
@ -23,13 +23,14 @@
|
|||||||
* SOFTWARE.
|
* SOFTWARE.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package me.lucko.luckperms.bukkit.model;
|
package me.lucko.luckperms.bukkit.processors;
|
||||||
|
|
||||||
import lombok.Getter;
|
import lombok.Getter;
|
||||||
|
|
||||||
import com.google.common.collect.ImmutableMap;
|
import com.google.common.collect.ImmutableMap;
|
||||||
|
|
||||||
import me.lucko.luckperms.api.Tristate;
|
import me.lucko.luckperms.api.Tristate;
|
||||||
|
import me.lucko.luckperms.bukkit.model.DummyPermissible;
|
||||||
|
|
||||||
import org.bukkit.Bukkit;
|
import org.bukkit.Bukkit;
|
||||||
import org.bukkit.permissions.Permission;
|
import org.bukkit.permissions.Permission;
|
@ -32,11 +32,11 @@ import me.lucko.luckperms.api.Contexts;
|
|||||||
import me.lucko.luckperms.api.Node;
|
import me.lucko.luckperms.api.Node;
|
||||||
import me.lucko.luckperms.api.caching.MetaData;
|
import me.lucko.luckperms.api.caching.MetaData;
|
||||||
import me.lucko.luckperms.common.caching.MetaAccumulator;
|
import me.lucko.luckperms.common.caching.MetaAccumulator;
|
||||||
import me.lucko.luckperms.common.core.NodeFactory;
|
import me.lucko.luckperms.common.contexts.ExtractedContexts;
|
||||||
import me.lucko.luckperms.common.core.model.Group;
|
import me.lucko.luckperms.common.model.Group;
|
||||||
import me.lucko.luckperms.common.core.model.PermissionHolder;
|
import me.lucko.luckperms.common.model.PermissionHolder;
|
||||||
import me.lucko.luckperms.common.core.model.User;
|
import me.lucko.luckperms.common.model.User;
|
||||||
import me.lucko.luckperms.common.utils.ExtractedContexts;
|
import me.lucko.luckperms.common.node.NodeFactory;
|
||||||
|
|
||||||
import net.milkbowl.vault.chat.Chat;
|
import net.milkbowl.vault.chat.Chat;
|
||||||
|
|
||||||
|
@ -37,11 +37,11 @@ import me.lucko.luckperms.api.context.ImmutableContextSet;
|
|||||||
import me.lucko.luckperms.api.context.MutableContextSet;
|
import me.lucko.luckperms.api.context.MutableContextSet;
|
||||||
import me.lucko.luckperms.bukkit.LPBukkitPlugin;
|
import me.lucko.luckperms.bukkit.LPBukkitPlugin;
|
||||||
import me.lucko.luckperms.common.config.ConfigKeys;
|
import me.lucko.luckperms.common.config.ConfigKeys;
|
||||||
import me.lucko.luckperms.common.core.NodeFactory;
|
import me.lucko.luckperms.common.contexts.ExtractedContexts;
|
||||||
import me.lucko.luckperms.common.core.model.Group;
|
import me.lucko.luckperms.common.model.Group;
|
||||||
import me.lucko.luckperms.common.core.model.PermissionHolder;
|
import me.lucko.luckperms.common.model.PermissionHolder;
|
||||||
import me.lucko.luckperms.common.core.model.User;
|
import me.lucko.luckperms.common.model.User;
|
||||||
import me.lucko.luckperms.common.utils.ExtractedContexts;
|
import me.lucko.luckperms.common.node.NodeFactory;
|
||||||
|
|
||||||
import net.milkbowl.vault.permission.Permission;
|
import net.milkbowl.vault.permission.Permission;
|
||||||
|
|
||||||
|
@ -32,8 +32,8 @@ import me.lucko.luckperms.api.Tristate;
|
|||||||
import me.lucko.luckperms.api.context.MutableContextSet;
|
import me.lucko.luckperms.api.context.MutableContextSet;
|
||||||
import me.lucko.luckperms.bungee.event.TristateCheckEvent;
|
import me.lucko.luckperms.bungee.event.TristateCheckEvent;
|
||||||
import me.lucko.luckperms.common.config.ConfigKeys;
|
import me.lucko.luckperms.common.config.ConfigKeys;
|
||||||
import me.lucko.luckperms.common.core.model.User;
|
|
||||||
import me.lucko.luckperms.common.locale.Message;
|
import me.lucko.luckperms.common.locale.Message;
|
||||||
|
import me.lucko.luckperms.common.model.User;
|
||||||
import me.lucko.luckperms.common.utils.LoginHelper;
|
import me.lucko.luckperms.common.utils.LoginHelper;
|
||||||
|
|
||||||
import net.md_5.bungee.api.chat.TextComponent;
|
import net.md_5.bungee.api.chat.TextComponent;
|
||||||
|
@ -32,11 +32,14 @@ import me.lucko.luckperms.api.Logger;
|
|||||||
import me.lucko.luckperms.api.PlatformType;
|
import me.lucko.luckperms.api.PlatformType;
|
||||||
import me.lucko.luckperms.api.context.ContextSet;
|
import me.lucko.luckperms.api.context.ContextSet;
|
||||||
import me.lucko.luckperms.api.context.ImmutableContextSet;
|
import me.lucko.luckperms.api.context.ImmutableContextSet;
|
||||||
|
import me.lucko.luckperms.bungee.calculators.BungeeCalculatorFactory;
|
||||||
|
import me.lucko.luckperms.bungee.contexts.BackendServerCalculator;
|
||||||
import me.lucko.luckperms.bungee.messaging.BungeeMessagingService;
|
import me.lucko.luckperms.bungee.messaging.BungeeMessagingService;
|
||||||
import me.lucko.luckperms.bungee.messaging.RedisBungeeMessagingService;
|
import me.lucko.luckperms.bungee.messaging.RedisBungeeMessagingService;
|
||||||
import me.lucko.luckperms.bungee.util.RedisBungeeUtil;
|
import me.lucko.luckperms.bungee.util.RedisBungeeUtil;
|
||||||
import me.lucko.luckperms.common.api.ApiHandler;
|
import me.lucko.luckperms.common.api.ApiHandler;
|
||||||
import me.lucko.luckperms.common.api.ApiProvider;
|
import me.lucko.luckperms.common.api.ApiProvider;
|
||||||
|
import me.lucko.luckperms.common.buffers.BufferedRequest;
|
||||||
import me.lucko.luckperms.common.caching.handlers.CachedStateManager;
|
import me.lucko.luckperms.common.caching.handlers.CachedStateManager;
|
||||||
import me.lucko.luckperms.common.calculators.CalculatorFactory;
|
import me.lucko.luckperms.common.calculators.CalculatorFactory;
|
||||||
import me.lucko.luckperms.common.commands.CommandManager;
|
import me.lucko.luckperms.common.commands.CommandManager;
|
||||||
@ -44,35 +47,34 @@ import me.lucko.luckperms.common.commands.sender.Sender;
|
|||||||
import me.lucko.luckperms.common.config.ConfigKeys;
|
import me.lucko.luckperms.common.config.ConfigKeys;
|
||||||
import me.lucko.luckperms.common.config.LuckPermsConfiguration;
|
import me.lucko.luckperms.common.config.LuckPermsConfiguration;
|
||||||
import me.lucko.luckperms.common.contexts.ContextManager;
|
import me.lucko.luckperms.common.contexts.ContextManager;
|
||||||
import me.lucko.luckperms.common.contexts.StaticCalculator;
|
import me.lucko.luckperms.common.contexts.LuckPermsCalculator;
|
||||||
import me.lucko.luckperms.common.core.UuidCache;
|
|
||||||
import me.lucko.luckperms.common.core.model.User;
|
|
||||||
import me.lucko.luckperms.common.dependencies.Dependency;
|
import me.lucko.luckperms.common.dependencies.Dependency;
|
||||||
import me.lucko.luckperms.common.dependencies.DependencyManager;
|
import me.lucko.luckperms.common.dependencies.DependencyManager;
|
||||||
import me.lucko.luckperms.common.locale.LocaleManager;
|
import me.lucko.luckperms.common.locale.LocaleManager;
|
||||||
import me.lucko.luckperms.common.locale.NoopLocaleManager;
|
import me.lucko.luckperms.common.locale.NoopLocaleManager;
|
||||||
import me.lucko.luckperms.common.locale.SimpleLocaleManager;
|
import me.lucko.luckperms.common.locale.SimpleLocaleManager;
|
||||||
|
import me.lucko.luckperms.common.logging.SenderLogger;
|
||||||
|
import me.lucko.luckperms.common.managers.GenericGroupManager;
|
||||||
|
import me.lucko.luckperms.common.managers.GenericTrackManager;
|
||||||
|
import me.lucko.luckperms.common.managers.GenericUserManager;
|
||||||
import me.lucko.luckperms.common.managers.GroupManager;
|
import me.lucko.luckperms.common.managers.GroupManager;
|
||||||
import me.lucko.luckperms.common.managers.TrackManager;
|
import me.lucko.luckperms.common.managers.TrackManager;
|
||||||
import me.lucko.luckperms.common.managers.UserManager;
|
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.InternalMessagingService;
|
import me.lucko.luckperms.common.messaging.InternalMessagingService;
|
||||||
import me.lucko.luckperms.common.messaging.NoopMessagingService;
|
import me.lucko.luckperms.common.messaging.NoopMessagingService;
|
||||||
import me.lucko.luckperms.common.messaging.RedisMessagingService;
|
import me.lucko.luckperms.common.messaging.RedisMessagingService;
|
||||||
|
import me.lucko.luckperms.common.model.User;
|
||||||
import me.lucko.luckperms.common.plugin.LuckPermsPlugin;
|
import me.lucko.luckperms.common.plugin.LuckPermsPlugin;
|
||||||
import me.lucko.luckperms.common.plugin.LuckPermsScheduler;
|
import me.lucko.luckperms.common.plugin.LuckPermsScheduler;
|
||||||
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.storage.StorageType;
|
import me.lucko.luckperms.common.storage.StorageType;
|
||||||
|
import me.lucko.luckperms.common.storage.backing.file.FileWatcher;
|
||||||
import me.lucko.luckperms.common.tasks.CacheHousekeepingTask;
|
import me.lucko.luckperms.common.tasks.CacheHousekeepingTask;
|
||||||
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.treeview.PermissionVault;
|
import me.lucko.luckperms.common.treeview.PermissionVault;
|
||||||
import me.lucko.luckperms.common.utils.BufferedRequest;
|
import me.lucko.luckperms.common.utils.UuidCache;
|
||||||
import me.lucko.luckperms.common.utils.FileWatcher;
|
|
||||||
import me.lucko.luckperms.common.utils.SenderLogger;
|
|
||||||
import me.lucko.luckperms.common.verbose.VerboseHandler;
|
import me.lucko.luckperms.common.verbose.VerboseHandler;
|
||||||
|
|
||||||
import net.md_5.bungee.api.connection.ProxiedPlayer;
|
import net.md_5.bungee.api.connection.ProxiedPlayer;
|
||||||
@ -230,7 +232,7 @@ public class LPBungeePlugin extends Plugin implements LuckPermsPlugin {
|
|||||||
groupManager = new GenericGroupManager(this);
|
groupManager = new GenericGroupManager(this);
|
||||||
trackManager = new GenericTrackManager(this);
|
trackManager = new GenericTrackManager(this);
|
||||||
calculatorFactory = new BungeeCalculatorFactory(this);
|
calculatorFactory = new BungeeCalculatorFactory(this);
|
||||||
cachedStateManager = new CachedStateManager(this);
|
cachedStateManager = new CachedStateManager();
|
||||||
|
|
||||||
contextManager = new ContextManager<ProxiedPlayer>() {
|
contextManager = new ContextManager<ProxiedPlayer>() {
|
||||||
@Override
|
@Override
|
||||||
@ -250,7 +252,7 @@ public class LPBungeePlugin extends Plugin implements LuckPermsPlugin {
|
|||||||
BackendServerCalculator serverCalculator = new BackendServerCalculator(this);
|
BackendServerCalculator serverCalculator = new BackendServerCalculator(this);
|
||||||
contextManager.registerCalculator(serverCalculator);
|
contextManager.registerCalculator(serverCalculator);
|
||||||
|
|
||||||
StaticCalculator<ProxiedPlayer> staticCalculator = new StaticCalculator<>(getConfiguration());
|
LuckPermsCalculator<ProxiedPlayer> staticCalculator = new LuckPermsCalculator<>(getConfiguration());
|
||||||
contextManager.registerCalculator(staticCalculator, true);
|
contextManager.registerCalculator(staticCalculator, true);
|
||||||
|
|
||||||
// register with the LP API
|
// register with the LP API
|
||||||
|
@ -23,21 +23,22 @@
|
|||||||
* SOFTWARE.
|
* SOFTWARE.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package me.lucko.luckperms.bungee;
|
package me.lucko.luckperms.bungee.calculators;
|
||||||
|
|
||||||
import lombok.AllArgsConstructor;
|
import lombok.AllArgsConstructor;
|
||||||
|
|
||||||
import com.google.common.collect.ImmutableList;
|
import com.google.common.collect.ImmutableList;
|
||||||
|
|
||||||
import me.lucko.luckperms.api.Contexts;
|
import me.lucko.luckperms.api.Contexts;
|
||||||
|
import me.lucko.luckperms.bungee.LPBungeePlugin;
|
||||||
import me.lucko.luckperms.common.calculators.AbstractCalculatorFactory;
|
import me.lucko.luckperms.common.calculators.AbstractCalculatorFactory;
|
||||||
import me.lucko.luckperms.common.calculators.PermissionCalculator;
|
import me.lucko.luckperms.common.calculators.PermissionCalculator;
|
||||||
import me.lucko.luckperms.common.calculators.PermissionProcessor;
|
|
||||||
import me.lucko.luckperms.common.calculators.processors.MapProcessor;
|
|
||||||
import me.lucko.luckperms.common.calculators.processors.RegexProcessor;
|
|
||||||
import me.lucko.luckperms.common.calculators.processors.WildcardProcessor;
|
|
||||||
import me.lucko.luckperms.common.config.ConfigKeys;
|
import me.lucko.luckperms.common.config.ConfigKeys;
|
||||||
import me.lucko.luckperms.common.core.model.User;
|
import me.lucko.luckperms.common.model.User;
|
||||||
|
import me.lucko.luckperms.common.processors.MapProcessor;
|
||||||
|
import me.lucko.luckperms.common.processors.PermissionProcessor;
|
||||||
|
import me.lucko.luckperms.common.processors.RegexProcessor;
|
||||||
|
import me.lucko.luckperms.common.processors.WildcardProcessor;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
@ -23,7 +23,7 @@
|
|||||||
* SOFTWARE.
|
* SOFTWARE.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package me.lucko.luckperms.bungee;
|
package me.lucko.luckperms.bungee.contexts;
|
||||||
|
|
||||||
import lombok.RequiredArgsConstructor;
|
import lombok.RequiredArgsConstructor;
|
||||||
|
|
@ -31,14 +31,14 @@ import me.lucko.luckperms.common.commands.CommandResult;
|
|||||||
import me.lucko.luckperms.common.commands.abstraction.SubCommand;
|
import me.lucko.luckperms.common.commands.abstraction.SubCommand;
|
||||||
import me.lucko.luckperms.common.commands.impl.migration.MigrationUtils;
|
import me.lucko.luckperms.common.commands.impl.migration.MigrationUtils;
|
||||||
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.CommandPermission;
|
||||||
import me.lucko.luckperms.common.core.NodeFactory;
|
|
||||||
import me.lucko.luckperms.common.core.model.PermissionHolder;
|
|
||||||
import me.lucko.luckperms.common.locale.CommandSpec;
|
import me.lucko.luckperms.common.locale.CommandSpec;
|
||||||
import me.lucko.luckperms.common.locale.LocaleManager;
|
import me.lucko.luckperms.common.locale.LocaleManager;
|
||||||
|
import me.lucko.luckperms.common.logging.ProgressLogger;
|
||||||
|
import me.lucko.luckperms.common.model.PermissionHolder;
|
||||||
|
import me.lucko.luckperms.common.node.NodeFactory;
|
||||||
import me.lucko.luckperms.common.plugin.LuckPermsPlugin;
|
import me.lucko.luckperms.common.plugin.LuckPermsPlugin;
|
||||||
import me.lucko.luckperms.common.utils.Predicates;
|
import me.lucko.luckperms.common.utils.Predicates;
|
||||||
import me.lucko.luckperms.common.utils.ProgressLogger;
|
|
||||||
|
|
||||||
import net.alpenblock.bungeeperms.BungeePerms;
|
import net.alpenblock.bungeeperms.BungeePerms;
|
||||||
import net.alpenblock.bungeeperms.Group;
|
import net.alpenblock.bungeeperms.Group;
|
||||||
@ -53,7 +53,7 @@ import java.util.concurrent.atomic.AtomicInteger;
|
|||||||
|
|
||||||
public class MigrationBungeePerms extends SubCommand<Object> {
|
public class MigrationBungeePerms extends SubCommand<Object> {
|
||||||
public MigrationBungeePerms(LocaleManager locale) {
|
public MigrationBungeePerms(LocaleManager locale) {
|
||||||
super(CommandSpec.MIGRATION_COMMAND.spec(locale), "bungeeperms", Permission.MIGRATION, Predicates.alwaysFalse());
|
super(CommandSpec.MIGRATION_COMMAND.spec(locale), "bungeeperms", CommandPermission.MIGRATION, Predicates.alwaysFalse());
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@ -89,7 +89,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
|
||||||
String groupName = MigrationUtils.standardizeName(g.getName());
|
String groupName = MigrationUtils.standardizeName(g.getName());
|
||||||
plugin.getStorage().createAndLoadGroup(groupName, CreationCause.INTERNAL).join();
|
plugin.getStorage().createAndLoadGroup(groupName, CreationCause.INTERNAL).join();
|
||||||
me.lucko.luckperms.common.core.model.Group group = plugin.getGroupManager().getIfLoaded(groupName);
|
me.lucko.luckperms.common.model.Group group = plugin.getGroupManager().getIfLoaded(groupName);
|
||||||
|
|
||||||
MigrationUtils.setGroupWeight(group, groupWeight);
|
MigrationUtils.setGroupWeight(group, groupWeight);
|
||||||
migrateHolder(g, g.getInheritances(), groupWeight, group);
|
migrateHolder(g, g.getInheritances(), groupWeight, group);
|
||||||
@ -114,7 +114,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(), u.getName()).join();
|
plugin.getStorage().loadUser(u.getUUID(), u.getName()).join();
|
||||||
me.lucko.luckperms.common.core.model.User user = plugin.getUserManager().getIfLoaded(u.getUUID());
|
me.lucko.luckperms.common.model.User user = plugin.getUserManager().getIfLoaded(u.getUUID());
|
||||||
|
|
||||||
migrateHolder(u, u.getGroupsString(), maxWeight, user);
|
migrateHolder(u, u.getGroupsString(), maxWeight, user);
|
||||||
|
|
||||||
|
@ -46,12 +46,12 @@ import me.lucko.luckperms.api.context.ContextSet;
|
|||||||
import me.lucko.luckperms.common.api.delegates.MetaStackFactoryDelegate;
|
import me.lucko.luckperms.common.api.delegates.MetaStackFactoryDelegate;
|
||||||
import me.lucko.luckperms.common.api.delegates.NodeFactoryDelegate;
|
import me.lucko.luckperms.common.api.delegates.NodeFactoryDelegate;
|
||||||
import me.lucko.luckperms.common.api.delegates.UserDelegate;
|
import me.lucko.luckperms.common.api.delegates.UserDelegate;
|
||||||
import me.lucko.luckperms.common.core.UserIdentifier;
|
|
||||||
import me.lucko.luckperms.common.event.EventFactory;
|
import me.lucko.luckperms.common.event.EventFactory;
|
||||||
import me.lucko.luckperms.common.event.LuckPermsEventBus;
|
import me.lucko.luckperms.common.event.LuckPermsEventBus;
|
||||||
import me.lucko.luckperms.common.messaging.InternalMessagingService;
|
import me.lucko.luckperms.common.messaging.InternalMessagingService;
|
||||||
import me.lucko.luckperms.common.messaging.NoopMessagingService;
|
import me.lucko.luckperms.common.messaging.NoopMessagingService;
|
||||||
import me.lucko.luckperms.common.plugin.LuckPermsPlugin;
|
import me.lucko.luckperms.common.plugin.LuckPermsPlugin;
|
||||||
|
import me.lucko.luckperms.common.references.UserIdentifier;
|
||||||
|
|
||||||
import java.util.Optional;
|
import java.util.Optional;
|
||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
@ -128,7 +128,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.core.model.User user = plugin.getUserManager().getIfLoaded(uuid);
|
final me.lucko.luckperms.common.model.User user = plugin.getUserManager().getIfLoaded(uuid);
|
||||||
return user == null ? null : user.getDelegate();
|
return user == null ? null : user.getDelegate();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -139,7 +139,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.core.model.User user = plugin.getUserManager().getByUsername(name);
|
final me.lucko.luckperms.common.model.User user = plugin.getUserManager().getByUsername(name);
|
||||||
return user == null ? null : user.getDelegate();
|
return user == null ? null : user.getDelegate();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -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.core.model.Group group = plugin.getGroupManager().getIfLoaded(name);
|
final me.lucko.luckperms.common.model.Group group = plugin.getGroupManager().getIfLoaded(name);
|
||||||
return group == null ? null : group.getDelegate();
|
return group == null ? null : group.getDelegate();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -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.core.model.Track track = plugin.getTrackManager().getIfLoaded(name);
|
final me.lucko.luckperms.common.model.Track track = plugin.getTrackManager().getIfLoaded(name);
|
||||||
return track == null ? null : track.getDelegate();
|
return track == null ? null : track.getDelegate();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -212,7 +212,7 @@ public class ApiProvider implements LuckPermsApi {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Node.Builder buildNode(@NonNull String permission) throws IllegalArgumentException {
|
public Node.Builder buildNode(@NonNull String permission) throws IllegalArgumentException {
|
||||||
return me.lucko.luckperms.common.core.NodeFactory.newBuilder(permission);
|
return me.lucko.luckperms.common.node.NodeFactory.newBuilder(permission);
|
||||||
}
|
}
|
||||||
|
|
||||||
@SuppressWarnings("unchecked")
|
@SuppressWarnings("unchecked")
|
||||||
|
@ -34,7 +34,7 @@ import com.google.common.base.Preconditions;
|
|||||||
import me.lucko.luckperms.api.Group;
|
import me.lucko.luckperms.api.Group;
|
||||||
import me.lucko.luckperms.api.Node;
|
import me.lucko.luckperms.api.Node;
|
||||||
import me.lucko.luckperms.api.context.ContextSet;
|
import me.lucko.luckperms.api.context.ContextSet;
|
||||||
import me.lucko.luckperms.common.core.NodeFactory;
|
import me.lucko.luckperms.common.node.NodeFactory;
|
||||||
import me.lucko.luckperms.exceptions.ObjectAlreadyHasException;
|
import me.lucko.luckperms.exceptions.ObjectAlreadyHasException;
|
||||||
import me.lucko.luckperms.exceptions.ObjectLacksException;
|
import me.lucko.luckperms.exceptions.ObjectLacksException;
|
||||||
|
|
||||||
@ -45,18 +45,18 @@ import java.util.stream.Collectors;
|
|||||||
import static me.lucko.luckperms.common.api.ApiUtils.checkTime;
|
import static me.lucko.luckperms.common.api.ApiUtils.checkTime;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Provides a link between {@link Group} and {@link me.lucko.luckperms.common.core.model.Group}
|
* Provides a link between {@link Group} and {@link me.lucko.luckperms.common.model.Group}
|
||||||
*/
|
*/
|
||||||
public final class GroupDelegate extends PermissionHolderDelegate implements Group {
|
public final class GroupDelegate extends PermissionHolderDelegate implements Group {
|
||||||
public static me.lucko.luckperms.common.core.model.Group cast(Group g) {
|
public static me.lucko.luckperms.common.model.Group cast(Group g) {
|
||||||
Preconditions.checkState(g instanceof GroupDelegate, "Illegal instance " + g.getClass() + " cannot be handled by this implementation.");
|
Preconditions.checkState(g instanceof GroupDelegate, "Illegal instance " + g.getClass() + " cannot be handled by this implementation.");
|
||||||
return ((GroupDelegate) g).getHandle();
|
return ((GroupDelegate) g).getHandle();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Getter(AccessLevel.PACKAGE)
|
@Getter(AccessLevel.PACKAGE)
|
||||||
private final me.lucko.luckperms.common.core.model.Group handle;
|
private final me.lucko.luckperms.common.model.Group handle;
|
||||||
|
|
||||||
public GroupDelegate(@NonNull me.lucko.luckperms.common.core.model.Group handle) {
|
public GroupDelegate(@NonNull me.lucko.luckperms.common.model.Group handle) {
|
||||||
super(handle);
|
super(handle);
|
||||||
this.handle = handle;
|
this.handle = handle;
|
||||||
}
|
}
|
||||||
|
@ -30,7 +30,7 @@ import lombok.NonNull;
|
|||||||
import me.lucko.luckperms.api.ChatMetaType;
|
import me.lucko.luckperms.api.ChatMetaType;
|
||||||
import me.lucko.luckperms.api.Group;
|
import me.lucko.luckperms.api.Group;
|
||||||
import me.lucko.luckperms.api.Node;
|
import me.lucko.luckperms.api.Node;
|
||||||
import me.lucko.luckperms.common.core.NodeFactory;
|
import me.lucko.luckperms.common.node.NodeFactory;
|
||||||
|
|
||||||
public class NodeFactoryDelegate implements me.lucko.luckperms.api.NodeFactory {
|
public class NodeFactoryDelegate implements me.lucko.luckperms.api.NodeFactory {
|
||||||
public static final NodeFactoryDelegate INSTANCE = new NodeFactoryDelegate();
|
public static final NodeFactoryDelegate INSTANCE = new NodeFactoryDelegate();
|
||||||
|
@ -39,9 +39,9 @@ import me.lucko.luckperms.api.PermissionHolder;
|
|||||||
import me.lucko.luckperms.api.Tristate;
|
import me.lucko.luckperms.api.Tristate;
|
||||||
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.core.NodeFactory;
|
import me.lucko.luckperms.common.contexts.ExtractedContexts;
|
||||||
import me.lucko.luckperms.common.core.model.User;
|
import me.lucko.luckperms.common.model.User;
|
||||||
import me.lucko.luckperms.common.utils.ExtractedContexts;
|
import me.lucko.luckperms.common.node.NodeFactory;
|
||||||
import me.lucko.luckperms.exceptions.ObjectAlreadyHasException;
|
import me.lucko.luckperms.exceptions.ObjectAlreadyHasException;
|
||||||
import me.lucko.luckperms.exceptions.ObjectLacksException;
|
import me.lucko.luckperms.exceptions.ObjectLacksException;
|
||||||
|
|
||||||
@ -56,11 +56,11 @@ import java.util.function.Predicate;
|
|||||||
import static me.lucko.luckperms.common.api.ApiUtils.checkTime;
|
import static me.lucko.luckperms.common.api.ApiUtils.checkTime;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Provides a link between {@link PermissionHolder} and {@link me.lucko.luckperms.common.core.model.PermissionHolder}
|
* Provides a link between {@link PermissionHolder} and {@link me.lucko.luckperms.common.model.PermissionHolder}
|
||||||
*/
|
*/
|
||||||
@AllArgsConstructor
|
@AllArgsConstructor
|
||||||
public class PermissionHolderDelegate implements PermissionHolder {
|
public class PermissionHolderDelegate implements PermissionHolder {
|
||||||
private final me.lucko.luckperms.common.core.model.PermissionHolder handle;
|
private final me.lucko.luckperms.common.model.PermissionHolder handle;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getObjectName() {
|
public String getObjectName() {
|
||||||
|
@ -40,17 +40,17 @@ import me.lucko.luckperms.exceptions.ObjectLacksException;
|
|||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Provides a link between {@link Track} and {@link me.lucko.luckperms.common.core.model.Track}
|
* Provides a link between {@link Track} and {@link me.lucko.luckperms.common.model.Track}
|
||||||
*/
|
*/
|
||||||
@AllArgsConstructor
|
@AllArgsConstructor
|
||||||
public final class TrackDelegate implements Track {
|
public final class TrackDelegate implements Track {
|
||||||
public static me.lucko.luckperms.common.core.model.Track cast(Track g) {
|
public static me.lucko.luckperms.common.model.Track cast(Track g) {
|
||||||
Preconditions.checkState(g instanceof TrackDelegate, "Illegal instance " + g.getClass() + " cannot be handled by this implementation.");
|
Preconditions.checkState(g instanceof TrackDelegate, "Illegal instance " + g.getClass() + " cannot be handled by this implementation.");
|
||||||
return ((TrackDelegate) g).getHandle();
|
return ((TrackDelegate) g).getHandle();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Getter(AccessLevel.PACKAGE)
|
@Getter(AccessLevel.PACKAGE)
|
||||||
private final me.lucko.luckperms.common.core.model.Track handle;
|
private final me.lucko.luckperms.common.model.Track handle;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getName() {
|
public String getName() {
|
||||||
|
@ -35,7 +35,7 @@ import me.lucko.luckperms.api.Node;
|
|||||||
import me.lucko.luckperms.api.User;
|
import me.lucko.luckperms.api.User;
|
||||||
import me.lucko.luckperms.api.caching.UserData;
|
import me.lucko.luckperms.api.caching.UserData;
|
||||||
import me.lucko.luckperms.api.context.ContextSet;
|
import me.lucko.luckperms.api.context.ContextSet;
|
||||||
import me.lucko.luckperms.common.core.NodeFactory;
|
import me.lucko.luckperms.common.node.NodeFactory;
|
||||||
import me.lucko.luckperms.exceptions.ObjectAlreadyHasException;
|
import me.lucko.luckperms.exceptions.ObjectAlreadyHasException;
|
||||||
import me.lucko.luckperms.exceptions.ObjectLacksException;
|
import me.lucko.luckperms.exceptions.ObjectLacksException;
|
||||||
|
|
||||||
@ -47,18 +47,18 @@ import java.util.stream.Collectors;
|
|||||||
import static me.lucko.luckperms.common.api.ApiUtils.checkTime;
|
import static me.lucko.luckperms.common.api.ApiUtils.checkTime;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Provides a link between {@link User} and {@link me.lucko.luckperms.common.core.model.User}
|
* Provides a link between {@link User} and {@link me.lucko.luckperms.common.model.User}
|
||||||
*/
|
*/
|
||||||
public final class UserDelegate extends PermissionHolderDelegate implements User {
|
public final class UserDelegate extends PermissionHolderDelegate implements User {
|
||||||
public static me.lucko.luckperms.common.core.model.User cast(User u) {
|
public static me.lucko.luckperms.common.model.User cast(User u) {
|
||||||
Preconditions.checkState(u instanceof UserDelegate, "Illegal instance " + u.getClass() + " cannot be handled by this implementation.");
|
Preconditions.checkState(u instanceof UserDelegate, "Illegal instance " + u.getClass() + " cannot be handled by this implementation.");
|
||||||
return ((UserDelegate) u).getHandle();
|
return ((UserDelegate) u).getHandle();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Getter
|
@Getter
|
||||||
private final me.lucko.luckperms.common.core.model.User handle;
|
private final me.lucko.luckperms.common.model.User handle;
|
||||||
|
|
||||||
public UserDelegate(@NonNull me.lucko.luckperms.common.core.model.User handle) {
|
public UserDelegate(@NonNull me.lucko.luckperms.common.model.User handle) {
|
||||||
super(handle);
|
super(handle);
|
||||||
this.handle = handle;
|
this.handle = handle;
|
||||||
}
|
}
|
||||||
|
@ -33,11 +33,11 @@ import me.lucko.luckperms.api.UuidCache;
|
|||||||
import java.util.UUID;
|
import java.util.UUID;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Provides a link between {@link UuidCache} and {@link me.lucko.luckperms.common.core.UuidCache}
|
* Provides a link between {@link UuidCache} and {@link me.lucko.luckperms.common.utils.UuidCache}
|
||||||
*/
|
*/
|
||||||
@AllArgsConstructor
|
@AllArgsConstructor
|
||||||
public class UuidCacheDelegate implements UuidCache {
|
public class UuidCacheDelegate implements UuidCache {
|
||||||
private final me.lucko.luckperms.common.core.UuidCache handle;
|
private final me.lucko.luckperms.common.utils.UuidCache handle;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public UUID getUUID(@NonNull UUID external) {
|
public UUID getUUID(@NonNull UUID external) {
|
||||||
|
@ -23,7 +23,7 @@
|
|||||||
* SOFTWARE.
|
* SOFTWARE.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package me.lucko.luckperms.common.utils;
|
package me.lucko.luckperms.common.buffers;
|
||||||
|
|
||||||
import lombok.AllArgsConstructor;
|
import lombok.AllArgsConstructor;
|
||||||
import lombok.EqualsAndHashCode;
|
import lombok.EqualsAndHashCode;
|
@ -23,7 +23,7 @@
|
|||||||
* SOFTWARE.
|
* SOFTWARE.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package me.lucko.luckperms.common.utils;
|
package me.lucko.luckperms.common.buffers;
|
||||||
|
|
||||||
import lombok.Getter;
|
import lombok.Getter;
|
||||||
import lombok.RequiredArgsConstructor;
|
import lombok.RequiredArgsConstructor;
|
@ -23,7 +23,7 @@
|
|||||||
* SOFTWARE.
|
* SOFTWARE.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package me.lucko.luckperms.common.utils;
|
package me.lucko.luckperms.common.buffers;
|
||||||
|
|
||||||
import lombok.RequiredArgsConstructor;
|
import lombok.RequiredArgsConstructor;
|
||||||
|
|
@ -32,7 +32,7 @@ import lombok.ToString;
|
|||||||
|
|
||||||
import me.lucko.luckperms.common.bulkupdate.action.Action;
|
import me.lucko.luckperms.common.bulkupdate.action.Action;
|
||||||
import me.lucko.luckperms.common.bulkupdate.constraint.Constraint;
|
import me.lucko.luckperms.common.bulkupdate.constraint.Constraint;
|
||||||
import me.lucko.luckperms.common.core.NodeModel;
|
import me.lucko.luckperms.common.node.NodeModel;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
|
@ -25,10 +25,18 @@
|
|||||||
|
|
||||||
package me.lucko.luckperms.common.bulkupdate.action;
|
package me.lucko.luckperms.common.bulkupdate.action;
|
||||||
|
|
||||||
import me.lucko.luckperms.common.core.NodeModel;
|
import me.lucko.luckperms.common.node.NodeModel;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Represents an action to be applied to a given node.
|
||||||
|
*/
|
||||||
public interface Action {
|
public interface Action {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Gets the name of this action
|
||||||
|
*
|
||||||
|
* @return the name of the action
|
||||||
|
*/
|
||||||
String getName();
|
String getName();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -39,6 +47,13 @@ public interface Action {
|
|||||||
*/
|
*/
|
||||||
NodeModel apply(NodeModel from);
|
NodeModel apply(NodeModel from);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Gets this action in SQL form.
|
||||||
|
*
|
||||||
|
* Will include a placeholder for the table, as "{table}".
|
||||||
|
*
|
||||||
|
* @return the action in sql form
|
||||||
|
*/
|
||||||
String getAsSql();
|
String getAsSql();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -27,7 +27,7 @@ package me.lucko.luckperms.common.bulkupdate.action;
|
|||||||
|
|
||||||
import lombok.AllArgsConstructor;
|
import lombok.AllArgsConstructor;
|
||||||
|
|
||||||
import me.lucko.luckperms.common.core.NodeModel;
|
import me.lucko.luckperms.common.node.NodeModel;
|
||||||
|
|
||||||
@AllArgsConstructor(staticName = "create")
|
@AllArgsConstructor(staticName = "create")
|
||||||
public class DeleteAction implements Action {
|
public class DeleteAction implements Action {
|
||||||
@ -39,7 +39,7 @@ public class DeleteAction implements Action {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public NodeModel apply(NodeModel from) {
|
public NodeModel apply(NodeModel from) {
|
||||||
return null;
|
return null; // this action just deletes nodes, so return null
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -29,12 +29,15 @@ import lombok.AllArgsConstructor;
|
|||||||
|
|
||||||
import me.lucko.luckperms.common.bulkupdate.BulkUpdate;
|
import me.lucko.luckperms.common.bulkupdate.BulkUpdate;
|
||||||
import me.lucko.luckperms.common.bulkupdate.constraint.QueryField;
|
import me.lucko.luckperms.common.bulkupdate.constraint.QueryField;
|
||||||
import me.lucko.luckperms.common.core.NodeModel;
|
import me.lucko.luckperms.common.node.NodeModel;
|
||||||
|
|
||||||
@AllArgsConstructor(staticName = "of")
|
@AllArgsConstructor(staticName = "of")
|
||||||
public class UpdateAction implements Action {
|
public class UpdateAction implements Action {
|
||||||
|
|
||||||
|
// the field we're updating
|
||||||
private final QueryField field;
|
private final QueryField field;
|
||||||
|
|
||||||
|
// the new value of the field
|
||||||
private final String value;
|
private final String value;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -25,10 +25,26 @@
|
|||||||
|
|
||||||
package me.lucko.luckperms.common.bulkupdate.comparisons;
|
package me.lucko.luckperms.common.bulkupdate.comparisons;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* A method of comparing two strings
|
||||||
|
*/
|
||||||
public interface Comparison {
|
public interface Comparison {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Gets the symbol which represents this comparison
|
||||||
|
*
|
||||||
|
* @return the comparison symbol
|
||||||
|
*/
|
||||||
String getSymbol();
|
String getSymbol();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Compares two strings according to this comparisons
|
||||||
|
* behaviour, and returns if they match.
|
||||||
|
*
|
||||||
|
* @param str the string
|
||||||
|
* @param expr the expression
|
||||||
|
* @return if the string matches the expression
|
||||||
|
*/
|
||||||
boolean matches(String str, String expr);
|
boolean matches(String str, String expr);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -32,6 +32,9 @@ import me.lucko.luckperms.common.bulkupdate.comparisons.impl.ComparisonNotEqual;
|
|||||||
import me.lucko.luckperms.common.bulkupdate.comparisons.impl.ComparisonNotSimilar;
|
import me.lucko.luckperms.common.bulkupdate.comparisons.impl.ComparisonNotSimilar;
|
||||||
import me.lucko.luckperms.common.bulkupdate.comparisons.impl.ComparisonSimilar;
|
import me.lucko.luckperms.common.bulkupdate.comparisons.impl.ComparisonSimilar;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* An enumeration of all {@link Comparison}s.
|
||||||
|
*/
|
||||||
@AllArgsConstructor
|
@AllArgsConstructor
|
||||||
public enum ComparisonType {
|
public enum ComparisonType {
|
||||||
|
|
||||||
@ -47,7 +50,7 @@ public enum ComparisonType {
|
|||||||
return symbol;
|
return symbol;
|
||||||
}
|
}
|
||||||
|
|
||||||
public Comparison get() {
|
public Comparison getComparison() {
|
||||||
return instance;
|
return instance;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -38,4 +38,5 @@ public class ComparisonNotEqual implements Comparison {
|
|||||||
public boolean matches(String str, String expr) {
|
public boolean matches(String str, String expr) {
|
||||||
return !str.equalsIgnoreCase(expr);
|
return !str.equalsIgnoreCase(expr);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -46,4 +46,5 @@ public class ComparisonNotSimilar implements Comparison {
|
|||||||
|
|
||||||
return !str.toLowerCase().matches(expr);
|
return !str.toLowerCase().matches(expr);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -28,6 +28,7 @@ package me.lucko.luckperms.common.bulkupdate.comparisons.impl;
|
|||||||
import me.lucko.luckperms.common.bulkupdate.comparisons.Comparison;
|
import me.lucko.luckperms.common.bulkupdate.comparisons.Comparison;
|
||||||
|
|
||||||
public class ComparisonSimilar implements Comparison {
|
public class ComparisonSimilar implements Comparison {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getSymbol() {
|
public String getSymbol() {
|
||||||
return "~~";
|
return "~~";
|
||||||
@ -45,4 +46,5 @@ public class ComparisonSimilar implements Comparison {
|
|||||||
|
|
||||||
return str.toLowerCase().matches(expr);
|
return str.toLowerCase().matches(expr);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -30,7 +30,7 @@ import lombok.Getter;
|
|||||||
|
|
||||||
import me.lucko.luckperms.common.bulkupdate.BulkUpdate;
|
import me.lucko.luckperms.common.bulkupdate.BulkUpdate;
|
||||||
import me.lucko.luckperms.common.bulkupdate.comparisons.ComparisonType;
|
import me.lucko.luckperms.common.bulkupdate.comparisons.ComparisonType;
|
||||||
import me.lucko.luckperms.common.core.NodeModel;
|
import me.lucko.luckperms.common.node.NodeModel;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Represents a query constraint
|
* Represents a query constraint
|
||||||
@ -43,7 +43,7 @@ public class Constraint {
|
|||||||
private final QueryField field;
|
private final QueryField field;
|
||||||
|
|
||||||
// the comparison type being used in this constraint
|
// the comparison type being used in this constraint
|
||||||
private final ComparisonType comparison;
|
private final ComparisonType comparisonType;
|
||||||
|
|
||||||
// the expression being compared against
|
// the expression being compared against
|
||||||
private final String value;
|
private final String value;
|
||||||
@ -57,23 +57,18 @@ public class Constraint {
|
|||||||
public boolean isSatisfiedBy(NodeModel node) {
|
public boolean isSatisfiedBy(NodeModel node) {
|
||||||
switch (field) {
|
switch (field) {
|
||||||
case PERMISSION:
|
case PERMISSION:
|
||||||
return comparison.get().matches(node.getPermission(), value);
|
return comparisonType.getComparison().matches(node.getPermission(), value);
|
||||||
case SERVER:
|
case SERVER:
|
||||||
return comparison.get().matches(node.getServer(), value);
|
return comparisonType.getComparison().matches(node.getServer(), value);
|
||||||
case WORLD:
|
case WORLD:
|
||||||
return comparison.get().matches(node.getWorld(), value);
|
return comparisonType.getComparison().matches(node.getWorld(), value);
|
||||||
default:
|
default:
|
||||||
throw new RuntimeException();
|
throw new RuntimeException();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getAsSql() {
|
public String getAsSql() {
|
||||||
// WHERE permission = "thing"
|
switch (comparisonType) {
|
||||||
// WHERE permission != ""
|
|
||||||
// WHERE permission LIKE ""
|
|
||||||
// WHERE permission NOT LIKE ""
|
|
||||||
|
|
||||||
switch (comparison) {
|
|
||||||
case EQUAL:
|
case EQUAL:
|
||||||
return field.getSqlName() + " = " + BulkUpdate.escapeStringForSql(value);
|
return field.getSqlName() + " = " + BulkUpdate.escapeStringForSql(value);
|
||||||
case NOT_EQUAL:
|
case NOT_EQUAL:
|
||||||
|
@ -27,15 +27,14 @@ package me.lucko.luckperms.common.caching;
|
|||||||
|
|
||||||
import lombok.NonNull;
|
import lombok.NonNull;
|
||||||
|
|
||||||
import com.google.common.collect.ImmutableMap;
|
|
||||||
|
|
||||||
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.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.core.model.User;
|
import me.lucko.luckperms.common.model.User;
|
||||||
|
|
||||||
|
import java.util.Collections;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
import java.util.concurrent.ConcurrentHashMap;
|
import java.util.concurrent.ConcurrentHashMap;
|
||||||
|
|
||||||
@ -49,6 +48,11 @@ public class PermissionCache implements PermissionData {
|
|||||||
*/
|
*/
|
||||||
private final Map<String, Boolean> permissions;
|
private final Map<String, Boolean> permissions;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* An immutable copy of {@link #permissions}
|
||||||
|
*/
|
||||||
|
private final Map<String, Boolean> permissionsUnmodifiable;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The calculator instance responsible for resolving the raw permission strings in the permission map.
|
* The calculator instance responsible for resolving the raw permission strings in the permission map.
|
||||||
* This calculator will attempt to resolve all regex/wildcard permissions, as well as account for
|
* This calculator will attempt to resolve all regex/wildcard permissions, as well as account for
|
||||||
@ -58,6 +62,8 @@ public class PermissionCache implements PermissionData {
|
|||||||
|
|
||||||
public PermissionCache(Contexts contexts, User user, CalculatorFactory calculatorFactory) {
|
public PermissionCache(Contexts contexts, User user, CalculatorFactory calculatorFactory) {
|
||||||
permissions = new ConcurrentHashMap<>();
|
permissions = new ConcurrentHashMap<>();
|
||||||
|
permissionsUnmodifiable = Collections.unmodifiableMap(permissions);
|
||||||
|
|
||||||
calculator = calculatorFactory.build(contexts, user);
|
calculator = calculatorFactory.build(contexts, user);
|
||||||
calculator.updateBacking(permissions); // Initial setup.
|
calculator.updateBacking(permissions); // Initial setup.
|
||||||
}
|
}
|
||||||
@ -82,7 +88,7 @@ public class PermissionCache implements PermissionData {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Map<String, Boolean> getImmutableBacking() {
|
public Map<String, Boolean> getImmutableBacking() {
|
||||||
return ImmutableMap.copyOf(permissions);
|
return permissionsUnmodifiable;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -40,10 +40,10 @@ 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.config.ConfigKeys;
|
import me.lucko.luckperms.common.config.ConfigKeys;
|
||||||
import me.lucko.luckperms.common.core.model.User;
|
import me.lucko.luckperms.common.contexts.ExtractedContexts;
|
||||||
import me.lucko.luckperms.common.metastacking.GenericMetaStack;
|
import me.lucko.luckperms.common.metastacking.GenericMetaStack;
|
||||||
|
import me.lucko.luckperms.common.model.User;
|
||||||
import me.lucko.luckperms.common.plugin.LuckPermsPlugin;
|
import me.lucko.luckperms.common.plugin.LuckPermsPlugin;
|
||||||
import me.lucko.luckperms.common.utils.ExtractedContexts;
|
|
||||||
|
|
||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
import java.util.concurrent.TimeUnit;
|
import java.util.concurrent.TimeUnit;
|
||||||
|
@ -25,12 +25,10 @@
|
|||||||
|
|
||||||
package me.lucko.luckperms.common.caching.handlers;
|
package me.lucko.luckperms.common.caching.handlers;
|
||||||
|
|
||||||
import lombok.RequiredArgsConstructor;
|
|
||||||
|
|
||||||
import com.google.common.collect.HashMultimap;
|
import com.google.common.collect.HashMultimap;
|
||||||
import com.google.common.collect.Multimap;
|
import com.google.common.collect.Multimap;
|
||||||
|
|
||||||
import me.lucko.luckperms.common.plugin.LuckPermsPlugin;
|
import me.lucko.luckperms.common.references.HolderReference;
|
||||||
|
|
||||||
import java.util.HashSet;
|
import java.util.HashSet;
|
||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
@ -39,11 +37,7 @@ import java.util.concurrent.locks.ReentrantLock;
|
|||||||
/**
|
/**
|
||||||
* Manages the cached state of all permission holders
|
* Manages the cached state of all permission holders
|
||||||
*/
|
*/
|
||||||
@RequiredArgsConstructor
|
|
||||||
public class CachedStateManager {
|
public class CachedStateManager {
|
||||||
// private static final Consumer<PermissionHolder> INVALIDATE_CONSUMER = PermissionHolder::invalidateInheritanceCaches;
|
|
||||||
|
|
||||||
private final LuckPermsPlugin plugin;
|
|
||||||
|
|
||||||
// Group --> Groups/Users that inherit from that group. (reverse relationship)
|
// Group --> Groups/Users that inherit from that group. (reverse relationship)
|
||||||
private final Multimap<HolderReference, HolderReference> map = HashMultimap.create();
|
private final Multimap<HolderReference, HolderReference> map = HashMultimap.create();
|
||||||
@ -118,15 +112,4 @@ public class CachedStateManager {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
|
||||||
public void invalidateInheritances(HolderReference holder) {
|
|
||||||
Set<HolderReference> toInvalidate = getInheritances(holder);
|
|
||||||
invalidateInheritances(plugin, toInvalidate);
|
|
||||||
}
|
|
||||||
|
|
||||||
public static void invalidateInheritances(LuckPermsPlugin plugin, Set<HolderReference> references) {
|
|
||||||
references.forEach(hr -> hr.apply(plugin, INVALIDATE_CONSUMER));
|
|
||||||
}
|
|
||||||
*/
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -26,7 +26,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.core.model.User;
|
import me.lucko.luckperms.common.model.User;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
|
@ -32,6 +32,7 @@ import com.github.benmanes.caffeine.cache.LoadingCache;
|
|||||||
|
|
||||||
import me.lucko.luckperms.api.Tristate;
|
import me.lucko.luckperms.api.Tristate;
|
||||||
import me.lucko.luckperms.common.plugin.LuckPermsPlugin;
|
import me.lucko.luckperms.common.plugin.LuckPermsPlugin;
|
||||||
|
import me.lucko.luckperms.common.processors.PermissionProcessor;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
@ -45,28 +46,44 @@ public class PermissionCalculator {
|
|||||||
private final String objectName;
|
private final String objectName;
|
||||||
private final List<PermissionProcessor> processors;
|
private final List<PermissionProcessor> processors;
|
||||||
|
|
||||||
private final LoadingCache<String, Tristate> cache = Caffeine.newBuilder().build(this::lookupPermissionValue);
|
// caches lookup calls.
|
||||||
|
private final LoadingCache<String, Tristate> lookupCache = Caffeine.newBuilder()
|
||||||
|
.build(this::lookupPermissionValue);
|
||||||
|
|
||||||
public void invalidateCache() {
|
public void invalidateCache() {
|
||||||
cache.invalidateAll();
|
lookupCache.invalidateAll();
|
||||||
}
|
}
|
||||||
|
|
||||||
public Tristate getPermissionValue(String permission) {
|
public Tristate getPermissionValue(String permission) {
|
||||||
|
|
||||||
|
// convert the permission to lowercase, as all values in the backing map are also lowercase.
|
||||||
|
// this allows fast case insensitive lookups
|
||||||
permission = permission.toLowerCase();
|
permission = permission.toLowerCase();
|
||||||
Tristate t = cache.get(permission);
|
|
||||||
plugin.getVerboseHandler().offer(objectName, permission, t);
|
// get the result
|
||||||
plugin.getPermissionVault().offer(permission);
|
Tristate result = lookupCache.get(permission);
|
||||||
return t;
|
|
||||||
|
// log this permission lookup to the verbose handler
|
||||||
|
plugin.getVerboseHandler().offer(objectName, permission, result);
|
||||||
|
|
||||||
|
// return the result
|
||||||
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
private Tristate lookupPermissionValue(String permission) {
|
private Tristate lookupPermissionValue(String permission) {
|
||||||
|
|
||||||
|
// offer the permission to the permission vault
|
||||||
|
// we only need to do this once per permission, so it doesn't matter
|
||||||
|
// that this call is behind the cache.
|
||||||
|
plugin.getPermissionVault().offer(permission);
|
||||||
|
|
||||||
for (PermissionProcessor processor : processors) {
|
for (PermissionProcessor processor : processors) {
|
||||||
Tristate v = processor.hasPermission(permission);
|
Tristate result = processor.hasPermission(permission);
|
||||||
if (v == Tristate.UNDEFINED) {
|
if (result == Tristate.UNDEFINED) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
return v;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
return Tristate.UNDEFINED;
|
return Tristate.UNDEFINED;
|
||||||
|
@ -31,10 +31,10 @@ import me.lucko.luckperms.api.Tristate;
|
|||||||
import me.lucko.luckperms.api.context.ContextSet;
|
import me.lucko.luckperms.api.context.ContextSet;
|
||||||
import me.lucko.luckperms.common.commands.sender.Sender;
|
import me.lucko.luckperms.common.commands.sender.Sender;
|
||||||
import me.lucko.luckperms.common.config.ConfigKeys;
|
import me.lucko.luckperms.common.config.ConfigKeys;
|
||||||
import me.lucko.luckperms.common.constants.Permission;
|
import me.lucko.luckperms.common.constants.CommandPermission;
|
||||||
import me.lucko.luckperms.common.core.model.Group;
|
import me.lucko.luckperms.common.model.Group;
|
||||||
import me.lucko.luckperms.common.core.model.Track;
|
import me.lucko.luckperms.common.model.Track;
|
||||||
import me.lucko.luckperms.common.core.model.User;
|
import me.lucko.luckperms.common.model.User;
|
||||||
import me.lucko.luckperms.common.plugin.LuckPermsPlugin;
|
import me.lucko.luckperms.common.plugin.LuckPermsPlugin;
|
||||||
|
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
@ -43,20 +43,20 @@ import java.util.function.Function;
|
|||||||
|
|
||||||
@UtilityClass
|
@UtilityClass
|
||||||
public class ArgumentPermissions {
|
public class ArgumentPermissions {
|
||||||
private static final String USER_MODIFY_SELF = Permission.ROOT + "modify.user.self";
|
private static final String USER_MODIFY_SELF = CommandPermission.ROOT + "modify.user.self";
|
||||||
private static final String USER_MODIFY_OTHERS = Permission.ROOT + "modify.user.others";
|
private static final String USER_MODIFY_OTHERS = CommandPermission.ROOT + "modify.user.others";
|
||||||
private static final Function<String, String> GROUP_MODIFY = s -> Permission.ROOT + "modify.group." + s;
|
private static final Function<String, String> GROUP_MODIFY = s -> CommandPermission.ROOT + "modify.group." + s;
|
||||||
private static final Function<String, String> TRACK_MODIFY = s -> Permission.ROOT + "modify.track." + s;
|
private static final Function<String, String> TRACK_MODIFY = s -> CommandPermission.ROOT + "modify.track." + s;
|
||||||
|
|
||||||
private static final String USER_VIEW_SELF = Permission.ROOT + "view.user.self";
|
private static final String USER_VIEW_SELF = CommandPermission.ROOT + "view.user.self";
|
||||||
private static final String USER_VIEW_OTHERS = Permission.ROOT + "view.user.others";
|
private static final String USER_VIEW_OTHERS = CommandPermission.ROOT + "view.user.others";
|
||||||
private static final Function<String, String> GROUP_VIEW = s -> Permission.ROOT + "view.group." + s;
|
private static final Function<String, String> GROUP_VIEW = s -> CommandPermission.ROOT + "view.group." + s;
|
||||||
private static final Function<String, String> TRACK_VIEW = s -> Permission.ROOT + "view.track." + s;
|
private static final Function<String, String> TRACK_VIEW = s -> CommandPermission.ROOT + "view.track." + s;
|
||||||
|
|
||||||
private static final String CONTEXT_USE_GLOBAL = Permission.ROOT + "usecontext.global";
|
private static final String CONTEXT_USE_GLOBAL = CommandPermission.ROOT + "usecontext.global";
|
||||||
private static final BiFunction<String, String, String> CONTEXT_USE = (k, v) -> Permission.ROOT + "usecontext." + k + "." + v;
|
private static final BiFunction<String, String, String> CONTEXT_USE = (k, v) -> CommandPermission.ROOT + "usecontext." + k + "." + v;
|
||||||
|
|
||||||
public static boolean checkArguments(LuckPermsPlugin plugin, Sender sender, Permission base, String... args) {
|
public static boolean checkArguments(LuckPermsPlugin plugin, Sender sender, CommandPermission base, String... args) {
|
||||||
if (!plugin.getConfiguration().get(ConfigKeys.USE_ARGUMENT_BASED_COMMAND_PERMISSIONS)) {
|
if (!plugin.getConfiguration().get(ConfigKeys.USE_ARGUMENT_BASED_COMMAND_PERMISSIONS)) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
@ -65,7 +65,7 @@ public class ArgumentPermissions {
|
|||||||
throw new IllegalStateException();
|
throw new IllegalStateException();
|
||||||
}
|
}
|
||||||
|
|
||||||
StringBuilder permission = new StringBuilder(base.getPrimaryPermission());
|
StringBuilder permission = new StringBuilder(base.getPermission());
|
||||||
for (String arg : args) {
|
for (String arg : args) {
|
||||||
permission.append(".").append(arg);
|
permission.append(".").append(arg);
|
||||||
}
|
}
|
||||||
@ -73,7 +73,7 @@ public class ArgumentPermissions {
|
|||||||
return !sender.hasPermission(permission.toString());
|
return !sender.hasPermission(permission.toString());
|
||||||
}
|
}
|
||||||
|
|
||||||
public static boolean checkModifyPerms(LuckPermsPlugin plugin, Sender sender, Permission base, Object target) {
|
public static boolean checkModifyPerms(LuckPermsPlugin plugin, Sender sender, CommandPermission base, Object target) {
|
||||||
if (!plugin.getConfiguration().get(ConfigKeys.USE_ARGUMENT_BASED_COMMAND_PERMISSIONS)) {
|
if (!plugin.getConfiguration().get(ConfigKeys.USE_ARGUMENT_BASED_COMMAND_PERMISSIONS)) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
@ -83,7 +83,7 @@ public class ArgumentPermissions {
|
|||||||
|
|
||||||
if (plugin.getUuidCache().getExternalUUID(targetUser.getUuid()).equals(sender.getUuid())) {
|
if (plugin.getUuidCache().getExternalUUID(targetUser.getUuid()).equals(sender.getUuid())) {
|
||||||
// the sender is trying to edit themselves
|
// the sender is trying to edit themselves
|
||||||
Tristate ret = sender.getPermissionValue(base.getPrimaryPermission() + ".modify.self");
|
Tristate ret = sender.getPermissionValue(base.getPermission() + ".modify.self");
|
||||||
if (ret != Tristate.UNDEFINED) {
|
if (ret != Tristate.UNDEFINED) {
|
||||||
return !ret.asBoolean();
|
return !ret.asBoolean();
|
||||||
} else {
|
} else {
|
||||||
@ -93,7 +93,7 @@ public class ArgumentPermissions {
|
|||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
// they're trying to edit another user
|
// they're trying to edit another user
|
||||||
Tristate ret = sender.getPermissionValue(base.getPrimaryPermission() + ".modify.others");
|
Tristate ret = sender.getPermissionValue(base.getPermission() + ".modify.others");
|
||||||
if (ret != Tristate.UNDEFINED) {
|
if (ret != Tristate.UNDEFINED) {
|
||||||
return !ret.asBoolean();
|
return !ret.asBoolean();
|
||||||
} else {
|
} else {
|
||||||
@ -105,7 +105,7 @@ public class ArgumentPermissions {
|
|||||||
} else if (target instanceof Group) {
|
} else if (target instanceof Group) {
|
||||||
Group targetGroup = ((Group) target);
|
Group targetGroup = ((Group) target);
|
||||||
|
|
||||||
Tristate ret = sender.getPermissionValue(base.getPrimaryPermission() + ".modify." + targetGroup.getName());
|
Tristate ret = sender.getPermissionValue(base.getPermission() + ".modify." + targetGroup.getName());
|
||||||
if (ret != Tristate.UNDEFINED) {
|
if (ret != Tristate.UNDEFINED) {
|
||||||
return !ret.asBoolean();
|
return !ret.asBoolean();
|
||||||
} else {
|
} else {
|
||||||
@ -116,7 +116,7 @@ public class ArgumentPermissions {
|
|||||||
} else if (target instanceof Track) {
|
} else if (target instanceof Track) {
|
||||||
Track targetTrack = ((Track) target);
|
Track targetTrack = ((Track) target);
|
||||||
|
|
||||||
Tristate ret = sender.getPermissionValue(base.getPrimaryPermission() + ".modify." + targetTrack.getName());
|
Tristate ret = sender.getPermissionValue(base.getPermission() + ".modify." + targetTrack.getName());
|
||||||
if (ret != Tristate.UNDEFINED) {
|
if (ret != Tristate.UNDEFINED) {
|
||||||
return !ret.asBoolean();
|
return !ret.asBoolean();
|
||||||
} else {
|
} else {
|
||||||
@ -129,7 +129,7 @@ public class ArgumentPermissions {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public static boolean checkViewPerms(LuckPermsPlugin plugin, Sender sender, Permission base, Object target) {
|
public static boolean checkViewPerms(LuckPermsPlugin plugin, Sender sender, CommandPermission base, Object target) {
|
||||||
if (!plugin.getConfiguration().get(ConfigKeys.USE_ARGUMENT_BASED_COMMAND_PERMISSIONS)) {
|
if (!plugin.getConfiguration().get(ConfigKeys.USE_ARGUMENT_BASED_COMMAND_PERMISSIONS)) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
@ -139,7 +139,7 @@ public class ArgumentPermissions {
|
|||||||
|
|
||||||
if (plugin.getUuidCache().getExternalUUID(targetUser.getUuid()).equals(sender.getUuid())) {
|
if (plugin.getUuidCache().getExternalUUID(targetUser.getUuid()).equals(sender.getUuid())) {
|
||||||
// the sender is trying to view themselves
|
// the sender is trying to view themselves
|
||||||
Tristate ret = sender.getPermissionValue(base.getPrimaryPermission() + ".view.self");
|
Tristate ret = sender.getPermissionValue(base.getPermission() + ".view.self");
|
||||||
if (ret != Tristate.UNDEFINED) {
|
if (ret != Tristate.UNDEFINED) {
|
||||||
return !ret.asBoolean();
|
return !ret.asBoolean();
|
||||||
} else {
|
} else {
|
||||||
@ -149,7 +149,7 @@ public class ArgumentPermissions {
|
|||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
// they're trying to view another user
|
// they're trying to view another user
|
||||||
Tristate ret = sender.getPermissionValue(base.getPrimaryPermission() + ".view.others");
|
Tristate ret = sender.getPermissionValue(base.getPermission() + ".view.others");
|
||||||
if (ret != Tristate.UNDEFINED) {
|
if (ret != Tristate.UNDEFINED) {
|
||||||
return !ret.asBoolean();
|
return !ret.asBoolean();
|
||||||
} else {
|
} else {
|
||||||
@ -161,7 +161,7 @@ public class ArgumentPermissions {
|
|||||||
} else if (target instanceof Group) {
|
} else if (target instanceof Group) {
|
||||||
Group targetGroup = ((Group) target);
|
Group targetGroup = ((Group) target);
|
||||||
|
|
||||||
Tristate ret = sender.getPermissionValue(base.getPrimaryPermission() + ".view." + targetGroup.getName());
|
Tristate ret = sender.getPermissionValue(base.getPermission() + ".view." + targetGroup.getName());
|
||||||
if (ret != Tristate.UNDEFINED) {
|
if (ret != Tristate.UNDEFINED) {
|
||||||
return !ret.asBoolean();
|
return !ret.asBoolean();
|
||||||
} else {
|
} else {
|
||||||
@ -172,7 +172,7 @@ public class ArgumentPermissions {
|
|||||||
} else if (target instanceof Track) {
|
} else if (target instanceof Track) {
|
||||||
Track targetTrack = ((Track) target);
|
Track targetTrack = ((Track) target);
|
||||||
|
|
||||||
Tristate ret = sender.getPermissionValue(base.getPrimaryPermission() + ".view." + targetTrack.getName());
|
Tristate ret = sender.getPermissionValue(base.getPermission() + ".view." + targetTrack.getName());
|
||||||
if (ret != Tristate.UNDEFINED) {
|
if (ret != Tristate.UNDEFINED) {
|
||||||
return !ret.asBoolean();
|
return !ret.asBoolean();
|
||||||
} else {
|
} else {
|
||||||
@ -185,13 +185,13 @@ public class ArgumentPermissions {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static boolean checkContext(LuckPermsPlugin plugin, Sender sender, Permission base, ContextSet contextSet) {
|
public static boolean checkContext(LuckPermsPlugin plugin, Sender sender, CommandPermission base, ContextSet contextSet) {
|
||||||
if (!plugin.getConfiguration().get(ConfigKeys.USE_ARGUMENT_BASED_COMMAND_PERMISSIONS)) {
|
if (!plugin.getConfiguration().get(ConfigKeys.USE_ARGUMENT_BASED_COMMAND_PERMISSIONS)) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (contextSet.isEmpty()) {
|
if (contextSet.isEmpty()) {
|
||||||
Tristate ret = sender.getPermissionValue(base.getPrimaryPermission() + ".usecontext.global");
|
Tristate ret = sender.getPermissionValue(base.getPermission() + ".usecontext.global");
|
||||||
if (ret != Tristate.UNDEFINED) {
|
if (ret != Tristate.UNDEFINED) {
|
||||||
return !ret.asBoolean();
|
return !ret.asBoolean();
|
||||||
} else {
|
} else {
|
||||||
@ -202,7 +202,7 @@ public class ArgumentPermissions {
|
|||||||
}
|
}
|
||||||
|
|
||||||
for (Map.Entry<String, String> context : contextSet.toSet()) {
|
for (Map.Entry<String, String> context : contextSet.toSet()) {
|
||||||
Tristate ret = sender.getPermissionValue(base.getPrimaryPermission() + ".usecontext." + context.getKey() + "." + context.getValue());
|
Tristate ret = sender.getPermissionValue(base.getPermission() + ".usecontext." + context.getKey() + "." + context.getValue());
|
||||||
if (ret != Tristate.UNDEFINED) {
|
if (ret != Tristate.UNDEFINED) {
|
||||||
if (ret == Tristate.FALSE) {
|
if (ret == Tristate.FALSE) {
|
||||||
return true;
|
return true;
|
||||||
|
@ -56,8 +56,8 @@ import me.lucko.luckperms.common.commands.impl.user.UserMainCommand;
|
|||||||
import me.lucko.luckperms.common.commands.sender.Sender;
|
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.CommandPermission;
|
||||||
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.locale.LocaleManager;
|
import me.lucko.luckperms.common.locale.LocaleManager;
|
||||||
import me.lucko.luckperms.common.locale.Message;
|
import me.lucko.luckperms.common.locale.Message;
|
||||||
import me.lucko.luckperms.common.plugin.LuckPermsPlugin;
|
import me.lucko.luckperms.common.plugin.LuckPermsPlugin;
|
||||||
@ -253,7 +253,7 @@ public class CommandManager {
|
|||||||
.filter(c -> c.isAuthorized(sender))
|
.filter(c -> c.isAuthorized(sender))
|
||||||
.forEach(c -> {
|
.forEach(c -> {
|
||||||
@SuppressWarnings("unchecked")
|
@SuppressWarnings("unchecked")
|
||||||
String permission = (String) c.getPermission().map(p -> ((Permission) p).getPrimaryPermission()).orElse("None");
|
String permission = (String) c.getPermission().map(p -> ((CommandPermission) p).getPermission()).orElse("None");
|
||||||
|
|
||||||
Component component = ComponentSerializer.parseFromLegacy("&3> &a" + String.format(c.getUsage(), label), Constants.FORMAT_CHAR)
|
Component component = ComponentSerializer.parseFromLegacy("&3> &a" + String.format(c.getUsage(), label), Constants.FORMAT_CHAR)
|
||||||
.applyRecursively(comp -> {
|
.applyRecursively(comp -> {
|
||||||
|
@ -33,7 +33,7 @@ import me.lucko.luckperms.common.commands.Arg;
|
|||||||
import me.lucko.luckperms.common.commands.CommandException;
|
import me.lucko.luckperms.common.commands.CommandException;
|
||||||
import me.lucko.luckperms.common.commands.CommandResult;
|
import me.lucko.luckperms.common.commands.CommandResult;
|
||||||
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.CommandPermission;
|
||||||
import me.lucko.luckperms.common.locale.LocalizedSpec;
|
import me.lucko.luckperms.common.locale.LocalizedSpec;
|
||||||
import me.lucko.luckperms.common.plugin.LuckPermsPlugin;
|
import me.lucko.luckperms.common.plugin.LuckPermsPlugin;
|
||||||
|
|
||||||
@ -62,7 +62,7 @@ public abstract class Command<T, S> {
|
|||||||
/**
|
/**
|
||||||
* The permission required to use this command. Nullable.
|
* The permission required to use this command. Nullable.
|
||||||
*/
|
*/
|
||||||
private final Permission permission;
|
private final CommandPermission permission;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* A predicate used for testing the size of the arguments list passed to this command
|
* A predicate used for testing the size of the arguments list passed to this command
|
||||||
@ -75,7 +75,7 @@ public abstract class Command<T, S> {
|
|||||||
*/
|
*/
|
||||||
private final List<Command<S, ?>> children;
|
private final List<Command<S, ?>> children;
|
||||||
|
|
||||||
public Command(LocalizedSpec spec, String name, Permission permission, Predicate<Integer> argumentCheck, List<Command<S, ?>> children) {
|
public Command(LocalizedSpec spec, String name, CommandPermission permission, Predicate<Integer> argumentCheck, List<Command<S, ?>> children) {
|
||||||
this.spec = spec;
|
this.spec = spec;
|
||||||
this.name = name;
|
this.name = name;
|
||||||
this.permission = permission;
|
this.permission = permission;
|
||||||
@ -83,7 +83,7 @@ public abstract class Command<T, S> {
|
|||||||
this.children = children == null ? null : ImmutableList.copyOf(children);
|
this.children = children == null ? null : ImmutableList.copyOf(children);
|
||||||
}
|
}
|
||||||
|
|
||||||
public Command(LocalizedSpec spec, String name, Permission permission, Predicate<Integer> argumentCheck) {
|
public Command(LocalizedSpec spec, String name, CommandPermission permission, Predicate<Integer> argumentCheck) {
|
||||||
this(spec, name, permission, argumentCheck, null);
|
this(spec, name, permission, argumentCheck, null);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -152,7 +152,7 @@ public abstract class Command<T, S> {
|
|||||||
return usage == null ? "" : usage;
|
return usage == null ? "" : usage;
|
||||||
}
|
}
|
||||||
|
|
||||||
public Optional<Permission> getPermission() {
|
public Optional<CommandPermission> getPermission() {
|
||||||
return Optional.ofNullable(permission);
|
return Optional.ofNullable(permission);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -30,9 +30,9 @@ import me.lucko.luckperms.common.commands.CommandResult;
|
|||||||
import me.lucko.luckperms.common.commands.sender.Sender;
|
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.core.model.PermissionHolder;
|
|
||||||
import me.lucko.luckperms.common.locale.LocalizedSpec;
|
import me.lucko.luckperms.common.locale.LocalizedSpec;
|
||||||
import me.lucko.luckperms.common.locale.Message;
|
import me.lucko.luckperms.common.locale.Message;
|
||||||
|
import me.lucko.luckperms.common.model.PermissionHolder;
|
||||||
import me.lucko.luckperms.common.plugin.LuckPermsPlugin;
|
import me.lucko.luckperms.common.plugin.LuckPermsPlugin;
|
||||||
import me.lucko.luckperms.common.utils.Predicates;
|
import me.lucko.luckperms.common.utils.Predicates;
|
||||||
|
|
||||||
|
@ -32,11 +32,11 @@ import me.lucko.luckperms.common.commands.CommandException;
|
|||||||
import me.lucko.luckperms.common.commands.CommandResult;
|
import me.lucko.luckperms.common.commands.CommandResult;
|
||||||
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.CommandPermission;
|
||||||
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.locale.LocalizedSpec;
|
import me.lucko.luckperms.common.locale.LocalizedSpec;
|
||||||
|
import me.lucko.luckperms.common.model.Group;
|
||||||
|
import me.lucko.luckperms.common.model.PermissionHolder;
|
||||||
|
import me.lucko.luckperms.common.model.User;
|
||||||
import me.lucko.luckperms.common.plugin.LuckPermsPlugin;
|
import me.lucko.luckperms.common.plugin.LuckPermsPlugin;
|
||||||
|
|
||||||
import java.util.Collections;
|
import java.util.Collections;
|
||||||
@ -60,15 +60,15 @@ public abstract class SharedSubCommand {
|
|||||||
/**
|
/**
|
||||||
* The permission needed to use this command
|
* The permission needed to use this command
|
||||||
*/
|
*/
|
||||||
private final Permission userPermission;
|
private final CommandPermission userPermission;
|
||||||
private final Permission groupPermission;
|
private final CommandPermission groupPermission;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Predicate to test if the argument length given is invalid
|
* Predicate to test if the argument length given is invalid
|
||||||
*/
|
*/
|
||||||
private final Predicate<? super Integer> argumentCheck;
|
private final Predicate<? super Integer> argumentCheck;
|
||||||
|
|
||||||
public SharedSubCommand(LocalizedSpec spec, String name, Permission userPermission, Permission groupPermission, Predicate<? super Integer> argumentCheck) {
|
public SharedSubCommand(LocalizedSpec spec, String name, CommandPermission userPermission, CommandPermission groupPermission, Predicate<? super Integer> argumentCheck) {
|
||||||
this.spec = spec;
|
this.spec = spec;
|
||||||
this.name = name;
|
this.name = name;
|
||||||
this.userPermission = userPermission;
|
this.userPermission = userPermission;
|
||||||
@ -76,7 +76,7 @@ public abstract class SharedSubCommand {
|
|||||||
this.argumentCheck = argumentCheck;
|
this.argumentCheck = argumentCheck;
|
||||||
}
|
}
|
||||||
|
|
||||||
public abstract CommandResult execute(LuckPermsPlugin plugin, Sender sender, PermissionHolder holder, List<String> args, String label, Permission permission) throws CommandException;
|
public abstract CommandResult execute(LuckPermsPlugin plugin, Sender sender, PermissionHolder holder, List<String> args, String label, CommandPermission permission) throws CommandException;
|
||||||
|
|
||||||
public List<String> onTabComplete(LuckPermsPlugin plugin, Sender sender, List<String> args) {
|
public List<String> onTabComplete(LuckPermsPlugin plugin, Sender sender, List<String> args) {
|
||||||
return Collections.emptyList();
|
return Collections.emptyList();
|
||||||
|
@ -30,7 +30,7 @@ import me.lucko.luckperms.common.commands.CommandException;
|
|||||||
import me.lucko.luckperms.common.commands.CommandResult;
|
import me.lucko.luckperms.common.commands.CommandResult;
|
||||||
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.CommandPermission;
|
||||||
import me.lucko.luckperms.common.locale.LocalizedSpec;
|
import me.lucko.luckperms.common.locale.LocalizedSpec;
|
||||||
import me.lucko.luckperms.common.plugin.LuckPermsPlugin;
|
import me.lucko.luckperms.common.plugin.LuckPermsPlugin;
|
||||||
|
|
||||||
@ -42,7 +42,7 @@ import java.util.function.Predicate;
|
|||||||
*/
|
*/
|
||||||
public abstract class SingleCommand extends Command<Void, Void> {
|
public abstract class SingleCommand extends Command<Void, Void> {
|
||||||
|
|
||||||
public SingleCommand(LocalizedSpec spec, String name, Permission permission, Predicate<Integer> argumentCheck) {
|
public SingleCommand(LocalizedSpec spec, String name, CommandPermission permission, Predicate<Integer> argumentCheck) {
|
||||||
super(spec, name, permission, argumentCheck, null);
|
super(spec, name, permission, argumentCheck, null);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -33,14 +33,14 @@ import me.lucko.luckperms.common.commands.Arg;
|
|||||||
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.config.ConfigKeys;
|
import me.lucko.luckperms.common.config.ConfigKeys;
|
||||||
import me.lucko.luckperms.common.constants.Permission;
|
import me.lucko.luckperms.common.constants.CommandPermission;
|
||||||
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.locale.LocalizedSpec;
|
import me.lucko.luckperms.common.locale.LocalizedSpec;
|
||||||
import me.lucko.luckperms.common.locale.Message;
|
import me.lucko.luckperms.common.locale.Message;
|
||||||
import me.lucko.luckperms.common.messaging.InternalMessagingService;
|
import me.lucko.luckperms.common.messaging.InternalMessagingService;
|
||||||
import me.lucko.luckperms.common.messaging.NoopMessagingService;
|
import me.lucko.luckperms.common.messaging.NoopMessagingService;
|
||||||
|
import me.lucko.luckperms.common.model.Group;
|
||||||
|
import me.lucko.luckperms.common.model.Track;
|
||||||
|
import me.lucko.luckperms.common.model.User;
|
||||||
import me.lucko.luckperms.common.plugin.LuckPermsPlugin;
|
import me.lucko.luckperms.common.plugin.LuckPermsPlugin;
|
||||||
import me.lucko.luckperms.common.treeview.PermissionVault;
|
import me.lucko.luckperms.common.treeview.PermissionVault;
|
||||||
import me.lucko.luckperms.common.treeview.TreeNode;
|
import me.lucko.luckperms.common.treeview.TreeNode;
|
||||||
@ -59,7 +59,7 @@ import java.util.stream.Collectors;
|
|||||||
@Getter
|
@Getter
|
||||||
public abstract class SubCommand<T> extends Command<T, Void> {
|
public abstract class SubCommand<T> extends Command<T, Void> {
|
||||||
|
|
||||||
public SubCommand(LocalizedSpec spec, String name, Permission permission, Predicate<Integer> argumentCheck) {
|
public SubCommand(LocalizedSpec spec, String name, CommandPermission permission, Predicate<Integer> argumentCheck) {
|
||||||
super(spec, name, permission, argumentCheck);
|
super(spec, name, permission, argumentCheck);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -30,9 +30,9 @@ import com.google.common.collect.ImmutableList;
|
|||||||
import me.lucko.luckperms.api.ChatMetaType;
|
import me.lucko.luckperms.api.ChatMetaType;
|
||||||
import me.lucko.luckperms.common.commands.abstraction.SharedMainCommand;
|
import me.lucko.luckperms.common.commands.abstraction.SharedMainCommand;
|
||||||
import me.lucko.luckperms.common.commands.abstraction.SharedSubCommand;
|
import me.lucko.luckperms.common.commands.abstraction.SharedSubCommand;
|
||||||
import me.lucko.luckperms.common.core.model.PermissionHolder;
|
|
||||||
import me.lucko.luckperms.common.locale.CommandSpec;
|
import me.lucko.luckperms.common.locale.CommandSpec;
|
||||||
import me.lucko.luckperms.common.locale.LocaleManager;
|
import me.lucko.luckperms.common.locale.LocaleManager;
|
||||||
|
import me.lucko.luckperms.common.model.PermissionHolder;
|
||||||
|
|
||||||
public class CommandMeta<T extends PermissionHolder> extends SharedMainCommand<T> {
|
public class CommandMeta<T extends PermissionHolder> extends SharedMainCommand<T> {
|
||||||
public CommandMeta(LocaleManager locale, boolean user) {
|
public CommandMeta(LocaleManager locale, boolean user) {
|
||||||
|
@ -35,14 +35,14 @@ import me.lucko.luckperms.common.commands.abstraction.SharedSubCommand;
|
|||||||
import me.lucko.luckperms.common.commands.sender.Sender;
|
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.CommandPermission;
|
||||||
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.core.NodeFactory;
|
|
||||||
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.locale.CommandSpec;
|
import me.lucko.luckperms.common.locale.CommandSpec;
|
||||||
import me.lucko.luckperms.common.locale.LocaleManager;
|
import me.lucko.luckperms.common.locale.LocaleManager;
|
||||||
import me.lucko.luckperms.common.locale.Message;
|
import me.lucko.luckperms.common.locale.Message;
|
||||||
|
import me.lucko.luckperms.common.model.PermissionHolder;
|
||||||
|
import me.lucko.luckperms.common.node.NodeFactory;
|
||||||
import me.lucko.luckperms.common.plugin.LuckPermsPlugin;
|
import me.lucko.luckperms.common.plugin.LuckPermsPlugin;
|
||||||
import me.lucko.luckperms.common.utils.Predicates;
|
import me.lucko.luckperms.common.utils.Predicates;
|
||||||
|
|
||||||
@ -60,15 +60,15 @@ public class MetaAddChatMeta extends SharedSubCommand {
|
|||||||
super(
|
super(
|
||||||
type == ChatMetaType.PREFIX ? CommandSpec.META_ADDPREFIX.spec(locale) : CommandSpec.META_ADDSUFFIX.spec(locale),
|
type == ChatMetaType.PREFIX ? CommandSpec.META_ADDPREFIX.spec(locale) : CommandSpec.META_ADDSUFFIX.spec(locale),
|
||||||
"add" + type.name().toLowerCase(),
|
"add" + type.name().toLowerCase(),
|
||||||
type == ChatMetaType.PREFIX ? Permission.USER_META_ADDPREFIX : Permission.USER_META_ADDSUFFIX,
|
type == ChatMetaType.PREFIX ? CommandPermission.USER_META_ADDPREFIX : CommandPermission.USER_META_ADDSUFFIX,
|
||||||
type == ChatMetaType.PREFIX ? Permission.GROUP_META_ADDPREFIX : Permission.GROUP_META_ADDSUFFIX,
|
type == ChatMetaType.PREFIX ? CommandPermission.GROUP_META_ADDPREFIX : CommandPermission.GROUP_META_ADDSUFFIX,
|
||||||
Predicates.inRange(0, 1)
|
Predicates.inRange(0, 1)
|
||||||
);
|
);
|
||||||
this.type = type;
|
this.type = type;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public CommandResult execute(LuckPermsPlugin plugin, Sender sender, PermissionHolder holder, List<String> args, String label, Permission permission) throws CommandException {
|
public CommandResult execute(LuckPermsPlugin plugin, Sender sender, PermissionHolder holder, List<String> args, String label, CommandPermission permission) throws CommandException {
|
||||||
if (ArgumentPermissions.checkModifyPerms(plugin, sender, permission, holder)) {
|
if (ArgumentPermissions.checkModifyPerms(plugin, sender, permission, holder)) {
|
||||||
Message.COMMAND_NO_PERMISSION.send(sender);
|
Message.COMMAND_NO_PERMISSION.send(sender);
|
||||||
return CommandResult.NO_PERMISSION;
|
return CommandResult.NO_PERMISSION;
|
||||||
|
@ -37,15 +37,15 @@ 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.config.ConfigKeys;
|
import me.lucko.luckperms.common.config.ConfigKeys;
|
||||||
|
import me.lucko.luckperms.common.constants.CommandPermission;
|
||||||
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.core.NodeFactory;
|
|
||||||
import me.lucko.luckperms.common.core.TemporaryModifier;
|
|
||||||
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.locale.CommandSpec;
|
import me.lucko.luckperms.common.locale.CommandSpec;
|
||||||
import me.lucko.luckperms.common.locale.LocaleManager;
|
import me.lucko.luckperms.common.locale.LocaleManager;
|
||||||
import me.lucko.luckperms.common.locale.Message;
|
import me.lucko.luckperms.common.locale.Message;
|
||||||
|
import me.lucko.luckperms.common.model.PermissionHolder;
|
||||||
|
import me.lucko.luckperms.common.model.TemporaryModifier;
|
||||||
|
import me.lucko.luckperms.common.node.NodeFactory;
|
||||||
import me.lucko.luckperms.common.plugin.LuckPermsPlugin;
|
import me.lucko.luckperms.common.plugin.LuckPermsPlugin;
|
||||||
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;
|
||||||
@ -65,15 +65,15 @@ public class MetaAddTempChatMeta extends SharedSubCommand {
|
|||||||
super(
|
super(
|
||||||
type == ChatMetaType.PREFIX ? CommandSpec.META_ADDTEMP_PREFIX.spec(locale) : CommandSpec.META_ADDTEMP_SUFFIX.spec(locale),
|
type == ChatMetaType.PREFIX ? CommandSpec.META_ADDTEMP_PREFIX.spec(locale) : CommandSpec.META_ADDTEMP_SUFFIX.spec(locale),
|
||||||
"addtemp" + type.name().toLowerCase(),
|
"addtemp" + type.name().toLowerCase(),
|
||||||
type == ChatMetaType.PREFIX ? Permission.USER_META_ADDTEMP_PREFIX : Permission.USER_META_ADDTEMP_SUFFIX,
|
type == ChatMetaType.PREFIX ? CommandPermission.USER_META_ADDTEMP_PREFIX : CommandPermission.USER_META_ADDTEMP_SUFFIX,
|
||||||
type == ChatMetaType.PREFIX ? Permission.GROUP_META_ADDTEMP_PREFIX : Permission.GROUP_META_ADDTEMP_SUFFIX,
|
type == ChatMetaType.PREFIX ? CommandPermission.GROUP_META_ADDTEMP_PREFIX : CommandPermission.GROUP_META_ADDTEMP_SUFFIX,
|
||||||
Predicates.inRange(0, 2)
|
Predicates.inRange(0, 2)
|
||||||
);
|
);
|
||||||
this.type = type;
|
this.type = type;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public CommandResult execute(LuckPermsPlugin plugin, Sender sender, PermissionHolder holder, List<String> args, String label, Permission permission) throws CommandException {
|
public CommandResult execute(LuckPermsPlugin plugin, Sender sender, PermissionHolder holder, List<String> args, String label, CommandPermission permission) throws CommandException {
|
||||||
if (ArgumentPermissions.checkModifyPerms(plugin, sender, permission, holder)) {
|
if (ArgumentPermissions.checkModifyPerms(plugin, sender, permission, holder)) {
|
||||||
Message.COMMAND_NO_PERMISSION.send(sender);
|
Message.COMMAND_NO_PERMISSION.send(sender);
|
||||||
return CommandResult.NO_PERMISSION;
|
return CommandResult.NO_PERMISSION;
|
||||||
|
@ -33,12 +33,12 @@ import me.lucko.luckperms.common.commands.abstraction.SharedSubCommand;
|
|||||||
import me.lucko.luckperms.common.commands.sender.Sender;
|
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.Permission;
|
import me.lucko.luckperms.common.constants.CommandPermission;
|
||||||
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.locale.CommandSpec;
|
import me.lucko.luckperms.common.locale.CommandSpec;
|
||||||
import me.lucko.luckperms.common.locale.LocaleManager;
|
import me.lucko.luckperms.common.locale.LocaleManager;
|
||||||
import me.lucko.luckperms.common.locale.Message;
|
import me.lucko.luckperms.common.locale.Message;
|
||||||
|
import me.lucko.luckperms.common.model.PermissionHolder;
|
||||||
import me.lucko.luckperms.common.plugin.LuckPermsPlugin;
|
import me.lucko.luckperms.common.plugin.LuckPermsPlugin;
|
||||||
import me.lucko.luckperms.common.utils.Predicates;
|
import me.lucko.luckperms.common.utils.Predicates;
|
||||||
|
|
||||||
@ -47,11 +47,11 @@ import java.util.stream.Collectors;
|
|||||||
|
|
||||||
public class MetaClear extends SharedSubCommand {
|
public class MetaClear extends SharedSubCommand {
|
||||||
public MetaClear(LocaleManager locale) {
|
public MetaClear(LocaleManager locale) {
|
||||||
super(CommandSpec.META_CLEAR.spec(locale), "clear", Permission.USER_META_CLEAR, Permission.GROUP_META_CLEAR, Predicates.alwaysFalse());
|
super(CommandSpec.META_CLEAR.spec(locale), "clear", CommandPermission.USER_META_CLEAR, CommandPermission.GROUP_META_CLEAR, Predicates.alwaysFalse());
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public CommandResult execute(LuckPermsPlugin plugin, Sender sender, PermissionHolder holder, List<String> args, String label, Permission permission) throws CommandException {
|
public CommandResult execute(LuckPermsPlugin plugin, Sender sender, PermissionHolder holder, List<String> args, String label, CommandPermission permission) throws CommandException {
|
||||||
if (ArgumentPermissions.checkModifyPerms(plugin, sender, permission, holder)) {
|
if (ArgumentPermissions.checkModifyPerms(plugin, sender, permission, holder)) {
|
||||||
Message.COMMAND_NO_PERMISSION.send(sender);
|
Message.COMMAND_NO_PERMISSION.send(sender);
|
||||||
return CommandResult.NO_PERMISSION;
|
return CommandResult.NO_PERMISSION;
|
||||||
|
@ -36,15 +36,15 @@ import me.lucko.luckperms.common.commands.abstraction.SharedSubCommand;
|
|||||||
import me.lucko.luckperms.common.commands.sender.Sender;
|
import me.lucko.luckperms.common.commands.sender.Sender;
|
||||||
import me.lucko.luckperms.common.commands.utils.MetaComparator;
|
import me.lucko.luckperms.common.commands.utils.MetaComparator;
|
||||||
import me.lucko.luckperms.common.commands.utils.Util;
|
import me.lucko.luckperms.common.commands.utils.Util;
|
||||||
|
import me.lucko.luckperms.common.constants.CommandPermission;
|
||||||
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.core.NodeFactory;
|
|
||||||
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.locale.CommandSpec;
|
import me.lucko.luckperms.common.locale.CommandSpec;
|
||||||
import me.lucko.luckperms.common.locale.LocaleManager;
|
import me.lucko.luckperms.common.locale.LocaleManager;
|
||||||
import me.lucko.luckperms.common.locale.Message;
|
import me.lucko.luckperms.common.locale.Message;
|
||||||
|
import me.lucko.luckperms.common.model.Group;
|
||||||
|
import me.lucko.luckperms.common.model.PermissionHolder;
|
||||||
|
import me.lucko.luckperms.common.model.User;
|
||||||
|
import me.lucko.luckperms.common.node.NodeFactory;
|
||||||
import me.lucko.luckperms.common.plugin.LuckPermsPlugin;
|
import me.lucko.luckperms.common.plugin.LuckPermsPlugin;
|
||||||
import me.lucko.luckperms.common.utils.Predicates;
|
import me.lucko.luckperms.common.utils.Predicates;
|
||||||
import me.lucko.luckperms.common.utils.TextUtils;
|
import me.lucko.luckperms.common.utils.TextUtils;
|
||||||
@ -68,11 +68,11 @@ public class MetaInfo extends SharedSubCommand {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public MetaInfo(LocaleManager locale) {
|
public MetaInfo(LocaleManager locale) {
|
||||||
super(CommandSpec.META_INFO.spec(locale), "info", Permission.USER_META_INFO, Permission.GROUP_META_INFO, Predicates.alwaysFalse());
|
super(CommandSpec.META_INFO.spec(locale), "info", CommandPermission.USER_META_INFO, CommandPermission.GROUP_META_INFO, Predicates.alwaysFalse());
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public CommandResult execute(LuckPermsPlugin plugin, Sender sender, PermissionHolder holder, List<String> args, String label, Permission permission) throws CommandException {
|
public CommandResult execute(LuckPermsPlugin plugin, Sender sender, PermissionHolder holder, List<String> args, String label, CommandPermission permission) throws CommandException {
|
||||||
if (ArgumentPermissions.checkViewPerms(plugin, sender, permission, holder)) {
|
if (ArgumentPermissions.checkViewPerms(plugin, sender, permission, holder)) {
|
||||||
Message.COMMAND_NO_PERMISSION.send(sender);
|
Message.COMMAND_NO_PERMISSION.send(sender);
|
||||||
return CommandResult.NO_PERMISSION;
|
return CommandResult.NO_PERMISSION;
|
||||||
|
@ -35,14 +35,14 @@ import me.lucko.luckperms.common.commands.abstraction.SharedSubCommand;
|
|||||||
import me.lucko.luckperms.common.commands.sender.Sender;
|
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.CommandPermission;
|
||||||
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.core.NodeFactory;
|
|
||||||
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.locale.CommandSpec;
|
import me.lucko.luckperms.common.locale.CommandSpec;
|
||||||
import me.lucko.luckperms.common.locale.LocaleManager;
|
import me.lucko.luckperms.common.locale.LocaleManager;
|
||||||
import me.lucko.luckperms.common.locale.Message;
|
import me.lucko.luckperms.common.locale.Message;
|
||||||
|
import me.lucko.luckperms.common.model.PermissionHolder;
|
||||||
|
import me.lucko.luckperms.common.node.NodeFactory;
|
||||||
import me.lucko.luckperms.common.plugin.LuckPermsPlugin;
|
import me.lucko.luckperms.common.plugin.LuckPermsPlugin;
|
||||||
import me.lucko.luckperms.common.utils.Predicates;
|
import me.lucko.luckperms.common.utils.Predicates;
|
||||||
|
|
||||||
@ -60,15 +60,15 @@ public class MetaRemoveChatMeta extends SharedSubCommand {
|
|||||||
super(
|
super(
|
||||||
type == ChatMetaType.PREFIX ? CommandSpec.META_REMOVEPREFIX.spec(locale) : CommandSpec.META_REMOVESUFFIX.spec(locale),
|
type == ChatMetaType.PREFIX ? CommandSpec.META_REMOVEPREFIX.spec(locale) : CommandSpec.META_REMOVESUFFIX.spec(locale),
|
||||||
"remove" + type.name().toLowerCase(),
|
"remove" + type.name().toLowerCase(),
|
||||||
type == ChatMetaType.PREFIX ? Permission.USER_META_REMOVEPREFIX : Permission.USER_META_REMOVESUFFIX,
|
type == ChatMetaType.PREFIX ? CommandPermission.USER_META_REMOVEPREFIX : CommandPermission.USER_META_REMOVESUFFIX,
|
||||||
type == ChatMetaType.PREFIX ? Permission.GROUP_META_REMOVEPREFIX : Permission.GROUP_META_REMOVESUFFIX,
|
type == ChatMetaType.PREFIX ? CommandPermission.GROUP_META_REMOVEPREFIX : CommandPermission.GROUP_META_REMOVESUFFIX,
|
||||||
Predicates.is(0)
|
Predicates.is(0)
|
||||||
);
|
);
|
||||||
this.type = type;
|
this.type = type;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public CommandResult execute(LuckPermsPlugin plugin, Sender sender, PermissionHolder holder, List<String> args, String label, Permission permission) throws CommandException {
|
public CommandResult execute(LuckPermsPlugin plugin, Sender sender, PermissionHolder holder, List<String> args, String label, CommandPermission permission) throws CommandException {
|
||||||
if (ArgumentPermissions.checkModifyPerms(plugin, sender, permission, holder)) {
|
if (ArgumentPermissions.checkModifyPerms(plugin, sender, permission, holder)) {
|
||||||
Message.COMMAND_NO_PERMISSION.send(sender);
|
Message.COMMAND_NO_PERMISSION.send(sender);
|
||||||
return CommandResult.NO_PERMISSION;
|
return CommandResult.NO_PERMISSION;
|
||||||
|
@ -35,14 +35,14 @@ import me.lucko.luckperms.common.commands.abstraction.SharedSubCommand;
|
|||||||
import me.lucko.luckperms.common.commands.sender.Sender;
|
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.CommandPermission;
|
||||||
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.core.NodeFactory;
|
|
||||||
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.locale.CommandSpec;
|
import me.lucko.luckperms.common.locale.CommandSpec;
|
||||||
import me.lucko.luckperms.common.locale.LocaleManager;
|
import me.lucko.luckperms.common.locale.LocaleManager;
|
||||||
import me.lucko.luckperms.common.locale.Message;
|
import me.lucko.luckperms.common.locale.Message;
|
||||||
|
import me.lucko.luckperms.common.model.PermissionHolder;
|
||||||
|
import me.lucko.luckperms.common.node.NodeFactory;
|
||||||
import me.lucko.luckperms.common.plugin.LuckPermsPlugin;
|
import me.lucko.luckperms.common.plugin.LuckPermsPlugin;
|
||||||
import me.lucko.luckperms.common.utils.Predicates;
|
import me.lucko.luckperms.common.utils.Predicates;
|
||||||
|
|
||||||
@ -60,15 +60,15 @@ public class MetaRemoveTempChatMeta extends SharedSubCommand {
|
|||||||
super(
|
super(
|
||||||
type == ChatMetaType.PREFIX ? CommandSpec.META_REMOVETEMP_PREFIX.spec(locale) : CommandSpec.META_REMOVETEMP_SUFFIX.spec(locale),
|
type == ChatMetaType.PREFIX ? CommandSpec.META_REMOVETEMP_PREFIX.spec(locale) : CommandSpec.META_REMOVETEMP_SUFFIX.spec(locale),
|
||||||
"removetemp" + type.name().toLowerCase(),
|
"removetemp" + type.name().toLowerCase(),
|
||||||
type == ChatMetaType.PREFIX ? Permission.USER_META_REMOVETEMP_PREFIX : Permission.USER_META_REMOVETEMP_SUFFIX,
|
type == ChatMetaType.PREFIX ? CommandPermission.USER_META_REMOVETEMP_PREFIX : CommandPermission.USER_META_REMOVETEMP_SUFFIX,
|
||||||
type == ChatMetaType.PREFIX ? Permission.GROUP_META_REMOVETEMP_PREFIX : Permission.GROUP_META_REMOVETEMP_SUFFIX,
|
type == ChatMetaType.PREFIX ? CommandPermission.GROUP_META_REMOVETEMP_PREFIX : CommandPermission.GROUP_META_REMOVETEMP_SUFFIX,
|
||||||
Predicates.is(0)
|
Predicates.is(0)
|
||||||
);
|
);
|
||||||
this.type = type;
|
this.type = type;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public CommandResult execute(LuckPermsPlugin plugin, Sender sender, PermissionHolder holder, List<String> args, String label, Permission permission) throws CommandException {
|
public CommandResult execute(LuckPermsPlugin plugin, Sender sender, PermissionHolder holder, List<String> args, String label, CommandPermission permission) throws CommandException {
|
||||||
if (ArgumentPermissions.checkModifyPerms(plugin, sender, permission, holder)) {
|
if (ArgumentPermissions.checkModifyPerms(plugin, sender, permission, holder)) {
|
||||||
Message.COMMAND_NO_PERMISSION.send(sender);
|
Message.COMMAND_NO_PERMISSION.send(sender);
|
||||||
return CommandResult.NO_PERMISSION;
|
return CommandResult.NO_PERMISSION;
|
||||||
|
@ -34,14 +34,14 @@ import me.lucko.luckperms.common.commands.abstraction.SharedSubCommand;
|
|||||||
import me.lucko.luckperms.common.commands.sender.Sender;
|
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.CommandPermission;
|
||||||
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.core.NodeFactory;
|
|
||||||
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.locale.CommandSpec;
|
import me.lucko.luckperms.common.locale.CommandSpec;
|
||||||
import me.lucko.luckperms.common.locale.LocaleManager;
|
import me.lucko.luckperms.common.locale.LocaleManager;
|
||||||
import me.lucko.luckperms.common.locale.Message;
|
import me.lucko.luckperms.common.locale.Message;
|
||||||
|
import me.lucko.luckperms.common.model.PermissionHolder;
|
||||||
|
import me.lucko.luckperms.common.node.NodeFactory;
|
||||||
import me.lucko.luckperms.common.plugin.LuckPermsPlugin;
|
import me.lucko.luckperms.common.plugin.LuckPermsPlugin;
|
||||||
import me.lucko.luckperms.common.utils.Predicates;
|
import me.lucko.luckperms.common.utils.Predicates;
|
||||||
import me.lucko.luckperms.common.utils.TextUtils;
|
import me.lucko.luckperms.common.utils.TextUtils;
|
||||||
@ -55,11 +55,11 @@ import java.util.stream.Collectors;
|
|||||||
|
|
||||||
public class MetaSet extends SharedSubCommand {
|
public class MetaSet extends SharedSubCommand {
|
||||||
public MetaSet(LocaleManager locale) {
|
public MetaSet(LocaleManager locale) {
|
||||||
super(CommandSpec.META_SET.spec(locale), "set", Permission.USER_META_SET, Permission.GROUP_META_SET, Predicates.inRange(0, 1));
|
super(CommandSpec.META_SET.spec(locale), "set", CommandPermission.USER_META_SET, CommandPermission.GROUP_META_SET, Predicates.inRange(0, 1));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public CommandResult execute(LuckPermsPlugin plugin, Sender sender, PermissionHolder holder, List<String> args, String label, Permission permission) throws CommandException {
|
public CommandResult execute(LuckPermsPlugin plugin, Sender sender, PermissionHolder holder, List<String> args, String label, CommandPermission permission) throws CommandException {
|
||||||
if (ArgumentPermissions.checkModifyPerms(plugin, sender, permission, holder)) {
|
if (ArgumentPermissions.checkModifyPerms(plugin, sender, permission, holder)) {
|
||||||
Message.COMMAND_NO_PERMISSION.send(sender);
|
Message.COMMAND_NO_PERMISSION.send(sender);
|
||||||
return CommandResult.NO_PERMISSION;
|
return CommandResult.NO_PERMISSION;
|
||||||
|
@ -35,15 +35,15 @@ 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.config.ConfigKeys;
|
import me.lucko.luckperms.common.config.ConfigKeys;
|
||||||
|
import me.lucko.luckperms.common.constants.CommandPermission;
|
||||||
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.core.NodeFactory;
|
|
||||||
import me.lucko.luckperms.common.core.TemporaryModifier;
|
|
||||||
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.locale.CommandSpec;
|
import me.lucko.luckperms.common.locale.CommandSpec;
|
||||||
import me.lucko.luckperms.common.locale.LocaleManager;
|
import me.lucko.luckperms.common.locale.LocaleManager;
|
||||||
import me.lucko.luckperms.common.locale.Message;
|
import me.lucko.luckperms.common.locale.Message;
|
||||||
|
import me.lucko.luckperms.common.model.PermissionHolder;
|
||||||
|
import me.lucko.luckperms.common.model.TemporaryModifier;
|
||||||
|
import me.lucko.luckperms.common.node.NodeFactory;
|
||||||
import me.lucko.luckperms.common.plugin.LuckPermsPlugin;
|
import me.lucko.luckperms.common.plugin.LuckPermsPlugin;
|
||||||
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;
|
||||||
@ -58,11 +58,11 @@ import java.util.stream.Collectors;
|
|||||||
|
|
||||||
public class MetaSetTemp extends SharedSubCommand {
|
public class MetaSetTemp extends SharedSubCommand {
|
||||||
public MetaSetTemp(LocaleManager locale) {
|
public MetaSetTemp(LocaleManager locale) {
|
||||||
super(CommandSpec.META_SETTEMP.spec(locale), "settemp", Permission.USER_META_SETTEMP, Permission.GROUP_META_SETTEMP, Predicates.inRange(0, 2));
|
super(CommandSpec.META_SETTEMP.spec(locale), "settemp", CommandPermission.USER_META_SETTEMP, CommandPermission.GROUP_META_SETTEMP, Predicates.inRange(0, 2));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public CommandResult execute(LuckPermsPlugin plugin, Sender sender, PermissionHolder holder, List<String> args, String label, Permission permission) throws CommandException {
|
public CommandResult execute(LuckPermsPlugin plugin, Sender sender, PermissionHolder holder, List<String> args, String label, CommandPermission permission) throws CommandException {
|
||||||
if (ArgumentPermissions.checkModifyPerms(plugin, sender, permission, holder)) {
|
if (ArgumentPermissions.checkModifyPerms(plugin, sender, permission, holder)) {
|
||||||
Message.COMMAND_NO_PERMISSION.send(sender);
|
Message.COMMAND_NO_PERMISSION.send(sender);
|
||||||
return CommandResult.NO_PERMISSION;
|
return CommandResult.NO_PERMISSION;
|
||||||
|
@ -33,12 +33,12 @@ import me.lucko.luckperms.common.commands.abstraction.SharedSubCommand;
|
|||||||
import me.lucko.luckperms.common.commands.sender.Sender;
|
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.Permission;
|
import me.lucko.luckperms.common.constants.CommandPermission;
|
||||||
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.locale.CommandSpec;
|
import me.lucko.luckperms.common.locale.CommandSpec;
|
||||||
import me.lucko.luckperms.common.locale.LocaleManager;
|
import me.lucko.luckperms.common.locale.LocaleManager;
|
||||||
import me.lucko.luckperms.common.locale.Message;
|
import me.lucko.luckperms.common.locale.Message;
|
||||||
|
import me.lucko.luckperms.common.model.PermissionHolder;
|
||||||
import me.lucko.luckperms.common.plugin.LuckPermsPlugin;
|
import me.lucko.luckperms.common.plugin.LuckPermsPlugin;
|
||||||
import me.lucko.luckperms.common.utils.Predicates;
|
import me.lucko.luckperms.common.utils.Predicates;
|
||||||
|
|
||||||
@ -47,11 +47,11 @@ import java.util.stream.Collectors;
|
|||||||
|
|
||||||
public class MetaUnset extends SharedSubCommand {
|
public class MetaUnset extends SharedSubCommand {
|
||||||
public MetaUnset(LocaleManager locale) {
|
public MetaUnset(LocaleManager locale) {
|
||||||
super(CommandSpec.META_UNSET.spec(locale), "unset", Permission.USER_META_UNSET, Permission.GROUP_META_UNSET, Predicates.is(0));
|
super(CommandSpec.META_UNSET.spec(locale), "unset", CommandPermission.USER_META_UNSET, CommandPermission.GROUP_META_UNSET, Predicates.is(0));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public CommandResult execute(LuckPermsPlugin plugin, Sender sender, PermissionHolder holder, List<String> args, String label, Permission permission) throws CommandException {
|
public CommandResult execute(LuckPermsPlugin plugin, Sender sender, PermissionHolder holder, List<String> args, String label, CommandPermission permission) throws CommandException {
|
||||||
if (ArgumentPermissions.checkModifyPerms(plugin, sender, permission, holder)) {
|
if (ArgumentPermissions.checkModifyPerms(plugin, sender, permission, holder)) {
|
||||||
Message.COMMAND_NO_PERMISSION.send(sender);
|
Message.COMMAND_NO_PERMISSION.send(sender);
|
||||||
return CommandResult.NO_PERMISSION;
|
return CommandResult.NO_PERMISSION;
|
||||||
|
@ -33,12 +33,12 @@ import me.lucko.luckperms.common.commands.abstraction.SharedSubCommand;
|
|||||||
import me.lucko.luckperms.common.commands.sender.Sender;
|
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.Permission;
|
import me.lucko.luckperms.common.constants.CommandPermission;
|
||||||
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.locale.CommandSpec;
|
import me.lucko.luckperms.common.locale.CommandSpec;
|
||||||
import me.lucko.luckperms.common.locale.LocaleManager;
|
import me.lucko.luckperms.common.locale.LocaleManager;
|
||||||
import me.lucko.luckperms.common.locale.Message;
|
import me.lucko.luckperms.common.locale.Message;
|
||||||
|
import me.lucko.luckperms.common.model.PermissionHolder;
|
||||||
import me.lucko.luckperms.common.plugin.LuckPermsPlugin;
|
import me.lucko.luckperms.common.plugin.LuckPermsPlugin;
|
||||||
import me.lucko.luckperms.common.utils.Predicates;
|
import me.lucko.luckperms.common.utils.Predicates;
|
||||||
|
|
||||||
@ -47,11 +47,11 @@ import java.util.stream.Collectors;
|
|||||||
|
|
||||||
public class MetaUnsetTemp extends SharedSubCommand {
|
public class MetaUnsetTemp extends SharedSubCommand {
|
||||||
public MetaUnsetTemp(LocaleManager locale) {
|
public MetaUnsetTemp(LocaleManager locale) {
|
||||||
super(CommandSpec.META_UNSETTEMP.spec(locale), "unsettemp", Permission.USER_META_UNSETTEMP, Permission.GROUP_META_UNSETTEMP, Predicates.is(0));
|
super(CommandSpec.META_UNSETTEMP.spec(locale), "unsettemp", CommandPermission.USER_META_UNSETTEMP, CommandPermission.GROUP_META_UNSETTEMP, Predicates.is(0));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public CommandResult execute(LuckPermsPlugin plugin, Sender sender, PermissionHolder holder, List<String> args, String label, Permission permission) throws CommandException {
|
public CommandResult execute(LuckPermsPlugin plugin, Sender sender, PermissionHolder holder, List<String> args, String label, CommandPermission permission) throws CommandException {
|
||||||
if (ArgumentPermissions.checkModifyPerms(plugin, sender, permission, holder)) {
|
if (ArgumentPermissions.checkModifyPerms(plugin, sender, permission, holder)) {
|
||||||
Message.COMMAND_NO_PERMISSION.send(sender);
|
Message.COMMAND_NO_PERMISSION.send(sender);
|
||||||
return CommandResult.NO_PERMISSION;
|
return CommandResult.NO_PERMISSION;
|
||||||
|
@ -33,14 +33,14 @@ import me.lucko.luckperms.common.commands.abstraction.SubCommand;
|
|||||||
import me.lucko.luckperms.common.commands.sender.Sender;
|
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.Permission;
|
import me.lucko.luckperms.common.constants.CommandPermission;
|
||||||
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.locale.CommandSpec;
|
import me.lucko.luckperms.common.locale.CommandSpec;
|
||||||
import me.lucko.luckperms.common.locale.LocaleManager;
|
import me.lucko.luckperms.common.locale.LocaleManager;
|
||||||
import me.lucko.luckperms.common.locale.Message;
|
import me.lucko.luckperms.common.locale.Message;
|
||||||
|
import me.lucko.luckperms.common.model.Group;
|
||||||
|
import me.lucko.luckperms.common.model.PermissionHolder;
|
||||||
|
import me.lucko.luckperms.common.model.User;
|
||||||
import me.lucko.luckperms.common.plugin.LuckPermsPlugin;
|
import me.lucko.luckperms.common.plugin.LuckPermsPlugin;
|
||||||
import me.lucko.luckperms.common.utils.Predicates;
|
import me.lucko.luckperms.common.utils.Predicates;
|
||||||
|
|
||||||
@ -49,7 +49,7 @@ import java.util.stream.Collectors;
|
|||||||
|
|
||||||
public class HolderClear<T extends PermissionHolder> extends SubCommand<T> {
|
public class HolderClear<T extends PermissionHolder> extends SubCommand<T> {
|
||||||
public HolderClear(LocaleManager locale, boolean user) {
|
public HolderClear(LocaleManager locale, boolean user) {
|
||||||
super(CommandSpec.HOLDER_CLEAR.spec(locale), "clear", user ? Permission.USER_CLEAR : Permission.GROUP_CLEAR, Predicates.alwaysFalse());
|
super(CommandSpec.HOLDER_CLEAR.spec(locale), "clear", user ? CommandPermission.USER_CLEAR : CommandPermission.GROUP_CLEAR, Predicates.alwaysFalse());
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -38,14 +38,14 @@ import me.lucko.luckperms.common.commands.CommandResult;
|
|||||||
import me.lucko.luckperms.common.commands.abstraction.SubCommand;
|
import me.lucko.luckperms.common.commands.abstraction.SubCommand;
|
||||||
import me.lucko.luckperms.common.commands.sender.Sender;
|
import me.lucko.luckperms.common.commands.sender.Sender;
|
||||||
import me.lucko.luckperms.common.config.ConfigKeys;
|
import me.lucko.luckperms.common.config.ConfigKeys;
|
||||||
import me.lucko.luckperms.common.constants.Permission;
|
import me.lucko.luckperms.common.constants.CommandPermission;
|
||||||
import me.lucko.luckperms.common.core.NodeModel;
|
|
||||||
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.locale.CommandSpec;
|
import me.lucko.luckperms.common.locale.CommandSpec;
|
||||||
import me.lucko.luckperms.common.locale.LocaleManager;
|
import me.lucko.luckperms.common.locale.LocaleManager;
|
||||||
import me.lucko.luckperms.common.locale.Message;
|
import me.lucko.luckperms.common.locale.Message;
|
||||||
|
import me.lucko.luckperms.common.model.Group;
|
||||||
|
import me.lucko.luckperms.common.model.PermissionHolder;
|
||||||
|
import me.lucko.luckperms.common.model.User;
|
||||||
|
import me.lucko.luckperms.common.node.NodeModel;
|
||||||
import me.lucko.luckperms.common.plugin.LuckPermsPlugin;
|
import me.lucko.luckperms.common.plugin.LuckPermsPlugin;
|
||||||
import me.lucko.luckperms.common.utils.Predicates;
|
import me.lucko.luckperms.common.utils.Predicates;
|
||||||
|
|
||||||
@ -72,7 +72,7 @@ public class HolderEditor<T extends PermissionHolder> extends SubCommand<T> {
|
|||||||
private static final String FILE_NAME = "luckperms-data.json";
|
private static final String FILE_NAME = "luckperms-data.json";
|
||||||
|
|
||||||
public HolderEditor(LocaleManager locale, boolean user) {
|
public HolderEditor(LocaleManager locale, boolean user) {
|
||||||
super(CommandSpec.HOLDER_EDITOR.spec(locale), "editor", user ? Permission.USER_EDITOR : Permission.GROUP_EDITOR, Predicates.alwaysFalse());
|
super(CommandSpec.HOLDER_EDITOR.spec(locale), "editor", user ? CommandPermission.USER_EDITOR : CommandPermission.GROUP_EDITOR, Predicates.alwaysFalse());
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -32,11 +32,11 @@ import me.lucko.luckperms.common.commands.CommandResult;
|
|||||||
import me.lucko.luckperms.common.commands.abstraction.SubCommand;
|
import me.lucko.luckperms.common.commands.abstraction.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.CommandPermission;
|
||||||
import me.lucko.luckperms.common.core.model.PermissionHolder;
|
|
||||||
import me.lucko.luckperms.common.locale.CommandSpec;
|
import me.lucko.luckperms.common.locale.CommandSpec;
|
||||||
import me.lucko.luckperms.common.locale.LocaleManager;
|
import me.lucko.luckperms.common.locale.LocaleManager;
|
||||||
import me.lucko.luckperms.common.locale.Message;
|
import me.lucko.luckperms.common.locale.Message;
|
||||||
|
import me.lucko.luckperms.common.model.PermissionHolder;
|
||||||
import me.lucko.luckperms.common.plugin.LuckPermsPlugin;
|
import me.lucko.luckperms.common.plugin.LuckPermsPlugin;
|
||||||
import me.lucko.luckperms.common.utils.Predicates;
|
import me.lucko.luckperms.common.utils.Predicates;
|
||||||
|
|
||||||
@ -46,7 +46,7 @@ import java.util.stream.Collectors;
|
|||||||
|
|
||||||
public class HolderShowTracks<T extends PermissionHolder> extends SubCommand<T> {
|
public class HolderShowTracks<T extends PermissionHolder> extends SubCommand<T> {
|
||||||
public HolderShowTracks(LocaleManager locale, boolean user) {
|
public HolderShowTracks(LocaleManager locale, boolean user) {
|
||||||
super(CommandSpec.HOLDER_SHOWTRACKS.spec(locale), "showtracks", user ? Permission.USER_SHOWTRACKS : Permission.GROUP_SHOWTRACKS, Predicates.alwaysFalse());
|
super(CommandSpec.HOLDER_SHOWTRACKS.spec(locale), "showtracks", user ? CommandPermission.USER_SHOWTRACKS : CommandPermission.GROUP_SHOWTRACKS, Predicates.alwaysFalse());
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -29,9 +29,9 @@ import com.google.common.collect.ImmutableList;
|
|||||||
|
|
||||||
import me.lucko.luckperms.common.commands.abstraction.SharedMainCommand;
|
import me.lucko.luckperms.common.commands.abstraction.SharedMainCommand;
|
||||||
import me.lucko.luckperms.common.commands.abstraction.SharedSubCommand;
|
import me.lucko.luckperms.common.commands.abstraction.SharedSubCommand;
|
||||||
import me.lucko.luckperms.common.core.model.PermissionHolder;
|
|
||||||
import me.lucko.luckperms.common.locale.CommandSpec;
|
import me.lucko.luckperms.common.locale.CommandSpec;
|
||||||
import me.lucko.luckperms.common.locale.LocaleManager;
|
import me.lucko.luckperms.common.locale.LocaleManager;
|
||||||
|
import me.lucko.luckperms.common.model.PermissionHolder;
|
||||||
|
|
||||||
public class CommandParent<T extends PermissionHolder> extends SharedMainCommand<T> {
|
public class CommandParent<T extends PermissionHolder> extends SharedMainCommand<T> {
|
||||||
public CommandParent(LocaleManager locale, boolean user) {
|
public CommandParent(LocaleManager locale, boolean user) {
|
||||||
|
@ -34,13 +34,13 @@ import me.lucko.luckperms.common.commands.abstraction.SharedSubCommand;
|
|||||||
import me.lucko.luckperms.common.commands.sender.Sender;
|
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.Permission;
|
import me.lucko.luckperms.common.constants.CommandPermission;
|
||||||
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.locale.CommandSpec;
|
import me.lucko.luckperms.common.locale.CommandSpec;
|
||||||
import me.lucko.luckperms.common.locale.LocaleManager;
|
import me.lucko.luckperms.common.locale.LocaleManager;
|
||||||
import me.lucko.luckperms.common.locale.Message;
|
import me.lucko.luckperms.common.locale.Message;
|
||||||
|
import me.lucko.luckperms.common.model.Group;
|
||||||
|
import me.lucko.luckperms.common.model.PermissionHolder;
|
||||||
import me.lucko.luckperms.common.plugin.LuckPermsPlugin;
|
import me.lucko.luckperms.common.plugin.LuckPermsPlugin;
|
||||||
import me.lucko.luckperms.common.utils.Predicates;
|
import me.lucko.luckperms.common.utils.Predicates;
|
||||||
|
|
||||||
@ -51,11 +51,11 @@ import static me.lucko.luckperms.common.commands.abstraction.SubCommand.getGroup
|
|||||||
|
|
||||||
public class ParentAdd extends SharedSubCommand {
|
public class ParentAdd extends SharedSubCommand {
|
||||||
public ParentAdd(LocaleManager locale) {
|
public ParentAdd(LocaleManager locale) {
|
||||||
super(CommandSpec.PARENT_ADD.spec(locale), "add", Permission.USER_PARENT_ADD, Permission.GROUP_PARENT_ADD, Predicates.is(0));
|
super(CommandSpec.PARENT_ADD.spec(locale), "add", CommandPermission.USER_PARENT_ADD, CommandPermission.GROUP_PARENT_ADD, Predicates.is(0));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public CommandResult execute(LuckPermsPlugin plugin, Sender sender, PermissionHolder holder, List<String> args, String label, Permission permission) throws CommandException {
|
public CommandResult execute(LuckPermsPlugin plugin, Sender sender, PermissionHolder holder, List<String> args, String label, CommandPermission permission) throws CommandException {
|
||||||
if (ArgumentPermissions.checkModifyPerms(plugin, sender, permission, holder)) {
|
if (ArgumentPermissions.checkModifyPerms(plugin, sender, permission, holder)) {
|
||||||
Message.COMMAND_NO_PERMISSION.send(sender);
|
Message.COMMAND_NO_PERMISSION.send(sender);
|
||||||
return CommandResult.NO_PERMISSION;
|
return CommandResult.NO_PERMISSION;
|
||||||
|
@ -36,15 +36,15 @@ 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.config.ConfigKeys;
|
import me.lucko.luckperms.common.config.ConfigKeys;
|
||||||
import me.lucko.luckperms.common.constants.Permission;
|
import me.lucko.luckperms.common.constants.CommandPermission;
|
||||||
import me.lucko.luckperms.common.core.NodeFactory;
|
|
||||||
import me.lucko.luckperms.common.core.TemporaryModifier;
|
|
||||||
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.locale.CommandSpec;
|
import me.lucko.luckperms.common.locale.CommandSpec;
|
||||||
import me.lucko.luckperms.common.locale.LocaleManager;
|
import me.lucko.luckperms.common.locale.LocaleManager;
|
||||||
import me.lucko.luckperms.common.locale.Message;
|
import me.lucko.luckperms.common.locale.Message;
|
||||||
|
import me.lucko.luckperms.common.model.Group;
|
||||||
|
import me.lucko.luckperms.common.model.PermissionHolder;
|
||||||
|
import me.lucko.luckperms.common.model.TemporaryModifier;
|
||||||
|
import me.lucko.luckperms.common.node.NodeFactory;
|
||||||
import me.lucko.luckperms.common.plugin.LuckPermsPlugin;
|
import me.lucko.luckperms.common.plugin.LuckPermsPlugin;
|
||||||
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;
|
||||||
@ -57,11 +57,11 @@ import static me.lucko.luckperms.common.commands.abstraction.SubCommand.getGroup
|
|||||||
|
|
||||||
public class ParentAddTemp extends SharedSubCommand {
|
public class ParentAddTemp extends SharedSubCommand {
|
||||||
public ParentAddTemp(LocaleManager locale) {
|
public ParentAddTemp(LocaleManager locale) {
|
||||||
super(CommandSpec.PARENT_ADD_TEMP.spec(locale), "addtemp", Permission.USER_PARENT_ADDTEMP, Permission.GROUP_PARENT_ADDTEMP, Predicates.inRange(0, 1));
|
super(CommandSpec.PARENT_ADD_TEMP.spec(locale), "addtemp", CommandPermission.USER_PARENT_ADDTEMP, CommandPermission.GROUP_PARENT_ADDTEMP, Predicates.inRange(0, 1));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public CommandResult execute(LuckPermsPlugin plugin, Sender sender, PermissionHolder holder, List<String> args, String label, Permission permission) throws CommandException {
|
public CommandResult execute(LuckPermsPlugin plugin, Sender sender, PermissionHolder holder, List<String> args, String label, CommandPermission permission) throws CommandException {
|
||||||
if (ArgumentPermissions.checkModifyPerms(plugin, sender, permission, holder)) {
|
if (ArgumentPermissions.checkModifyPerms(plugin, sender, permission, holder)) {
|
||||||
Message.COMMAND_NO_PERMISSION.send(sender);
|
Message.COMMAND_NO_PERMISSION.send(sender);
|
||||||
return CommandResult.NO_PERMISSION;
|
return CommandResult.NO_PERMISSION;
|
||||||
|
@ -33,12 +33,12 @@ import me.lucko.luckperms.common.commands.abstraction.SharedSubCommand;
|
|||||||
import me.lucko.luckperms.common.commands.sender.Sender;
|
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.Permission;
|
import me.lucko.luckperms.common.constants.CommandPermission;
|
||||||
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.locale.CommandSpec;
|
import me.lucko.luckperms.common.locale.CommandSpec;
|
||||||
import me.lucko.luckperms.common.locale.LocaleManager;
|
import me.lucko.luckperms.common.locale.LocaleManager;
|
||||||
import me.lucko.luckperms.common.locale.Message;
|
import me.lucko.luckperms.common.locale.Message;
|
||||||
|
import me.lucko.luckperms.common.model.PermissionHolder;
|
||||||
import me.lucko.luckperms.common.plugin.LuckPermsPlugin;
|
import me.lucko.luckperms.common.plugin.LuckPermsPlugin;
|
||||||
import me.lucko.luckperms.common.utils.Predicates;
|
import me.lucko.luckperms.common.utils.Predicates;
|
||||||
|
|
||||||
@ -47,11 +47,11 @@ import java.util.stream.Collectors;
|
|||||||
|
|
||||||
public class ParentClear extends SharedSubCommand {
|
public class ParentClear extends SharedSubCommand {
|
||||||
public ParentClear(LocaleManager locale) {
|
public ParentClear(LocaleManager locale) {
|
||||||
super(CommandSpec.PARENT_CLEAR.spec(locale), "clear", Permission.USER_PARENT_CLEAR, Permission.GROUP_PARENT_CLEAR, Predicates.alwaysFalse());
|
super(CommandSpec.PARENT_CLEAR.spec(locale), "clear", CommandPermission.USER_PARENT_CLEAR, CommandPermission.GROUP_PARENT_CLEAR, Predicates.alwaysFalse());
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public CommandResult execute(LuckPermsPlugin plugin, Sender sender, PermissionHolder holder, List<String> args, String label, Permission permission) throws CommandException {
|
public CommandResult execute(LuckPermsPlugin plugin, Sender sender, PermissionHolder holder, List<String> args, String label, CommandPermission permission) throws CommandException {
|
||||||
if (ArgumentPermissions.checkModifyPerms(plugin, sender, permission, holder)) {
|
if (ArgumentPermissions.checkModifyPerms(plugin, sender, permission, holder)) {
|
||||||
Message.COMMAND_NO_PERMISSION.send(sender);
|
Message.COMMAND_NO_PERMISSION.send(sender);
|
||||||
return CommandResult.NO_PERMISSION;
|
return CommandResult.NO_PERMISSION;
|
||||||
|
@ -33,15 +33,15 @@ import me.lucko.luckperms.common.commands.abstraction.SharedSubCommand;
|
|||||||
import me.lucko.luckperms.common.commands.sender.Sender;
|
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.CommandPermission;
|
||||||
import me.lucko.luckperms.common.constants.DataConstraints;
|
import me.lucko.luckperms.common.constants.DataConstraints;
|
||||||
import me.lucko.luckperms.common.constants.Permission;
|
|
||||||
import me.lucko.luckperms.common.core.model.PermissionHolder;
|
|
||||||
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.locale.CommandSpec;
|
import me.lucko.luckperms.common.locale.CommandSpec;
|
||||||
import me.lucko.luckperms.common.locale.LocaleManager;
|
import me.lucko.luckperms.common.locale.LocaleManager;
|
||||||
import me.lucko.luckperms.common.locale.Message;
|
import me.lucko.luckperms.common.locale.Message;
|
||||||
|
import me.lucko.luckperms.common.model.PermissionHolder;
|
||||||
|
import me.lucko.luckperms.common.model.Track;
|
||||||
|
import me.lucko.luckperms.common.model.User;
|
||||||
import me.lucko.luckperms.common.plugin.LuckPermsPlugin;
|
import me.lucko.luckperms.common.plugin.LuckPermsPlugin;
|
||||||
import me.lucko.luckperms.common.utils.Predicates;
|
import me.lucko.luckperms.common.utils.Predicates;
|
||||||
|
|
||||||
@ -52,11 +52,11 @@ import static me.lucko.luckperms.common.commands.abstraction.SubCommand.getTrack
|
|||||||
|
|
||||||
public class ParentClearTrack extends SharedSubCommand {
|
public class ParentClearTrack extends SharedSubCommand {
|
||||||
public ParentClearTrack(LocaleManager locale) {
|
public ParentClearTrack(LocaleManager locale) {
|
||||||
super(CommandSpec.PARENT_CLEAR_TRACK.spec(locale), "cleartrack", Permission.USER_PARENT_CLEAR_TRACK, Permission.GROUP_PARENT_CLEAR_TRACK, Predicates.is(0));
|
super(CommandSpec.PARENT_CLEAR_TRACK.spec(locale), "cleartrack", CommandPermission.USER_PARENT_CLEAR_TRACK, CommandPermission.GROUP_PARENT_CLEAR_TRACK, Predicates.is(0));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public CommandResult execute(LuckPermsPlugin plugin, Sender sender, PermissionHolder holder, List<String> args, String label, Permission permission) throws CommandException {
|
public CommandResult execute(LuckPermsPlugin plugin, Sender sender, PermissionHolder holder, List<String> args, String label, CommandPermission permission) throws CommandException {
|
||||||
if (ArgumentPermissions.checkModifyPerms(plugin, sender, permission, holder)) {
|
if (ArgumentPermissions.checkModifyPerms(plugin, sender, permission, holder)) {
|
||||||
Message.COMMAND_NO_PERMISSION.send(sender);
|
Message.COMMAND_NO_PERMISSION.send(sender);
|
||||||
return CommandResult.NO_PERMISSION;
|
return CommandResult.NO_PERMISSION;
|
||||||
|
@ -33,14 +33,14 @@ import me.lucko.luckperms.common.commands.CommandResult;
|
|||||||
import me.lucko.luckperms.common.commands.abstraction.SharedSubCommand;
|
import me.lucko.luckperms.common.commands.abstraction.SharedSubCommand;
|
||||||
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.CommandPermission;
|
||||||
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.core.NodeFactory;
|
|
||||||
import me.lucko.luckperms.common.core.model.PermissionHolder;
|
|
||||||
import me.lucko.luckperms.common.core.model.User;
|
|
||||||
import me.lucko.luckperms.common.locale.CommandSpec;
|
import me.lucko.luckperms.common.locale.CommandSpec;
|
||||||
import me.lucko.luckperms.common.locale.LocaleManager;
|
import me.lucko.luckperms.common.locale.LocaleManager;
|
||||||
import me.lucko.luckperms.common.locale.Message;
|
import me.lucko.luckperms.common.locale.Message;
|
||||||
|
import me.lucko.luckperms.common.model.PermissionHolder;
|
||||||
|
import me.lucko.luckperms.common.model.User;
|
||||||
|
import me.lucko.luckperms.common.node.NodeFactory;
|
||||||
import me.lucko.luckperms.common.plugin.LuckPermsPlugin;
|
import me.lucko.luckperms.common.plugin.LuckPermsPlugin;
|
||||||
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;
|
||||||
@ -59,11 +59,11 @@ import java.util.function.Consumer;
|
|||||||
|
|
||||||
public class ParentInfo extends SharedSubCommand {
|
public class ParentInfo extends SharedSubCommand {
|
||||||
public ParentInfo(LocaleManager locale) {
|
public ParentInfo(LocaleManager locale) {
|
||||||
super(CommandSpec.PARENT_INFO.spec(locale), "info", Permission.USER_PARENT_INFO, Permission.GROUP_PARENT_INFO, Predicates.alwaysFalse());
|
super(CommandSpec.PARENT_INFO.spec(locale), "info", CommandPermission.USER_PARENT_INFO, CommandPermission.GROUP_PARENT_INFO, Predicates.alwaysFalse());
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public CommandResult execute(LuckPermsPlugin plugin, Sender sender, PermissionHolder holder, List<String> args, String label, Permission permission) throws CommandException {
|
public CommandResult execute(LuckPermsPlugin plugin, Sender sender, PermissionHolder holder, List<String> args, String label, CommandPermission permission) throws CommandException {
|
||||||
if (ArgumentPermissions.checkViewPerms(plugin, sender, permission, holder)) {
|
if (ArgumentPermissions.checkViewPerms(plugin, sender, permission, holder)) {
|
||||||
Message.COMMAND_NO_PERMISSION.send(sender);
|
Message.COMMAND_NO_PERMISSION.send(sender);
|
||||||
return CommandResult.NO_PERMISSION;
|
return CommandResult.NO_PERMISSION;
|
||||||
|
@ -35,14 +35,14 @@ 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.config.ConfigKeys;
|
import me.lucko.luckperms.common.config.ConfigKeys;
|
||||||
import me.lucko.luckperms.common.constants.Permission;
|
import me.lucko.luckperms.common.constants.CommandPermission;
|
||||||
import me.lucko.luckperms.common.core.NodeFactory;
|
|
||||||
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.locale.CommandSpec;
|
import me.lucko.luckperms.common.locale.CommandSpec;
|
||||||
import me.lucko.luckperms.common.locale.LocaleManager;
|
import me.lucko.luckperms.common.locale.LocaleManager;
|
||||||
import me.lucko.luckperms.common.locale.Message;
|
import me.lucko.luckperms.common.locale.Message;
|
||||||
|
import me.lucko.luckperms.common.model.PermissionHolder;
|
||||||
|
import me.lucko.luckperms.common.model.User;
|
||||||
|
import me.lucko.luckperms.common.node.NodeFactory;
|
||||||
import me.lucko.luckperms.common.plugin.LuckPermsPlugin;
|
import me.lucko.luckperms.common.plugin.LuckPermsPlugin;
|
||||||
import me.lucko.luckperms.common.utils.Predicates;
|
import me.lucko.luckperms.common.utils.Predicates;
|
||||||
|
|
||||||
@ -53,11 +53,11 @@ import static me.lucko.luckperms.common.commands.abstraction.SubCommand.getGroup
|
|||||||
|
|
||||||
public class ParentRemove extends SharedSubCommand {
|
public class ParentRemove extends SharedSubCommand {
|
||||||
public ParentRemove(LocaleManager locale) {
|
public ParentRemove(LocaleManager locale) {
|
||||||
super(CommandSpec.PARENT_REMOVE.spec(locale), "remove", Permission.USER_PARENT_REMOVE, Permission.GROUP_PARENT_REMOVE, Predicates.is(0));
|
super(CommandSpec.PARENT_REMOVE.spec(locale), "remove", CommandPermission.USER_PARENT_REMOVE, CommandPermission.GROUP_PARENT_REMOVE, Predicates.is(0));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public CommandResult execute(LuckPermsPlugin plugin, Sender sender, PermissionHolder holder, List<String> args, String label, Permission permission) throws CommandException {
|
public CommandResult execute(LuckPermsPlugin plugin, Sender sender, PermissionHolder holder, List<String> args, String label, CommandPermission permission) throws CommandException {
|
||||||
if (ArgumentPermissions.checkModifyPerms(plugin, sender, permission, holder)) {
|
if (ArgumentPermissions.checkModifyPerms(plugin, sender, permission, holder)) {
|
||||||
Message.COMMAND_NO_PERMISSION.send(sender);
|
Message.COMMAND_NO_PERMISSION.send(sender);
|
||||||
return CommandResult.NO_PERMISSION;
|
return CommandResult.NO_PERMISSION;
|
||||||
|
@ -34,13 +34,13 @@ import me.lucko.luckperms.common.commands.abstraction.SharedSubCommand;
|
|||||||
import me.lucko.luckperms.common.commands.sender.Sender;
|
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.Permission;
|
import me.lucko.luckperms.common.constants.CommandPermission;
|
||||||
import me.lucko.luckperms.common.core.NodeFactory;
|
|
||||||
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.locale.CommandSpec;
|
import me.lucko.luckperms.common.locale.CommandSpec;
|
||||||
import me.lucko.luckperms.common.locale.LocaleManager;
|
import me.lucko.luckperms.common.locale.LocaleManager;
|
||||||
import me.lucko.luckperms.common.locale.Message;
|
import me.lucko.luckperms.common.locale.Message;
|
||||||
|
import me.lucko.luckperms.common.model.PermissionHolder;
|
||||||
|
import me.lucko.luckperms.common.node.NodeFactory;
|
||||||
import me.lucko.luckperms.common.plugin.LuckPermsPlugin;
|
import me.lucko.luckperms.common.plugin.LuckPermsPlugin;
|
||||||
import me.lucko.luckperms.common.utils.Predicates;
|
import me.lucko.luckperms.common.utils.Predicates;
|
||||||
|
|
||||||
@ -51,11 +51,11 @@ import static me.lucko.luckperms.common.commands.abstraction.SubCommand.getGroup
|
|||||||
|
|
||||||
public class ParentRemoveTemp extends SharedSubCommand {
|
public class ParentRemoveTemp extends SharedSubCommand {
|
||||||
public ParentRemoveTemp(LocaleManager locale) {
|
public ParentRemoveTemp(LocaleManager locale) {
|
||||||
super(CommandSpec.PARENT_REMOVE_TEMP.spec(locale), "removetemp", Permission.USER_PARENT_REMOVETEMP, Permission.GROUP_PARENT_REMOVETEMP, Predicates.is(0));
|
super(CommandSpec.PARENT_REMOVE_TEMP.spec(locale), "removetemp", CommandPermission.USER_PARENT_REMOVETEMP, CommandPermission.GROUP_PARENT_REMOVETEMP, Predicates.is(0));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public CommandResult execute(LuckPermsPlugin plugin, Sender sender, PermissionHolder holder, List<String> args, String label, Permission permission) throws CommandException {
|
public CommandResult execute(LuckPermsPlugin plugin, Sender sender, PermissionHolder holder, List<String> args, String label, CommandPermission permission) throws CommandException {
|
||||||
if (ArgumentPermissions.checkModifyPerms(plugin, sender, permission, holder)) {
|
if (ArgumentPermissions.checkModifyPerms(plugin, sender, permission, holder)) {
|
||||||
Message.COMMAND_NO_PERMISSION.send(sender);
|
Message.COMMAND_NO_PERMISSION.send(sender);
|
||||||
return CommandResult.NO_PERMISSION;
|
return CommandResult.NO_PERMISSION;
|
||||||
|
@ -33,14 +33,14 @@ import me.lucko.luckperms.common.commands.abstraction.SharedSubCommand;
|
|||||||
import me.lucko.luckperms.common.commands.sender.Sender;
|
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.Permission;
|
import me.lucko.luckperms.common.constants.CommandPermission;
|
||||||
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.locale.CommandSpec;
|
import me.lucko.luckperms.common.locale.CommandSpec;
|
||||||
import me.lucko.luckperms.common.locale.LocaleManager;
|
import me.lucko.luckperms.common.locale.LocaleManager;
|
||||||
import me.lucko.luckperms.common.locale.Message;
|
import me.lucko.luckperms.common.locale.Message;
|
||||||
|
import me.lucko.luckperms.common.model.Group;
|
||||||
|
import me.lucko.luckperms.common.model.PermissionHolder;
|
||||||
|
import me.lucko.luckperms.common.model.User;
|
||||||
import me.lucko.luckperms.common.plugin.LuckPermsPlugin;
|
import me.lucko.luckperms.common.plugin.LuckPermsPlugin;
|
||||||
import me.lucko.luckperms.common.utils.Predicates;
|
import me.lucko.luckperms.common.utils.Predicates;
|
||||||
|
|
||||||
@ -51,11 +51,11 @@ import static me.lucko.luckperms.common.commands.abstraction.SubCommand.getGroup
|
|||||||
|
|
||||||
public class ParentSet extends SharedSubCommand {
|
public class ParentSet extends SharedSubCommand {
|
||||||
public ParentSet(LocaleManager locale) {
|
public ParentSet(LocaleManager locale) {
|
||||||
super(CommandSpec.PARENT_SET.spec(locale), "set", Permission.USER_PARENT_SET, Permission.GROUP_PARENT_SET, Predicates.is(0));
|
super(CommandSpec.PARENT_SET.spec(locale), "set", CommandPermission.USER_PARENT_SET, CommandPermission.GROUP_PARENT_SET, Predicates.is(0));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public CommandResult execute(LuckPermsPlugin plugin, Sender sender, PermissionHolder holder, List<String> args, String label, Permission permission) throws CommandException {
|
public CommandResult execute(LuckPermsPlugin plugin, Sender sender, PermissionHolder holder, List<String> args, String label, CommandPermission permission) throws CommandException {
|
||||||
if (ArgumentPermissions.checkModifyPerms(plugin, sender, permission, holder)) {
|
if (ArgumentPermissions.checkModifyPerms(plugin, sender, permission, holder)) {
|
||||||
Message.COMMAND_NO_PERMISSION.send(sender);
|
Message.COMMAND_NO_PERMISSION.send(sender);
|
||||||
return CommandResult.NO_PERMISSION;
|
return CommandResult.NO_PERMISSION;
|
||||||
|
@ -33,15 +33,15 @@ import me.lucko.luckperms.common.commands.abstraction.SharedSubCommand;
|
|||||||
import me.lucko.luckperms.common.commands.sender.Sender;
|
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.CommandPermission;
|
||||||
import me.lucko.luckperms.common.constants.DataConstraints;
|
import me.lucko.luckperms.common.constants.DataConstraints;
|
||||||
import me.lucko.luckperms.common.constants.Permission;
|
|
||||||
import me.lucko.luckperms.common.core.model.Group;
|
|
||||||
import me.lucko.luckperms.common.core.model.PermissionHolder;
|
|
||||||
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.locale.CommandSpec;
|
import me.lucko.luckperms.common.locale.CommandSpec;
|
||||||
import me.lucko.luckperms.common.locale.LocaleManager;
|
import me.lucko.luckperms.common.locale.LocaleManager;
|
||||||
import me.lucko.luckperms.common.locale.Message;
|
import me.lucko.luckperms.common.locale.Message;
|
||||||
|
import me.lucko.luckperms.common.model.Group;
|
||||||
|
import me.lucko.luckperms.common.model.PermissionHolder;
|
||||||
|
import me.lucko.luckperms.common.model.Track;
|
||||||
import me.lucko.luckperms.common.plugin.LuckPermsPlugin;
|
import me.lucko.luckperms.common.plugin.LuckPermsPlugin;
|
||||||
import me.lucko.luckperms.common.utils.Predicates;
|
import me.lucko.luckperms.common.utils.Predicates;
|
||||||
|
|
||||||
@ -53,11 +53,11 @@ import static me.lucko.luckperms.common.commands.abstraction.SubCommand.getTrack
|
|||||||
|
|
||||||
public class ParentSetTrack extends SharedSubCommand {
|
public class ParentSetTrack extends SharedSubCommand {
|
||||||
public ParentSetTrack(LocaleManager locale) {
|
public ParentSetTrack(LocaleManager locale) {
|
||||||
super(CommandSpec.PARENT_SET_TRACK.spec(locale), "settrack", Permission.USER_PARENT_SET_TRACK, Permission.GROUP_PARENT_SET_TRACK, Predicates.inRange(0, 1));
|
super(CommandSpec.PARENT_SET_TRACK.spec(locale), "settrack", CommandPermission.USER_PARENT_SET_TRACK, CommandPermission.GROUP_PARENT_SET_TRACK, Predicates.inRange(0, 1));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public CommandResult execute(LuckPermsPlugin plugin, Sender sender, PermissionHolder holder, List<String> args, String label, Permission permission) throws CommandException {
|
public CommandResult execute(LuckPermsPlugin plugin, Sender sender, PermissionHolder holder, List<String> args, String label, CommandPermission permission) throws CommandException {
|
||||||
if (ArgumentPermissions.checkModifyPerms(plugin, sender, permission, holder)) {
|
if (ArgumentPermissions.checkModifyPerms(plugin, sender, permission, holder)) {
|
||||||
Message.COMMAND_NO_PERMISSION.send(sender);
|
Message.COMMAND_NO_PERMISSION.send(sender);
|
||||||
return CommandResult.NO_PERMISSION;
|
return CommandResult.NO_PERMISSION;
|
||||||
|
@ -29,9 +29,9 @@ import com.google.common.collect.ImmutableList;
|
|||||||
|
|
||||||
import me.lucko.luckperms.common.commands.abstraction.SharedMainCommand;
|
import me.lucko.luckperms.common.commands.abstraction.SharedMainCommand;
|
||||||
import me.lucko.luckperms.common.commands.abstraction.SharedSubCommand;
|
import me.lucko.luckperms.common.commands.abstraction.SharedSubCommand;
|
||||||
import me.lucko.luckperms.common.core.model.PermissionHolder;
|
|
||||||
import me.lucko.luckperms.common.locale.CommandSpec;
|
import me.lucko.luckperms.common.locale.CommandSpec;
|
||||||
import me.lucko.luckperms.common.locale.LocaleManager;
|
import me.lucko.luckperms.common.locale.LocaleManager;
|
||||||
|
import me.lucko.luckperms.common.model.PermissionHolder;
|
||||||
|
|
||||||
public class CommandPermission<T extends PermissionHolder> extends SharedMainCommand<T> {
|
public class CommandPermission<T extends PermissionHolder> extends SharedMainCommand<T> {
|
||||||
public CommandPermission(LocaleManager locale, boolean user) {
|
public CommandPermission(LocaleManager locale, boolean user) {
|
||||||
|
@ -34,12 +34,12 @@ import me.lucko.luckperms.common.commands.abstraction.SharedSubCommand;
|
|||||||
import me.lucko.luckperms.common.commands.sender.Sender;
|
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.Permission;
|
import me.lucko.luckperms.common.constants.CommandPermission;
|
||||||
import me.lucko.luckperms.common.core.NodeFactory;
|
|
||||||
import me.lucko.luckperms.common.core.model.PermissionHolder;
|
|
||||||
import me.lucko.luckperms.common.locale.CommandSpec;
|
import me.lucko.luckperms.common.locale.CommandSpec;
|
||||||
import me.lucko.luckperms.common.locale.LocaleManager;
|
import me.lucko.luckperms.common.locale.LocaleManager;
|
||||||
import me.lucko.luckperms.common.locale.Message;
|
import me.lucko.luckperms.common.locale.Message;
|
||||||
|
import me.lucko.luckperms.common.model.PermissionHolder;
|
||||||
|
import me.lucko.luckperms.common.node.NodeFactory;
|
||||||
import me.lucko.luckperms.common.plugin.LuckPermsPlugin;
|
import me.lucko.luckperms.common.plugin.LuckPermsPlugin;
|
||||||
import me.lucko.luckperms.common.utils.Predicates;
|
import me.lucko.luckperms.common.utils.Predicates;
|
||||||
|
|
||||||
@ -49,11 +49,11 @@ import static me.lucko.luckperms.common.commands.abstraction.SubCommand.getPermi
|
|||||||
|
|
||||||
public class PermissionCheck extends SharedSubCommand {
|
public class PermissionCheck extends SharedSubCommand {
|
||||||
public PermissionCheck(LocaleManager locale) {
|
public PermissionCheck(LocaleManager locale) {
|
||||||
super(CommandSpec.PERMISSION_CHECK.spec(locale), "check", Permission.USER_PERM_CHECK, Permission.GROUP_PERM_CHECK, Predicates.is(0));
|
super(CommandSpec.PERMISSION_CHECK.spec(locale), "check", CommandPermission.USER_PERM_CHECK, CommandPermission.GROUP_PERM_CHECK, Predicates.is(0));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public CommandResult execute(LuckPermsPlugin plugin, Sender sender, PermissionHolder holder, List<String> args, String label, Permission permission) throws CommandException {
|
public CommandResult execute(LuckPermsPlugin plugin, Sender sender, PermissionHolder holder, List<String> args, String label, CommandPermission permission) throws CommandException {
|
||||||
if (ArgumentPermissions.checkViewPerms(plugin, sender, permission, holder)) {
|
if (ArgumentPermissions.checkViewPerms(plugin, sender, permission, holder)) {
|
||||||
Message.COMMAND_NO_PERMISSION.send(sender);
|
Message.COMMAND_NO_PERMISSION.send(sender);
|
||||||
return CommandResult.NO_PERMISSION;
|
return CommandResult.NO_PERMISSION;
|
||||||
|
@ -33,13 +33,13 @@ import me.lucko.luckperms.common.commands.abstraction.SharedSubCommand;
|
|||||||
import me.lucko.luckperms.common.commands.sender.Sender;
|
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.Permission;
|
import me.lucko.luckperms.common.constants.CommandPermission;
|
||||||
import me.lucko.luckperms.common.core.InheritanceInfo;
|
|
||||||
import me.lucko.luckperms.common.core.NodeFactory;
|
|
||||||
import me.lucko.luckperms.common.core.model.PermissionHolder;
|
|
||||||
import me.lucko.luckperms.common.locale.CommandSpec;
|
import me.lucko.luckperms.common.locale.CommandSpec;
|
||||||
import me.lucko.luckperms.common.locale.LocaleManager;
|
import me.lucko.luckperms.common.locale.LocaleManager;
|
||||||
import me.lucko.luckperms.common.locale.Message;
|
import me.lucko.luckperms.common.locale.Message;
|
||||||
|
import me.lucko.luckperms.common.model.PermissionHolder;
|
||||||
|
import me.lucko.luckperms.common.node.InheritanceInfo;
|
||||||
|
import me.lucko.luckperms.common.node.NodeFactory;
|
||||||
import me.lucko.luckperms.common.plugin.LuckPermsPlugin;
|
import me.lucko.luckperms.common.plugin.LuckPermsPlugin;
|
||||||
import me.lucko.luckperms.common.utils.Predicates;
|
import me.lucko.luckperms.common.utils.Predicates;
|
||||||
|
|
||||||
@ -49,11 +49,11 @@ import static me.lucko.luckperms.common.commands.abstraction.SubCommand.getPermi
|
|||||||
|
|
||||||
public class PermissionCheckInherits extends SharedSubCommand {
|
public class PermissionCheckInherits extends SharedSubCommand {
|
||||||
public PermissionCheckInherits(LocaleManager locale) {
|
public PermissionCheckInherits(LocaleManager locale) {
|
||||||
super(CommandSpec.PERMISSION_CHECK_INHERITS.spec(locale), "checkinherits", Permission.USER_PERM_CHECK_INHERITS, Permission.GROUP_PERM_CHECK_INHERITS, Predicates.is(0));
|
super(CommandSpec.PERMISSION_CHECK_INHERITS.spec(locale), "checkinherits", CommandPermission.USER_PERM_CHECK_INHERITS, CommandPermission.GROUP_PERM_CHECK_INHERITS, Predicates.is(0));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public CommandResult execute(LuckPermsPlugin plugin, Sender sender, PermissionHolder holder, List<String> args, String label, Permission permission) throws CommandException {
|
public CommandResult execute(LuckPermsPlugin plugin, Sender sender, PermissionHolder holder, List<String> args, String label, CommandPermission permission) throws CommandException {
|
||||||
if (ArgumentPermissions.checkViewPerms(plugin, sender, permission, holder)) {
|
if (ArgumentPermissions.checkViewPerms(plugin, sender, permission, holder)) {
|
||||||
Message.COMMAND_NO_PERMISSION.send(sender);
|
Message.COMMAND_NO_PERMISSION.send(sender);
|
||||||
return CommandResult.NO_PERMISSION;
|
return CommandResult.NO_PERMISSION;
|
||||||
|
@ -36,14 +36,14 @@ import me.lucko.luckperms.common.commands.abstraction.SharedSubCommand;
|
|||||||
import me.lucko.luckperms.common.commands.sender.Sender;
|
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.CommandPermission;
|
||||||
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.core.NodeFactory;
|
|
||||||
import me.lucko.luckperms.common.core.model.PermissionHolder;
|
|
||||||
import me.lucko.luckperms.common.core.model.User;
|
|
||||||
import me.lucko.luckperms.common.locale.CommandSpec;
|
import me.lucko.luckperms.common.locale.CommandSpec;
|
||||||
import me.lucko.luckperms.common.locale.LocaleManager;
|
import me.lucko.luckperms.common.locale.LocaleManager;
|
||||||
import me.lucko.luckperms.common.locale.Message;
|
import me.lucko.luckperms.common.locale.Message;
|
||||||
|
import me.lucko.luckperms.common.model.PermissionHolder;
|
||||||
|
import me.lucko.luckperms.common.model.User;
|
||||||
|
import me.lucko.luckperms.common.node.NodeFactory;
|
||||||
import me.lucko.luckperms.common.plugin.LuckPermsPlugin;
|
import me.lucko.luckperms.common.plugin.LuckPermsPlugin;
|
||||||
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;
|
||||||
@ -63,11 +63,11 @@ import java.util.function.Consumer;
|
|||||||
|
|
||||||
public class PermissionInfo extends SharedSubCommand {
|
public class PermissionInfo extends SharedSubCommand {
|
||||||
public PermissionInfo(LocaleManager locale) {
|
public PermissionInfo(LocaleManager locale) {
|
||||||
super(CommandSpec.PERMISSION_INFO.spec(locale), "info", Permission.USER_PERM_INFO, Permission.GROUP_PERM_INFO, Predicates.notInRange(0, 2));
|
super(CommandSpec.PERMISSION_INFO.spec(locale), "info", CommandPermission.USER_PERM_INFO, CommandPermission.GROUP_PERM_INFO, Predicates.notInRange(0, 2));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public CommandResult execute(LuckPermsPlugin plugin, Sender sender, PermissionHolder holder, List<String> args, String label, Permission permission) throws CommandException {
|
public CommandResult execute(LuckPermsPlugin plugin, Sender sender, PermissionHolder holder, List<String> args, String label, CommandPermission permission) throws CommandException {
|
||||||
if (ArgumentPermissions.checkViewPerms(plugin, sender, permission, holder)) {
|
if (ArgumentPermissions.checkViewPerms(plugin, sender, permission, holder)) {
|
||||||
Message.COMMAND_NO_PERMISSION.send(sender);
|
Message.COMMAND_NO_PERMISSION.send(sender);
|
||||||
return CommandResult.NO_PERMISSION;
|
return CommandResult.NO_PERMISSION;
|
||||||
|
@ -34,13 +34,13 @@ import me.lucko.luckperms.common.commands.abstraction.SharedSubCommand;
|
|||||||
import me.lucko.luckperms.common.commands.sender.Sender;
|
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.Permission;
|
import me.lucko.luckperms.common.constants.CommandPermission;
|
||||||
import me.lucko.luckperms.common.core.NodeFactory;
|
|
||||||
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.locale.CommandSpec;
|
import me.lucko.luckperms.common.locale.CommandSpec;
|
||||||
import me.lucko.luckperms.common.locale.LocaleManager;
|
import me.lucko.luckperms.common.locale.LocaleManager;
|
||||||
import me.lucko.luckperms.common.locale.Message;
|
import me.lucko.luckperms.common.locale.Message;
|
||||||
|
import me.lucko.luckperms.common.model.PermissionHolder;
|
||||||
|
import me.lucko.luckperms.common.node.NodeFactory;
|
||||||
import me.lucko.luckperms.common.plugin.LuckPermsPlugin;
|
import me.lucko.luckperms.common.plugin.LuckPermsPlugin;
|
||||||
import me.lucko.luckperms.common.utils.Predicates;
|
import me.lucko.luckperms.common.utils.Predicates;
|
||||||
|
|
||||||
@ -52,11 +52,11 @@ import static me.lucko.luckperms.common.commands.abstraction.SubCommand.getPermi
|
|||||||
|
|
||||||
public class PermissionSet extends SharedSubCommand {
|
public class PermissionSet extends SharedSubCommand {
|
||||||
public PermissionSet(LocaleManager locale) {
|
public PermissionSet(LocaleManager locale) {
|
||||||
super(CommandSpec.PERMISSION_SET.spec(locale), "set", Permission.USER_PERM_SET, Permission.GROUP_PERM_SET, Predicates.is(0));
|
super(CommandSpec.PERMISSION_SET.spec(locale), "set", CommandPermission.USER_PERM_SET, CommandPermission.GROUP_PERM_SET, Predicates.is(0));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public CommandResult execute(LuckPermsPlugin plugin, Sender sender, PermissionHolder holder, List<String> args, String label, Permission permission) throws CommandException {
|
public CommandResult execute(LuckPermsPlugin plugin, Sender sender, PermissionHolder holder, List<String> args, String label, CommandPermission permission) throws CommandException {
|
||||||
if (ArgumentPermissions.checkModifyPerms(plugin, sender, permission, holder)) {
|
if (ArgumentPermissions.checkModifyPerms(plugin, sender, permission, holder)) {
|
||||||
Message.COMMAND_NO_PERMISSION.send(sender);
|
Message.COMMAND_NO_PERMISSION.send(sender);
|
||||||
return CommandResult.NO_PERMISSION;
|
return CommandResult.NO_PERMISSION;
|
||||||
|
@ -36,14 +36,14 @@ 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.config.ConfigKeys;
|
import me.lucko.luckperms.common.config.ConfigKeys;
|
||||||
import me.lucko.luckperms.common.constants.Permission;
|
import me.lucko.luckperms.common.constants.CommandPermission;
|
||||||
import me.lucko.luckperms.common.core.NodeFactory;
|
|
||||||
import me.lucko.luckperms.common.core.TemporaryModifier;
|
|
||||||
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.locale.CommandSpec;
|
import me.lucko.luckperms.common.locale.CommandSpec;
|
||||||
import me.lucko.luckperms.common.locale.LocaleManager;
|
import me.lucko.luckperms.common.locale.LocaleManager;
|
||||||
import me.lucko.luckperms.common.locale.Message;
|
import me.lucko.luckperms.common.locale.Message;
|
||||||
|
import me.lucko.luckperms.common.model.PermissionHolder;
|
||||||
|
import me.lucko.luckperms.common.model.TemporaryModifier;
|
||||||
|
import me.lucko.luckperms.common.node.NodeFactory;
|
||||||
import me.lucko.luckperms.common.plugin.LuckPermsPlugin;
|
import me.lucko.luckperms.common.plugin.LuckPermsPlugin;
|
||||||
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;
|
||||||
@ -57,11 +57,11 @@ import static me.lucko.luckperms.common.commands.abstraction.SubCommand.getPermi
|
|||||||
|
|
||||||
public class PermissionSetTemp extends SharedSubCommand {
|
public class PermissionSetTemp extends SharedSubCommand {
|
||||||
public PermissionSetTemp(LocaleManager locale) {
|
public PermissionSetTemp(LocaleManager locale) {
|
||||||
super(CommandSpec.PERMISSION_SETTEMP.spec(locale), "settemp", Permission.USER_PERM_SETTEMP, Permission.GROUP_PERM_SETTEMP, Predicates.inRange(0, 2));
|
super(CommandSpec.PERMISSION_SETTEMP.spec(locale), "settemp", CommandPermission.USER_PERM_SETTEMP, CommandPermission.GROUP_PERM_SETTEMP, Predicates.inRange(0, 2));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public CommandResult execute(LuckPermsPlugin plugin, Sender sender, PermissionHolder holder, List<String> args, String label, Permission permission) throws CommandException {
|
public CommandResult execute(LuckPermsPlugin plugin, Sender sender, PermissionHolder holder, List<String> args, String label, CommandPermission permission) throws CommandException {
|
||||||
if (ArgumentPermissions.checkModifyPerms(plugin, sender, permission, holder)) {
|
if (ArgumentPermissions.checkModifyPerms(plugin, sender, permission, holder)) {
|
||||||
Message.COMMAND_NO_PERMISSION.send(sender);
|
Message.COMMAND_NO_PERMISSION.send(sender);
|
||||||
return CommandResult.NO_PERMISSION;
|
return CommandResult.NO_PERMISSION;
|
||||||
|
@ -34,13 +34,13 @@ import me.lucko.luckperms.common.commands.abstraction.SharedSubCommand;
|
|||||||
import me.lucko.luckperms.common.commands.sender.Sender;
|
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.Permission;
|
import me.lucko.luckperms.common.constants.CommandPermission;
|
||||||
import me.lucko.luckperms.common.core.NodeFactory;
|
|
||||||
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.locale.CommandSpec;
|
import me.lucko.luckperms.common.locale.CommandSpec;
|
||||||
import me.lucko.luckperms.common.locale.LocaleManager;
|
import me.lucko.luckperms.common.locale.LocaleManager;
|
||||||
import me.lucko.luckperms.common.locale.Message;
|
import me.lucko.luckperms.common.locale.Message;
|
||||||
|
import me.lucko.luckperms.common.model.PermissionHolder;
|
||||||
|
import me.lucko.luckperms.common.node.NodeFactory;
|
||||||
import me.lucko.luckperms.common.plugin.LuckPermsPlugin;
|
import me.lucko.luckperms.common.plugin.LuckPermsPlugin;
|
||||||
import me.lucko.luckperms.common.utils.Predicates;
|
import me.lucko.luckperms.common.utils.Predicates;
|
||||||
|
|
||||||
@ -51,11 +51,11 @@ import static me.lucko.luckperms.common.commands.abstraction.SubCommand.getPermi
|
|||||||
|
|
||||||
public class PermissionUnset extends SharedSubCommand {
|
public class PermissionUnset extends SharedSubCommand {
|
||||||
public PermissionUnset(LocaleManager locale) {
|
public PermissionUnset(LocaleManager locale) {
|
||||||
super(CommandSpec.PERMISSION_UNSET.spec(locale), "unset", Permission.USER_PERM_UNSET, Permission.GROUP_PERM_UNSET, Predicates.is(0));
|
super(CommandSpec.PERMISSION_UNSET.spec(locale), "unset", CommandPermission.USER_PERM_UNSET, CommandPermission.GROUP_PERM_UNSET, Predicates.is(0));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public CommandResult execute(LuckPermsPlugin plugin, Sender sender, PermissionHolder holder, List<String> args, String label, Permission permission) throws CommandException {
|
public CommandResult execute(LuckPermsPlugin plugin, Sender sender, PermissionHolder holder, List<String> args, String label, CommandPermission permission) throws CommandException {
|
||||||
if (ArgumentPermissions.checkModifyPerms(plugin, sender, permission, holder)) {
|
if (ArgumentPermissions.checkModifyPerms(plugin, sender, permission, holder)) {
|
||||||
Message.COMMAND_NO_PERMISSION.send(sender);
|
Message.COMMAND_NO_PERMISSION.send(sender);
|
||||||
return CommandResult.NO_PERMISSION;
|
return CommandResult.NO_PERMISSION;
|
||||||
|
@ -34,13 +34,13 @@ import me.lucko.luckperms.common.commands.abstraction.SharedSubCommand;
|
|||||||
import me.lucko.luckperms.common.commands.sender.Sender;
|
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.Permission;
|
import me.lucko.luckperms.common.constants.CommandPermission;
|
||||||
import me.lucko.luckperms.common.core.NodeFactory;
|
|
||||||
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.locale.CommandSpec;
|
import me.lucko.luckperms.common.locale.CommandSpec;
|
||||||
import me.lucko.luckperms.common.locale.LocaleManager;
|
import me.lucko.luckperms.common.locale.LocaleManager;
|
||||||
import me.lucko.luckperms.common.locale.Message;
|
import me.lucko.luckperms.common.locale.Message;
|
||||||
|
import me.lucko.luckperms.common.model.PermissionHolder;
|
||||||
|
import me.lucko.luckperms.common.node.NodeFactory;
|
||||||
import me.lucko.luckperms.common.plugin.LuckPermsPlugin;
|
import me.lucko.luckperms.common.plugin.LuckPermsPlugin;
|
||||||
import me.lucko.luckperms.common.utils.Predicates;
|
import me.lucko.luckperms.common.utils.Predicates;
|
||||||
|
|
||||||
@ -51,11 +51,11 @@ import static me.lucko.luckperms.common.commands.abstraction.SubCommand.getPermi
|
|||||||
|
|
||||||
public class PermissionUnsetTemp extends SharedSubCommand {
|
public class PermissionUnsetTemp extends SharedSubCommand {
|
||||||
public PermissionUnsetTemp(LocaleManager locale) {
|
public PermissionUnsetTemp(LocaleManager locale) {
|
||||||
super(CommandSpec.PERMISSION_UNSETTEMP.spec(locale), "unsettemp", Permission.USER_PERM_UNSETTEMP, Permission.GROUP_PERM_UNSETTEMP, Predicates.is(0));
|
super(CommandSpec.PERMISSION_UNSETTEMP.spec(locale), "unsettemp", CommandPermission.USER_PERM_UNSETTEMP, CommandPermission.GROUP_PERM_UNSETTEMP, Predicates.is(0));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public CommandResult execute(LuckPermsPlugin plugin, Sender sender, PermissionHolder holder, List<String> args, String label, Permission permission) throws CommandException {
|
public CommandResult execute(LuckPermsPlugin plugin, Sender sender, PermissionHolder holder, List<String> args, String label, CommandPermission permission) throws CommandException {
|
||||||
if (ArgumentPermissions.checkModifyPerms(plugin, sender, permission, holder)) {
|
if (ArgumentPermissions.checkModifyPerms(plugin, sender, permission, holder)) {
|
||||||
Message.COMMAND_NO_PERMISSION.send(sender);
|
Message.COMMAND_NO_PERMISSION.send(sender);
|
||||||
return CommandResult.NO_PERMISSION;
|
return CommandResult.NO_PERMISSION;
|
||||||
|
@ -29,8 +29,8 @@ import me.lucko.luckperms.api.event.cause.CreationCause;
|
|||||||
import me.lucko.luckperms.common.commands.CommandResult;
|
import me.lucko.luckperms.common.commands.CommandResult;
|
||||||
import me.lucko.luckperms.common.commands.abstraction.SingleCommand;
|
import me.lucko.luckperms.common.commands.abstraction.SingleCommand;
|
||||||
import me.lucko.luckperms.common.commands.sender.Sender;
|
import me.lucko.luckperms.common.commands.sender.Sender;
|
||||||
|
import me.lucko.luckperms.common.constants.CommandPermission;
|
||||||
import me.lucko.luckperms.common.constants.DataConstraints;
|
import me.lucko.luckperms.common.constants.DataConstraints;
|
||||||
import me.lucko.luckperms.common.constants.Permission;
|
|
||||||
import me.lucko.luckperms.common.data.LogEntry;
|
import me.lucko.luckperms.common.data.LogEntry;
|
||||||
import me.lucko.luckperms.common.locale.CommandSpec;
|
import me.lucko.luckperms.common.locale.CommandSpec;
|
||||||
import me.lucko.luckperms.common.locale.LocaleManager;
|
import me.lucko.luckperms.common.locale.LocaleManager;
|
||||||
@ -42,7 +42,7 @@ import java.util.List;
|
|||||||
|
|
||||||
public class CreateGroup extends SingleCommand {
|
public class CreateGroup extends SingleCommand {
|
||||||
public CreateGroup(LocaleManager locale) {
|
public CreateGroup(LocaleManager locale) {
|
||||||
super(CommandSpec.CREATE_GROUP.spec(locale), "CreateGroup", Permission.CREATE_GROUP, Predicates.not(1));
|
super(CommandSpec.CREATE_GROUP.spec(locale), "CreateGroup", CommandPermission.CREATE_GROUP, Predicates.not(1));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -31,12 +31,12 @@ import me.lucko.luckperms.common.commands.abstraction.SingleCommand;
|
|||||||
import me.lucko.luckperms.common.commands.abstraction.SubCommand;
|
import me.lucko.luckperms.common.commands.abstraction.SubCommand;
|
||||||
import me.lucko.luckperms.common.commands.sender.Sender;
|
import me.lucko.luckperms.common.commands.sender.Sender;
|
||||||
import me.lucko.luckperms.common.config.ConfigKeys;
|
import me.lucko.luckperms.common.config.ConfigKeys;
|
||||||
import me.lucko.luckperms.common.constants.Permission;
|
import me.lucko.luckperms.common.constants.CommandPermission;
|
||||||
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.locale.CommandSpec;
|
import me.lucko.luckperms.common.locale.CommandSpec;
|
||||||
import me.lucko.luckperms.common.locale.LocaleManager;
|
import me.lucko.luckperms.common.locale.LocaleManager;
|
||||||
import me.lucko.luckperms.common.locale.Message;
|
import me.lucko.luckperms.common.locale.Message;
|
||||||
|
import me.lucko.luckperms.common.model.Group;
|
||||||
import me.lucko.luckperms.common.plugin.LuckPermsPlugin;
|
import me.lucko.luckperms.common.plugin.LuckPermsPlugin;
|
||||||
import me.lucko.luckperms.common.utils.Predicates;
|
import me.lucko.luckperms.common.utils.Predicates;
|
||||||
|
|
||||||
@ -44,7 +44,7 @@ import java.util.List;
|
|||||||
|
|
||||||
public class DeleteGroup extends SingleCommand {
|
public class DeleteGroup extends SingleCommand {
|
||||||
public DeleteGroup(LocaleManager locale) {
|
public DeleteGroup(LocaleManager locale) {
|
||||||
super(CommandSpec.DELETE_GROUP.spec(locale), "DeleteGroup", Permission.DELETE_GROUP, Predicates.not(1));
|
super(CommandSpec.DELETE_GROUP.spec(locale), "DeleteGroup", CommandPermission.DELETE_GROUP, Predicates.not(1));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -31,13 +31,13 @@ import me.lucko.luckperms.common.commands.CommandException;
|
|||||||
import me.lucko.luckperms.common.commands.CommandResult;
|
import me.lucko.luckperms.common.commands.CommandResult;
|
||||||
import me.lucko.luckperms.common.commands.abstraction.SubCommand;
|
import me.lucko.luckperms.common.commands.abstraction.SubCommand;
|
||||||
import me.lucko.luckperms.common.commands.sender.Sender;
|
import me.lucko.luckperms.common.commands.sender.Sender;
|
||||||
|
import me.lucko.luckperms.common.constants.CommandPermission;
|
||||||
import me.lucko.luckperms.common.constants.DataConstraints;
|
import me.lucko.luckperms.common.constants.DataConstraints;
|
||||||
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.locale.CommandSpec;
|
import me.lucko.luckperms.common.locale.CommandSpec;
|
||||||
import me.lucko.luckperms.common.locale.LocaleManager;
|
import me.lucko.luckperms.common.locale.LocaleManager;
|
||||||
import me.lucko.luckperms.common.locale.Message;
|
import me.lucko.luckperms.common.locale.Message;
|
||||||
|
import me.lucko.luckperms.common.model.Group;
|
||||||
import me.lucko.luckperms.common.plugin.LuckPermsPlugin;
|
import me.lucko.luckperms.common.plugin.LuckPermsPlugin;
|
||||||
import me.lucko.luckperms.common.utils.Predicates;
|
import me.lucko.luckperms.common.utils.Predicates;
|
||||||
|
|
||||||
@ -45,7 +45,7 @@ import java.util.List;
|
|||||||
|
|
||||||
public class GroupClone extends SubCommand<Group> {
|
public class GroupClone extends SubCommand<Group> {
|
||||||
public GroupClone(LocaleManager locale) {
|
public GroupClone(LocaleManager locale) {
|
||||||
super(CommandSpec.GROUP_CLONE.spec(locale), "clone", Permission.GROUP_CLONE, Predicates.not(1));
|
super(CommandSpec.GROUP_CLONE.spec(locale), "clone", CommandPermission.GROUP_CLONE, Predicates.not(1));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -32,11 +32,11 @@ import me.lucko.luckperms.common.commands.CommandResult;
|
|||||||
import me.lucko.luckperms.common.commands.abstraction.SubCommand;
|
import me.lucko.luckperms.common.commands.abstraction.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.CommandPermission;
|
||||||
import me.lucko.luckperms.common.core.model.Group;
|
|
||||||
import me.lucko.luckperms.common.locale.CommandSpec;
|
import me.lucko.luckperms.common.locale.CommandSpec;
|
||||||
import me.lucko.luckperms.common.locale.LocaleManager;
|
import me.lucko.luckperms.common.locale.LocaleManager;
|
||||||
import me.lucko.luckperms.common.locale.Message;
|
import me.lucko.luckperms.common.locale.Message;
|
||||||
|
import me.lucko.luckperms.common.model.Group;
|
||||||
import me.lucko.luckperms.common.plugin.LuckPermsPlugin;
|
import me.lucko.luckperms.common.plugin.LuckPermsPlugin;
|
||||||
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;
|
||||||
@ -47,7 +47,7 @@ import java.util.stream.Collectors;
|
|||||||
|
|
||||||
public class GroupInfo extends SubCommand<Group> {
|
public class GroupInfo extends SubCommand<Group> {
|
||||||
public GroupInfo(LocaleManager locale) {
|
public GroupInfo(LocaleManager locale) {
|
||||||
super(CommandSpec.GROUP_INFO.spec(locale), "info", Permission.GROUP_INFO, Predicates.alwaysFalse());
|
super(CommandSpec.GROUP_INFO.spec(locale), "info", CommandPermission.GROUP_INFO, Predicates.alwaysFalse());
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -36,13 +36,13 @@ import me.lucko.luckperms.common.commands.abstraction.SubCommand;
|
|||||||
import me.lucko.luckperms.common.commands.sender.Sender;
|
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.CommandPermission;
|
||||||
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.core.NodeFactory;
|
|
||||||
import me.lucko.luckperms.common.core.model.Group;
|
|
||||||
import me.lucko.luckperms.common.locale.CommandSpec;
|
import me.lucko.luckperms.common.locale.CommandSpec;
|
||||||
import me.lucko.luckperms.common.locale.LocaleManager;
|
import me.lucko.luckperms.common.locale.LocaleManager;
|
||||||
import me.lucko.luckperms.common.locale.Message;
|
import me.lucko.luckperms.common.locale.Message;
|
||||||
|
import me.lucko.luckperms.common.model.Group;
|
||||||
|
import me.lucko.luckperms.common.node.NodeFactory;
|
||||||
import me.lucko.luckperms.common.plugin.LuckPermsPlugin;
|
import me.lucko.luckperms.common.plugin.LuckPermsPlugin;
|
||||||
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;
|
||||||
@ -66,7 +66,7 @@ import java.util.stream.Collectors;
|
|||||||
|
|
||||||
public class GroupListMembers extends SubCommand<Group> {
|
public class GroupListMembers extends SubCommand<Group> {
|
||||||
public GroupListMembers(LocaleManager locale) {
|
public GroupListMembers(LocaleManager locale) {
|
||||||
super(CommandSpec.GROUP_LISTMEMBERS.spec(locale), "listmembers", Permission.GROUP_LISTMEMBERS, Predicates.notInRange(0, 1));
|
super(CommandSpec.GROUP_LISTMEMBERS.spec(locale), "listmembers", CommandPermission.GROUP_LISTMEMBERS, Predicates.notInRange(0, 1));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -36,10 +36,10 @@ import me.lucko.luckperms.common.commands.impl.generic.other.HolderShowTracks;
|
|||||||
import me.lucko.luckperms.common.commands.impl.generic.parent.CommandParent;
|
import me.lucko.luckperms.common.commands.impl.generic.parent.CommandParent;
|
||||||
import me.lucko.luckperms.common.commands.impl.generic.permission.CommandPermission;
|
import me.lucko.luckperms.common.commands.impl.generic.permission.CommandPermission;
|
||||||
import me.lucko.luckperms.common.commands.sender.Sender;
|
import me.lucko.luckperms.common.commands.sender.Sender;
|
||||||
import me.lucko.luckperms.common.core.model.Group;
|
|
||||||
import me.lucko.luckperms.common.locale.CommandSpec;
|
import me.lucko.luckperms.common.locale.CommandSpec;
|
||||||
import me.lucko.luckperms.common.locale.LocaleManager;
|
import me.lucko.luckperms.common.locale.LocaleManager;
|
||||||
import me.lucko.luckperms.common.locale.Message;
|
import me.lucko.luckperms.common.locale.Message;
|
||||||
|
import me.lucko.luckperms.common.model.Group;
|
||||||
import me.lucko.luckperms.common.plugin.LuckPermsPlugin;
|
import me.lucko.luckperms.common.plugin.LuckPermsPlugin;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
|
@ -31,13 +31,13 @@ import me.lucko.luckperms.common.commands.CommandException;
|
|||||||
import me.lucko.luckperms.common.commands.CommandResult;
|
import me.lucko.luckperms.common.commands.CommandResult;
|
||||||
import me.lucko.luckperms.common.commands.abstraction.SubCommand;
|
import me.lucko.luckperms.common.commands.abstraction.SubCommand;
|
||||||
import me.lucko.luckperms.common.commands.sender.Sender;
|
import me.lucko.luckperms.common.commands.sender.Sender;
|
||||||
|
import me.lucko.luckperms.common.constants.CommandPermission;
|
||||||
import me.lucko.luckperms.common.constants.DataConstraints;
|
import me.lucko.luckperms.common.constants.DataConstraints;
|
||||||
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.locale.CommandSpec;
|
import me.lucko.luckperms.common.locale.CommandSpec;
|
||||||
import me.lucko.luckperms.common.locale.LocaleManager;
|
import me.lucko.luckperms.common.locale.LocaleManager;
|
||||||
import me.lucko.luckperms.common.locale.Message;
|
import me.lucko.luckperms.common.locale.Message;
|
||||||
|
import me.lucko.luckperms.common.model.Group;
|
||||||
import me.lucko.luckperms.common.plugin.LuckPermsPlugin;
|
import me.lucko.luckperms.common.plugin.LuckPermsPlugin;
|
||||||
import me.lucko.luckperms.common.utils.Predicates;
|
import me.lucko.luckperms.common.utils.Predicates;
|
||||||
|
|
||||||
@ -45,7 +45,7 @@ import java.util.List;
|
|||||||
|
|
||||||
public class GroupRename extends SubCommand<Group> {
|
public class GroupRename extends SubCommand<Group> {
|
||||||
public GroupRename(LocaleManager locale) {
|
public GroupRename(LocaleManager locale) {
|
||||||
super(CommandSpec.GROUP_RENAME.spec(locale), "rename", Permission.GROUP_RENAME, Predicates.not(1));
|
super(CommandSpec.GROUP_RENAME.spec(locale), "rename", CommandPermission.GROUP_RENAME, Predicates.not(1));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -31,12 +31,12 @@ import me.lucko.luckperms.common.commands.CommandResult;
|
|||||||
import me.lucko.luckperms.common.commands.abstraction.SubCommand;
|
import me.lucko.luckperms.common.commands.abstraction.SubCommand;
|
||||||
import me.lucko.luckperms.common.commands.sender.Sender;
|
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.constants.Permission;
|
import me.lucko.luckperms.common.constants.CommandPermission;
|
||||||
import me.lucko.luckperms.common.core.NodeFactory;
|
|
||||||
import me.lucko.luckperms.common.core.model.Group;
|
|
||||||
import me.lucko.luckperms.common.locale.CommandSpec;
|
import me.lucko.luckperms.common.locale.CommandSpec;
|
||||||
import me.lucko.luckperms.common.locale.LocaleManager;
|
import me.lucko.luckperms.common.locale.LocaleManager;
|
||||||
import me.lucko.luckperms.common.locale.Message;
|
import me.lucko.luckperms.common.locale.Message;
|
||||||
|
import me.lucko.luckperms.common.model.Group;
|
||||||
|
import me.lucko.luckperms.common.node.NodeFactory;
|
||||||
import me.lucko.luckperms.common.plugin.LuckPermsPlugin;
|
import me.lucko.luckperms.common.plugin.LuckPermsPlugin;
|
||||||
import me.lucko.luckperms.common.utils.Predicates;
|
import me.lucko.luckperms.common.utils.Predicates;
|
||||||
|
|
||||||
@ -44,7 +44,7 @@ import java.util.List;
|
|||||||
|
|
||||||
public class GroupSetWeight extends SubCommand<Group> {
|
public class GroupSetWeight extends SubCommand<Group> {
|
||||||
public GroupSetWeight(LocaleManager locale) {
|
public GroupSetWeight(LocaleManager locale) {
|
||||||
super(CommandSpec.GROUP_SETWEIGHT.spec(locale), "setweight", Permission.GROUP_SETWEIGHT, Predicates.not(1));
|
super(CommandSpec.GROUP_SETWEIGHT.spec(locale), "setweight", CommandPermission.GROUP_SETWEIGHT, Predicates.not(1));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -29,12 +29,12 @@ import me.lucko.luckperms.common.commands.CommandResult;
|
|||||||
import me.lucko.luckperms.common.commands.abstraction.SingleCommand;
|
import me.lucko.luckperms.common.commands.abstraction.SingleCommand;
|
||||||
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.CommandPermission;
|
||||||
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.core.model.Track;
|
|
||||||
import me.lucko.luckperms.common.locale.CommandSpec;
|
import me.lucko.luckperms.common.locale.CommandSpec;
|
||||||
import me.lucko.luckperms.common.locale.LocaleManager;
|
import me.lucko.luckperms.common.locale.LocaleManager;
|
||||||
import me.lucko.luckperms.common.locale.Message;
|
import me.lucko.luckperms.common.locale.Message;
|
||||||
|
import me.lucko.luckperms.common.model.Track;
|
||||||
import me.lucko.luckperms.common.plugin.LuckPermsPlugin;
|
import me.lucko.luckperms.common.plugin.LuckPermsPlugin;
|
||||||
import me.lucko.luckperms.common.utils.Predicates;
|
import me.lucko.luckperms.common.utils.Predicates;
|
||||||
|
|
||||||
@ -49,7 +49,7 @@ import java.util.stream.Collectors;
|
|||||||
|
|
||||||
public class ListGroups extends SingleCommand {
|
public class ListGroups extends SingleCommand {
|
||||||
public ListGroups(LocaleManager locale) {
|
public ListGroups(LocaleManager locale) {
|
||||||
super(CommandSpec.LIST_GROUPS.spec(locale), "ListGroups", Permission.LIST_GROUPS, Predicates.alwaysFalse());
|
super(CommandSpec.LIST_GROUPS.spec(locale), "ListGroups", CommandPermission.LIST_GROUPS, Predicates.alwaysFalse());
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -30,8 +30,8 @@ import me.lucko.luckperms.common.commands.CommandException;
|
|||||||
import me.lucko.luckperms.common.commands.CommandResult;
|
import me.lucko.luckperms.common.commands.CommandResult;
|
||||||
import me.lucko.luckperms.common.commands.abstraction.SubCommand;
|
import me.lucko.luckperms.common.commands.abstraction.SubCommand;
|
||||||
import me.lucko.luckperms.common.commands.sender.Sender;
|
import me.lucko.luckperms.common.commands.sender.Sender;
|
||||||
|
import me.lucko.luckperms.common.constants.CommandPermission;
|
||||||
import me.lucko.luckperms.common.constants.DataConstraints;
|
import me.lucko.luckperms.common.constants.DataConstraints;
|
||||||
import me.lucko.luckperms.common.constants.Permission;
|
|
||||||
import me.lucko.luckperms.common.data.Log;
|
import me.lucko.luckperms.common.data.Log;
|
||||||
import me.lucko.luckperms.common.locale.CommandSpec;
|
import me.lucko.luckperms.common.locale.CommandSpec;
|
||||||
import me.lucko.luckperms.common.locale.LocaleManager;
|
import me.lucko.luckperms.common.locale.LocaleManager;
|
||||||
@ -46,7 +46,7 @@ import java.util.SortedMap;
|
|||||||
|
|
||||||
public class LogGroupHistory extends SubCommand<Log> {
|
public class LogGroupHistory extends SubCommand<Log> {
|
||||||
public LogGroupHistory(LocaleManager locale) {
|
public LogGroupHistory(LocaleManager locale) {
|
||||||
super(CommandSpec.LOG_GROUP_HISTORY.spec(locale), "grouphistory", Permission.LOG_GROUP_HISTORY, Predicates.notInRange(1, 2));
|
super(CommandSpec.LOG_GROUP_HISTORY.spec(locale), "grouphistory", CommandPermission.LOG_GROUP_HISTORY, Predicates.notInRange(1, 2));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -29,7 +29,7 @@ import me.lucko.luckperms.common.commands.CommandException;
|
|||||||
import me.lucko.luckperms.common.commands.CommandResult;
|
import me.lucko.luckperms.common.commands.CommandResult;
|
||||||
import me.lucko.luckperms.common.commands.abstraction.SubCommand;
|
import me.lucko.luckperms.common.commands.abstraction.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.CommandPermission;
|
||||||
import me.lucko.luckperms.common.data.Log;
|
import me.lucko.luckperms.common.data.Log;
|
||||||
import me.lucko.luckperms.common.locale.CommandSpec;
|
import me.lucko.luckperms.common.locale.CommandSpec;
|
||||||
import me.lucko.luckperms.common.locale.LocaleManager;
|
import me.lucko.luckperms.common.locale.LocaleManager;
|
||||||
@ -43,7 +43,7 @@ import java.util.UUID;
|
|||||||
|
|
||||||
public class LogNotify extends SubCommand<Log> {
|
public class LogNotify extends SubCommand<Log> {
|
||||||
public LogNotify(LocaleManager locale) {
|
public LogNotify(LocaleManager locale) {
|
||||||
super(CommandSpec.LOG_NOTIFY.spec(locale), "notify", Permission.LOG_NOTIFY, Predicates.notInRange(0, 1));
|
super(CommandSpec.LOG_NOTIFY.spec(locale), "notify", CommandPermission.LOG_NOTIFY, Predicates.notInRange(0, 1));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -31,8 +31,8 @@ import me.lucko.luckperms.common.commands.CommandResult;
|
|||||||
import me.lucko.luckperms.common.commands.abstraction.SubCommand;
|
import me.lucko.luckperms.common.commands.abstraction.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.CommandPermission;
|
||||||
import me.lucko.luckperms.common.constants.DataConstraints;
|
import me.lucko.luckperms.common.constants.DataConstraints;
|
||||||
import me.lucko.luckperms.common.constants.Permission;
|
|
||||||
import me.lucko.luckperms.common.data.Log;
|
import me.lucko.luckperms.common.data.Log;
|
||||||
import me.lucko.luckperms.common.locale.CommandSpec;
|
import me.lucko.luckperms.common.locale.CommandSpec;
|
||||||
import me.lucko.luckperms.common.locale.LocaleManager;
|
import me.lucko.luckperms.common.locale.LocaleManager;
|
||||||
@ -48,7 +48,7 @@ import java.util.UUID;
|
|||||||
|
|
||||||
public class LogRecent extends SubCommand<Log> {
|
public class LogRecent extends SubCommand<Log> {
|
||||||
public LogRecent(LocaleManager locale) {
|
public LogRecent(LocaleManager locale) {
|
||||||
super(CommandSpec.LOG_RECENT.spec(locale), "recent", Permission.LOG_RECENT, Predicates.notInRange(0, 2));
|
super(CommandSpec.LOG_RECENT.spec(locale), "recent", CommandPermission.LOG_RECENT, Predicates.notInRange(0, 2));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -30,7 +30,7 @@ import me.lucko.luckperms.common.commands.CommandException;
|
|||||||
import me.lucko.luckperms.common.commands.CommandResult;
|
import me.lucko.luckperms.common.commands.CommandResult;
|
||||||
import me.lucko.luckperms.common.commands.abstraction.SubCommand;
|
import me.lucko.luckperms.common.commands.abstraction.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.CommandPermission;
|
||||||
import me.lucko.luckperms.common.data.Log;
|
import me.lucko.luckperms.common.data.Log;
|
||||||
import me.lucko.luckperms.common.locale.CommandSpec;
|
import me.lucko.luckperms.common.locale.CommandSpec;
|
||||||
import me.lucko.luckperms.common.locale.LocaleManager;
|
import me.lucko.luckperms.common.locale.LocaleManager;
|
||||||
@ -46,7 +46,7 @@ import java.util.stream.Collectors;
|
|||||||
|
|
||||||
public class LogSearch extends SubCommand<Log> {
|
public class LogSearch extends SubCommand<Log> {
|
||||||
public LogSearch(LocaleManager locale) {
|
public LogSearch(LocaleManager locale) {
|
||||||
super(CommandSpec.LOG_SEARCH.spec(locale), "search", Permission.LOG_SEARCH, Predicates.is(0));
|
super(CommandSpec.LOG_SEARCH.spec(locale), "search", CommandPermission.LOG_SEARCH, Predicates.is(0));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -30,8 +30,8 @@ import me.lucko.luckperms.common.commands.CommandException;
|
|||||||
import me.lucko.luckperms.common.commands.CommandResult;
|
import me.lucko.luckperms.common.commands.CommandResult;
|
||||||
import me.lucko.luckperms.common.commands.abstraction.SubCommand;
|
import me.lucko.luckperms.common.commands.abstraction.SubCommand;
|
||||||
import me.lucko.luckperms.common.commands.sender.Sender;
|
import me.lucko.luckperms.common.commands.sender.Sender;
|
||||||
|
import me.lucko.luckperms.common.constants.CommandPermission;
|
||||||
import me.lucko.luckperms.common.constants.DataConstraints;
|
import me.lucko.luckperms.common.constants.DataConstraints;
|
||||||
import me.lucko.luckperms.common.constants.Permission;
|
|
||||||
import me.lucko.luckperms.common.data.Log;
|
import me.lucko.luckperms.common.data.Log;
|
||||||
import me.lucko.luckperms.common.locale.CommandSpec;
|
import me.lucko.luckperms.common.locale.CommandSpec;
|
||||||
import me.lucko.luckperms.common.locale.LocaleManager;
|
import me.lucko.luckperms.common.locale.LocaleManager;
|
||||||
@ -46,7 +46,7 @@ import java.util.SortedMap;
|
|||||||
|
|
||||||
public class LogTrackHistory extends SubCommand<Log> {
|
public class LogTrackHistory extends SubCommand<Log> {
|
||||||
public LogTrackHistory(LocaleManager locale) {
|
public LogTrackHistory(LocaleManager locale) {
|
||||||
super(CommandSpec.LOG_TRACK_HISTORY.spec(locale), "trackhistory", Permission.LOG_TRACK_HISTORY, Predicates.notInRange(1, 2));
|
super(CommandSpec.LOG_TRACK_HISTORY.spec(locale), "trackhistory", CommandPermission.LOG_TRACK_HISTORY, Predicates.notInRange(1, 2));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user