From 1d5e3205ac94ddf7bd0e6495887245a66a82fbeb Mon Sep 17 00:00:00 2001 From: Luck Date: Sat, 12 Aug 2017 19:34:11 +0200 Subject: [PATCH] Refactoring & misc cleanup --- .../luckperms/bukkit/BukkitListener.java | 2 +- .../luckperms/bukkit/LPBukkitPlugin.java | 36 +-- .../BukkitCalculatorFactory.java | 19 +- .../{ => contexts}/WorldCalculator.java | 2 +- .../migration/MigrationBPermissions.java | 12 +- .../migration/MigrationGroupManager.java | 14 +- .../migration/MigrationPermissionsEx.java | 14 +- .../migration/MigrationPowerfulPerms.java | 12 +- .../migration/MigrationZPermissions.java | 16 +- .../luckperms/bukkit/model/LPPermissible.java | 2 +- .../AttachmentProcessor.java | 4 +- .../ChildPermissionProvider.java | 2 +- .../ChildProcessor.java | 5 +- .../DefaultsProcessor.java | 5 +- .../DefaultsProvider.java | 3 +- .../luckperms/bukkit/vault/VaultChatHook.java | 10 +- .../bukkit/vault/VaultPermissionHook.java | 10 +- .../luckperms/bungee/BungeeListener.java | 2 +- .../luckperms/bungee/LPBungeePlugin.java | 24 +- .../BungeeCalculatorFactory.java | 13 +- .../BackendServerCalculator.java | 2 +- .../migration/MigrationBungeePerms.java | 14 +- .../luckperms/common/api/ApiProvider.java | 12 +- .../common/api/delegates/GroupDelegate.java | 10 +- .../api/delegates/NodeFactoryDelegate.java | 2 +- .../delegates/PermissionHolderDelegate.java | 10 +- .../common/api/delegates/TrackDelegate.java | 6 +- .../common/api/delegates/UserDelegate.java | 10 +- .../api/delegates/UuidCacheDelegate.java | 4 +- .../common/{utils => buffers}/Buffer.java | 2 +- .../{utils => buffers}/BufferedRequest.java | 2 +- .../common/{utils => buffers}/Cache.java | 2 +- .../common/bulkupdate/BulkUpdate.java | 2 +- .../common/bulkupdate/action/Action.java | 17 +- .../bulkupdate/action/DeleteAction.java | 4 +- .../bulkupdate/action/UpdateAction.java | 5 +- .../bulkupdate/comparisons/Comparison.java | 16 ++ .../comparisons/ComparisonType.java | 5 +- .../comparisons/impl/ComparisonNotEqual.java | 1 + .../impl/ComparisonNotSimilar.java | 1 + .../comparisons/impl/ComparisonSimilar.java | 2 + .../bulkupdate/constraint/Constraint.java | 17 +- .../common/caching/PermissionCache.java | 14 +- .../luckperms/common/caching/UserCache.java | 4 +- .../caching/handlers/CachedStateManager.java | 19 +- .../common/calculators/CalculatorFactory.java | 2 +- .../calculators/PermissionCalculator.java | 35 ++- .../common/commands/ArgumentPermissions.java | 58 ++--- .../common/commands/CommandManager.java | 4 +- .../common/commands/abstraction/Command.java | 10 +- .../abstraction/SharedMainCommand.java | 2 +- .../abstraction/SharedSubCommand.java | 16 +- .../commands/abstraction/SingleCommand.java | 4 +- .../commands/abstraction/SubCommand.java | 10 +- .../impl/generic/meta/CommandMeta.java | 2 +- .../impl/generic/meta/MetaAddChatMeta.java | 12 +- .../generic/meta/MetaAddTempChatMeta.java | 14 +- .../commands/impl/generic/meta/MetaClear.java | 8 +- .../commands/impl/generic/meta/MetaInfo.java | 14 +- .../impl/generic/meta/MetaRemoveChatMeta.java | 12 +- .../generic/meta/MetaRemoveTempChatMeta.java | 12 +- .../commands/impl/generic/meta/MetaSet.java | 10 +- .../impl/generic/meta/MetaSetTemp.java | 12 +- .../commands/impl/generic/meta/MetaUnset.java | 8 +- .../impl/generic/meta/MetaUnsetTemp.java | 8 +- .../impl/generic/other/HolderClear.java | 10 +- .../impl/generic/other/HolderEditor.java | 12 +- .../impl/generic/other/HolderShowTracks.java | 6 +- .../impl/generic/parent/CommandParent.java | 2 +- .../impl/generic/parent/ParentAdd.java | 10 +- .../impl/generic/parent/ParentAddTemp.java | 14 +- .../impl/generic/parent/ParentClear.java | 8 +- .../impl/generic/parent/ParentClearTrack.java | 12 +- .../impl/generic/parent/ParentInfo.java | 12 +- .../impl/generic/parent/ParentRemove.java | 12 +- .../impl/generic/parent/ParentRemoveTemp.java | 10 +- .../impl/generic/parent/ParentSet.java | 12 +- .../impl/generic/parent/ParentSetTrack.java | 12 +- .../generic/permission/CommandPermission.java | 2 +- .../generic/permission/PermissionCheck.java | 10 +- .../permission/PermissionCheckInherits.java | 12 +- .../generic/permission/PermissionInfo.java | 12 +- .../generic/permission/PermissionSet.java | 10 +- .../generic/permission/PermissionSetTemp.java | 12 +- .../generic/permission/PermissionUnset.java | 10 +- .../permission/PermissionUnsetTemp.java | 10 +- .../commands/impl/group/CreateGroup.java | 4 +- .../commands/impl/group/DeleteGroup.java | 6 +- .../commands/impl/group/GroupClone.java | 6 +- .../common/commands/impl/group/GroupInfo.java | 6 +- .../commands/impl/group/GroupListMembers.java | 8 +- .../commands/impl/group/GroupMainCommand.java | 2 +- .../commands/impl/group/GroupRename.java | 6 +- .../commands/impl/group/GroupSetWeight.java | 8 +- .../commands/impl/group/ListGroups.java | 6 +- .../commands/impl/log/LogGroupHistory.java | 4 +- .../common/commands/impl/log/LogNotify.java | 4 +- .../common/commands/impl/log/LogRecent.java | 4 +- .../common/commands/impl/log/LogSearch.java | 4 +- .../commands/impl/log/LogTrackHistory.java | 4 +- .../commands/impl/log/LogUserHistory.java | 4 +- .../impl/migration/MigrationMainCommand.java | 6 +- .../impl/migration/MigrationUtils.java | 4 +- .../commands/impl/misc/ApplyEditsCommand.java | 8 +- .../commands/impl/misc/BulkUpdateCommand.java | 4 +- .../commands/impl/misc/CheckCommand.java | 6 +- .../commands/impl/misc/ExportCommand.java | 4 +- .../commands/impl/misc/ImportCommand.java | 4 +- .../commands/impl/misc/InfoCommand.java | 4 +- .../impl/misc/NetworkSyncCommand.java | 4 +- .../impl/misc/ReloadConfigCommand.java | 4 +- .../commands/impl/misc/SearchCommand.java | 6 +- .../commands/impl/misc/SyncCommand.java | 4 +- .../commands/impl/misc/TreeCommand.java | 6 +- .../commands/impl/misc/VerboseCommand.java | 4 +- .../commands/impl/track/CreateTrack.java | 4 +- .../commands/impl/track/DeleteTrack.java | 6 +- .../commands/impl/track/ListTracks.java | 4 +- .../commands/impl/track/TrackAppend.java | 8 +- .../commands/impl/track/TrackClear.java | 6 +- .../commands/impl/track/TrackClone.java | 6 +- .../common/commands/impl/track/TrackInfo.java | 6 +- .../commands/impl/track/TrackInsert.java | 8 +- .../commands/impl/track/TrackMainCommand.java | 2 +- .../commands/impl/track/TrackRemove.java | 6 +- .../commands/impl/track/TrackRename.java | 6 +- .../common/commands/impl/user/UserDemote.java | 12 +- .../common/commands/impl/user/UserInfo.java | 6 +- .../commands/impl/user/UserMainCommand.java | 2 +- .../commands/impl/user/UserPromote.java | 12 +- .../impl/user/UserSwitchPrimaryGroup.java | 8 +- .../commands/sender/AbstractSender.java | 17 +- .../common/commands/sender/Sender.java | 4 +- .../common/commands/utils/ArgumentUtils.java | 12 - .../common/config/AbstractConfiguration.java | 19 +- .../luckperms/common/config/ConfigKey.java | 14 ++ .../luckperms/common/config/ConfigKeys.java | 6 +- .../luckperms/common/config/ContextsFile.java | 5 +- .../common/config/LuckPermsConfiguration.java | 42 +++- .../common/constants/CommandPermission.java | 210 +++++++++++++++++ .../luckperms/common/constants/Constants.java | 6 +- .../common/constants/Permission.java | 211 ------------------ .../ContextSetComparator.java | 2 +- .../ExtractedContexts.java | 2 +- ...lculator.java => LuckPermsCalculator.java} | 2 +- .../lucko/luckperms/common/data/Exporter.java | 8 +- .../lucko/luckperms/common/data/LogEntry.java | 14 +- .../common/defaults/LogicParser.java | 4 +- .../lucko/luckperms/common/defaults/Rule.java | 4 +- .../luckperms/common/event/EventFactory.java | 8 +- .../{utils => logging}/ProgressLogger.java | 2 +- .../{utils => logging}/SenderLogger.java | 2 +- .../common/managers/AbstractManager.java | 2 +- .../{impl => }/GenericGroupManager.java | 6 +- .../{impl => }/GenericTrackManager.java | 6 +- .../{impl => }/GenericUserManager.java | 10 +- .../common/managers/GroupManager.java | 2 +- .../luckperms/common/managers/Manager.java | 2 +- .../common/managers/TrackManager.java | 2 +- .../common/managers/UserManager.java | 6 +- .../messaging/AbstractMessagingService.java | 2 +- .../messaging/InternalMessagingService.java | 2 +- .../messaging/NoopMessagingService.java | 2 +- .../definition/StandardStackElements.java | 2 +- .../common/{core => }/model/Group.java | 9 +- .../{core => }/model/PermissionHolder.java | 37 ++- .../{core => model}/TemporaryModifier.java | 2 +- .../common/{core => }/model/Track.java | 4 +- .../common/{core => }/model/User.java | 13 +- .../ImmutableLocalizedNode.java | 2 +- .../{core/model => node}/ImmutableNode.java | 4 +- .../{core => node}/InheritanceInfo.java | 2 +- .../common/{core => node}/NodeBuilder.java | 3 +- .../common/{core => node}/NodeComparator.java | 4 +- .../common/{core => node}/NodeFactory.java | 4 +- .../holder => node}/NodeHeldPermission.java | 3 +- .../common/{core => node}/NodeModel.java | 2 +- .../NodePriorityComparator.java} | 12 +- .../common/{utils => node}/NodeTools.java | 2 +- .../{utils => node}/ShorthandParser.java | 2 +- .../common/plugin/LuckPermsPlugin.java | 8 +- .../AllParentsByWeightHolder.java | 6 +- .../primarygroup/ParentsByWeightHolder.java | 4 +- .../common/primarygroup/StoredHolder.java | 2 +- .../processors/MapProcessor.java | 3 +- .../PermissionProcessor.java | 20 +- .../processors/RegexProcessor.java | 3 +- .../processors/WildcardProcessor.java | 3 +- .../GroupReference.java | 9 +- .../HolderReference.java | 27 ++- .../handlers => references}/HolderType.java | 7 +- .../{utils => references}/Identifiable.java | 2 +- .../{core => references}/UserIdentifier.java | 15 +- .../UserReference.java | 10 +- .../common/storage/AbstractStorage.java | 6 +- .../common/storage/SplitBacking.java | 6 +- .../luckperms/common/storage/Storage.java | 6 +- .../common/storage/StorageFactory.java | 16 +- .../storage/backing/AbstractBacking.java | 6 +- .../{utils => file}/FileUuidCache.java | 2 +- .../backing/file}/FileWatcher.java | 2 +- .../backing/{ => file}/FlatfileBacking.java | 14 +- .../backing/{ => file}/JSONBacking.java | 16 +- .../backing/{ => file}/YAMLBacking.java | 16 +- .../LegacyJSONSchemaMigration.java | 8 +- .../LegacySQLSchemaMigration.java | 8 +- .../LegacyYAMLSchemaMigration.java | 8 +- .../backing/{ => mongodb}/MongoDBBacking.java | 19 +- .../storage/backing/{ => sql}/SQLBacking.java | 21 +- .../WrappedConnection.java | 2 +- .../provider}/FlatfileProvider.java | 4 +- .../provider}/H2Provider.java | 2 +- .../provider}/MySQLProvider.java | 3 +- .../provider}/PostgreSQLProvider.java | 3 +- .../provider}/SQLProvider.java | 4 +- .../provider}/SQLiteProvider.java | 2 +- .../wrappings/BufferedOutputStorage.java | 10 +- .../storage/wrappings/PhasedStorage.java | 6 +- .../common/tasks/CacheHousekeepingTask.java | 2 +- .../common/tasks/ExpireTemporaryTask.java | 4 +- .../luckperms/common/utils/FakeSender.java | 4 +- .../luckperms/common/utils/LoginHelper.java | 3 +- .../common/{core => utils}/UuidCache.java | 2 +- .../luckperms/sponge/LPSpongePlugin.java | 29 ++- .../luckperms/sponge/SpongeListener.java | 4 +- .../SpongeCalculatorFactory.java | 17 +- .../sponge/commands/OptionClear.java | 4 +- .../luckperms/sponge/commands/OptionInfo.java | 4 +- .../luckperms/sponge/commands/OptionSet.java | 4 +- .../sponge/commands/OptionUnset.java | 4 +- .../luckperms/sponge/commands/ParentAdd.java | 4 +- .../sponge/commands/ParentClear.java | 4 +- .../luckperms/sponge/commands/ParentInfo.java | 4 +- .../sponge/commands/ParentRemove.java | 4 +- .../sponge/commands/PermissionClear.java | 4 +- .../sponge/commands/PermissionInfo.java | 4 +- .../sponge/commands/PermissionSet.java | 4 +- .../sponge/managers/SpongeGroupManager.java | 2 +- .../sponge/managers/SpongeUserManager.java | 6 +- .../migration/MigrationPermissionManager.java | 10 +- .../migration/MigrationPermissionsEx.java | 12 +- .../migration/SpongeMigrationUtils.java | 6 +- .../luckperms/sponge/model/SpongeGroup.java | 4 +- .../luckperms/sponge/model/SpongeUser.java | 2 +- .../DefaultsProcessor.java | 4 +- .../SpongeWildcardProcessor.java | 4 +- ...va => LuckPermsPermissionDescription.java} | 2 +- .../sponge/service/LuckPermsService.java | 8 +- .../sponge/service/LuckPermsSubjectData.java | 10 +- .../calculated/CalculatedSubjectData.java | 6 +- .../LegacyDataMigrator.java | 2 +- .../SubjectDataHolder.java | 2 +- .../service/persisted/PersistedSubject.java | 2 +- .../service/storage/SubjectStorageModel.java | 10 +- .../ServiceCacheHousekeepingTask.java | 3 +- 255 files changed, 1241 insertions(+), 1114 deletions(-) rename bukkit/src/main/java/me/lucko/luckperms/bukkit/{ => calculators}/BukkitCalculatorFactory.java (87%) rename bukkit/src/main/java/me/lucko/luckperms/bukkit/{ => contexts}/WorldCalculator.java (98%) rename bukkit/src/main/java/me/lucko/luckperms/bukkit/{calculators => processors}/AttachmentProcessor.java (95%) rename bukkit/src/main/java/me/lucko/luckperms/bukkit/{model => processors}/ChildPermissionProvider.java (98%) rename bukkit/src/main/java/me/lucko/luckperms/bukkit/{calculators => processors}/ChildProcessor.java (92%) rename bukkit/src/main/java/me/lucko/luckperms/bukkit/{calculators => processors}/DefaultsProcessor.java (92%) rename bukkit/src/main/java/me/lucko/luckperms/bukkit/{model => processors}/DefaultsProvider.java (98%) rename bungee/src/main/java/me/lucko/luckperms/bungee/{ => calculators}/BungeeCalculatorFactory.java (87%) rename bungee/src/main/java/me/lucko/luckperms/bungee/{ => contexts}/BackendServerCalculator.java (98%) rename common/src/main/java/me/lucko/luckperms/common/{utils => buffers}/Buffer.java (99%) rename common/src/main/java/me/lucko/luckperms/common/{utils => buffers}/BufferedRequest.java (98%) rename common/src/main/java/me/lucko/luckperms/common/{utils => buffers}/Cache.java (98%) create mode 100644 common/src/main/java/me/lucko/luckperms/common/constants/CommandPermission.java delete mode 100644 common/src/main/java/me/lucko/luckperms/common/constants/Permission.java rename common/src/main/java/me/lucko/luckperms/common/{core => contexts}/ContextSetComparator.java (99%) rename common/src/main/java/me/lucko/luckperms/common/{utils => contexts}/ExtractedContexts.java (98%) rename common/src/main/java/me/lucko/luckperms/common/contexts/{StaticCalculator.java => LuckPermsCalculator.java} (96%) rename common/src/main/java/me/lucko/luckperms/common/{utils => logging}/ProgressLogger.java (98%) rename common/src/main/java/me/lucko/luckperms/common/{utils => logging}/SenderLogger.java (98%) rename common/src/main/java/me/lucko/luckperms/common/managers/{impl => }/GenericGroupManager.java (88%) rename common/src/main/java/me/lucko/luckperms/common/managers/{impl => }/GenericTrackManager.java (88%) rename common/src/main/java/me/lucko/luckperms/common/managers/{impl => }/GenericUserManager.java (94%) rename common/src/main/java/me/lucko/luckperms/common/{core => }/model/Group.java (89%) rename common/src/main/java/me/lucko/luckperms/common/{core => }/model/PermissionHolder.java (97%) rename common/src/main/java/me/lucko/luckperms/common/{core => model}/TemporaryModifier.java (97%) rename common/src/main/java/me/lucko/luckperms/common/{core => }/model/Track.java (98%) rename common/src/main/java/me/lucko/luckperms/common/{core => }/model/User.java (94%) rename common/src/main/java/me/lucko/luckperms/common/{utils => node}/ImmutableLocalizedNode.java (98%) rename common/src/main/java/me/lucko/luckperms/common/{core/model => node}/ImmutableNode.java (99%) rename common/src/main/java/me/lucko/luckperms/common/{core => node}/InheritanceInfo.java (98%) rename common/src/main/java/me/lucko/luckperms/common/{core => node}/NodeBuilder.java (98%) rename common/src/main/java/me/lucko/luckperms/common/{core => node}/NodeComparator.java (93%) rename common/src/main/java/me/lucko/luckperms/common/{core => node}/NodeFactory.java (99%) rename common/src/main/java/me/lucko/luckperms/common/{storage/holder => node}/NodeHeldPermission.java (96%) rename common/src/main/java/me/lucko/luckperms/common/{core => node}/NodeModel.java (99%) rename common/src/main/java/me/lucko/luckperms/common/{core/PriorityComparator.java => node/NodePriorityComparator.java} (92%) rename common/src/main/java/me/lucko/luckperms/common/{utils => node}/NodeTools.java (98%) rename common/src/main/java/me/lucko/luckperms/common/{utils => node}/ShorthandParser.java (99%) rename common/src/main/java/me/lucko/luckperms/common/{calculators => }/processors/MapProcessor.java (93%) rename common/src/main/java/me/lucko/luckperms/common/{calculators => processors}/PermissionProcessor.java (69%) rename common/src/main/java/me/lucko/luckperms/common/{calculators => }/processors/RegexProcessor.java (95%) rename common/src/main/java/me/lucko/luckperms/common/{calculators => }/processors/WildcardProcessor.java (94%) rename common/src/main/java/me/lucko/luckperms/common/{caching/handlers => references}/GroupReference.java (85%) rename common/src/main/java/me/lucko/luckperms/common/{caching/handlers => references}/HolderReference.java (69%) rename common/src/main/java/me/lucko/luckperms/common/{caching/handlers => references}/HolderType.java (94%) rename common/src/main/java/me/lucko/luckperms/common/{utils => references}/Identifiable.java (97%) rename common/src/main/java/me/lucko/luckperms/common/{core => references}/UserIdentifier.java (93%) rename common/src/main/java/me/lucko/luckperms/common/{caching/handlers => references}/UserReference.java (85%) rename common/src/main/java/me/lucko/luckperms/common/storage/backing/{utils => file}/FileUuidCache.java (98%) rename common/src/main/java/me/lucko/luckperms/common/{utils => storage/backing/file}/FileWatcher.java (98%) rename common/src/main/java/me/lucko/luckperms/common/storage/backing/{ => file}/FlatfileBacking.java (96%) rename common/src/main/java/me/lucko/luckperms/common/storage/backing/{ => file}/JSONBacking.java (98%) rename common/src/main/java/me/lucko/luckperms/common/storage/backing/{ => file}/YAMLBacking.java (98%) rename common/src/main/java/me/lucko/luckperms/common/storage/backing/{utils => legacy}/LegacyJSONSchemaMigration.java (97%) rename common/src/main/java/me/lucko/luckperms/common/storage/backing/{utils => legacy}/LegacySQLSchemaMigration.java (98%) rename common/src/main/java/me/lucko/luckperms/common/storage/backing/{utils => legacy}/LegacyYAMLSchemaMigration.java (96%) rename common/src/main/java/me/lucko/luckperms/common/storage/backing/{ => mongodb}/MongoDBBacking.java (98%) rename common/src/main/java/me/lucko/luckperms/common/storage/backing/{ => sql}/SQLBacking.java (98%) rename common/src/main/java/me/lucko/luckperms/common/storage/backing/{sqlprovider => sql}/WrappedConnection.java (96%) rename common/src/main/java/me/lucko/luckperms/common/storage/backing/{sqlprovider => sql/provider}/FlatfileProvider.java (95%) rename common/src/main/java/me/lucko/luckperms/common/storage/backing/{sqlprovider => sql/provider}/H2Provider.java (97%) rename common/src/main/java/me/lucko/luckperms/common/storage/backing/{sqlprovider => sql/provider}/MySQLProvider.java (97%) rename common/src/main/java/me/lucko/luckperms/common/storage/backing/{sqlprovider => sql/provider}/PostgreSQLProvider.java (97%) rename common/src/main/java/me/lucko/luckperms/common/storage/backing/{sqlprovider => sql/provider}/SQLProvider.java (92%) rename common/src/main/java/me/lucko/luckperms/common/storage/backing/{sqlprovider => sql/provider}/SQLiteProvider.java (97%) rename common/src/main/java/me/lucko/luckperms/common/{core => utils}/UuidCache.java (98%) rename sponge/src/main/java/me/lucko/luckperms/sponge/{ => calculators}/SpongeCalculatorFactory.java (86%) rename sponge/src/main/java/me/lucko/luckperms/sponge/{calculators => processors}/DefaultsProcessor.java (95%) rename sponge/src/main/java/me/lucko/luckperms/sponge/{calculators => processors}/SpongeWildcardProcessor.java (94%) rename sponge/src/main/java/me/lucko/luckperms/sponge/service/{SimpleDescription.java => LuckPermsPermissionDescription.java} (97%) rename sponge/src/main/java/me/lucko/luckperms/sponge/service/{legacystorage => legacy}/LegacyDataMigrator.java (98%) rename sponge/src/main/java/me/lucko/luckperms/sponge/service/{legacystorage => legacy}/SubjectDataHolder.java (98%) rename sponge/src/main/java/me/lucko/luckperms/sponge/{service => tasks}/ServiceCacheHousekeepingTask.java (94%) diff --git a/bukkit/src/main/java/me/lucko/luckperms/bukkit/BukkitListener.java b/bukkit/src/main/java/me/lucko/luckperms/bukkit/BukkitListener.java index f3935434..686a6708 100644 --- a/bukkit/src/main/java/me/lucko/luckperms/bukkit/BukkitListener.java +++ b/bukkit/src/main/java/me/lucko/luckperms/bukkit/BukkitListener.java @@ -30,8 +30,8 @@ import lombok.RequiredArgsConstructor; import me.lucko.luckperms.bukkit.model.Injector; import me.lucko.luckperms.bukkit.model.LPPermissible; 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.model.User; import me.lucko.luckperms.common.utils.LoginHelper; import org.bukkit.entity.Player; diff --git a/bukkit/src/main/java/me/lucko/luckperms/bukkit/LPBukkitPlugin.java b/bukkit/src/main/java/me/lucko/luckperms/bukkit/LPBukkitPlugin.java index ad533ac3..e1eb7ffe 100644 --- a/bukkit/src/main/java/me/lucko/luckperms/bukkit/LPBukkitPlugin.java +++ b/bukkit/src/main/java/me/lucko/luckperms/bukkit/LPBukkitPlugin.java @@ -34,51 +34,53 @@ import me.lucko.luckperms.api.PlatformType; import me.lucko.luckperms.api.context.ContextSet; import me.lucko.luckperms.api.context.ImmutableContextSet; 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.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.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.common.api.ApiHandler; 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.calculators.CalculatorFactory; import me.lucko.luckperms.common.commands.sender.Sender; import me.lucko.luckperms.common.config.ConfigKeys; 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.StaticCalculator; -import me.lucko.luckperms.common.core.UuidCache; -import me.lucko.luckperms.common.core.model.User; +import me.lucko.luckperms.common.contexts.LuckPermsCalculator; import me.lucko.luckperms.common.dependencies.Dependency; import me.lucko.luckperms.common.dependencies.DependencyManager; import me.lucko.luckperms.common.locale.LocaleManager; import me.lucko.luckperms.common.locale.NoopLocaleManager; 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.TrackManager; import me.lucko.luckperms.common.managers.UserManager; -import me.lucko.luckperms.common.managers.impl.GenericGroupManager; -import me.lucko.luckperms.common.managers.impl.GenericTrackManager; -import me.lucko.luckperms.common.managers.impl.GenericUserManager; import me.lucko.luckperms.common.messaging.InternalMessagingService; import me.lucko.luckperms.common.messaging.NoopMessagingService; 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.storage.Storage; import me.lucko.luckperms.common.storage.StorageFactory; 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.ExpireTemporaryTask; import me.lucko.luckperms.common.tasks.UpdateTask; 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.SenderLogger; +import me.lucko.luckperms.common.utils.UuidCache; import me.lucko.luckperms.common.verbose.VerboseHandler; import org.bukkit.World; @@ -287,7 +289,7 @@ public class LPBukkitPlugin extends JavaPlugin implements LuckPermsPlugin { groupManager = new GenericGroupManager(this); trackManager = new GenericTrackManager(this); calculatorFactory = new BukkitCalculatorFactory(this); - cachedStateManager = new CachedStateManager(this); + cachedStateManager = new CachedStateManager(); contextManager = new ContextManager() { @Override @@ -307,7 +309,7 @@ public class LPBukkitPlugin extends JavaPlugin implements LuckPermsPlugin { worldCalculator = new WorldCalculator(this); contextManager.registerCalculator(worldCalculator); - StaticCalculator staticCalculator = new StaticCalculator<>(getConfiguration()); + LuckPermsCalculator staticCalculator = new LuckPermsCalculator<>(getConfiguration()); contextManager.registerCalculator(staticCalculator, true); // Provide vault support @@ -665,10 +667,8 @@ public class LPBukkitPlugin extends JavaPlugin implements LuckPermsPlugin { private void registerPermissions(PermissionDefault def) { PluginManager pm = getServer().getPluginManager(); - for (Permission p : Permission.values()) { - for (String node : p.getNodes()) { - pm.addPermission(new org.bukkit.permissions.Permission(node, def)); - } + for (CommandPermission p : CommandPermission.values()) { + pm.addPermission(new org.bukkit.permissions.Permission(p.getPermission(), def)); } } } diff --git a/bukkit/src/main/java/me/lucko/luckperms/bukkit/BukkitCalculatorFactory.java b/bukkit/src/main/java/me/lucko/luckperms/bukkit/calculators/BukkitCalculatorFactory.java similarity index 87% rename from bukkit/src/main/java/me/lucko/luckperms/bukkit/BukkitCalculatorFactory.java rename to bukkit/src/main/java/me/lucko/luckperms/bukkit/calculators/BukkitCalculatorFactory.java index fb732ec5..fc6c616f 100644 --- a/bukkit/src/main/java/me/lucko/luckperms/bukkit/BukkitCalculatorFactory.java +++ b/bukkit/src/main/java/me/lucko/luckperms/bukkit/calculators/BukkitCalculatorFactory.java @@ -23,26 +23,27 @@ * SOFTWARE. */ -package me.lucko.luckperms.bukkit; +package me.lucko.luckperms.bukkit.calculators; import lombok.AllArgsConstructor; import com.google.common.collect.ImmutableList; import me.lucko.luckperms.api.Contexts; -import me.lucko.luckperms.bukkit.calculators.AttachmentProcessor; -import me.lucko.luckperms.bukkit.calculators.ChildProcessor; -import me.lucko.luckperms.bukkit.calculators.DefaultsProcessor; +import me.lucko.luckperms.bukkit.LPBukkitPlugin; import me.lucko.luckperms.bukkit.model.Injector; 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.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.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.UUID; diff --git a/bukkit/src/main/java/me/lucko/luckperms/bukkit/WorldCalculator.java b/bukkit/src/main/java/me/lucko/luckperms/bukkit/contexts/WorldCalculator.java similarity index 98% rename from bukkit/src/main/java/me/lucko/luckperms/bukkit/WorldCalculator.java rename to bukkit/src/main/java/me/lucko/luckperms/bukkit/contexts/WorldCalculator.java index 1a953ed1..4084b066 100644 --- a/bukkit/src/main/java/me/lucko/luckperms/bukkit/WorldCalculator.java +++ b/bukkit/src/main/java/me/lucko/luckperms/bukkit/contexts/WorldCalculator.java @@ -23,7 +23,7 @@ * SOFTWARE. */ -package me.lucko.luckperms.bukkit; +package me.lucko.luckperms.bukkit.contexts; import lombok.RequiredArgsConstructor; diff --git a/bukkit/src/main/java/me/lucko/luckperms/bukkit/migration/MigrationBPermissions.java b/bukkit/src/main/java/me/lucko/luckperms/bukkit/migration/MigrationBPermissions.java index c31df9e8..3fcbd1d2 100644 --- a/bukkit/src/main/java/me/lucko/luckperms/bukkit/migration/MigrationBPermissions.java +++ b/bukkit/src/main/java/me/lucko/luckperms/bukkit/migration/MigrationBPermissions.java @@ -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.impl.migration.MigrationUtils; 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.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.utils.Predicates; -import me.lucko.luckperms.common.utils.ProgressLogger; import org.bukkit.Bukkit; import org.bukkit.configuration.ConfigurationSection; @@ -59,7 +59,7 @@ import java.util.Set; import java.util.UUID; 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 { private static Field uConfigField; @@ -139,7 +139,7 @@ public class MigrationBPermissions extends SubCommand { // Make a LuckPerms group for the one being migrated. 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()); migrateHolder(world, group, lpGroup); diff --git a/bukkit/src/main/java/me/lucko/luckperms/bukkit/migration/MigrationGroupManager.java b/bukkit/src/main/java/me/lucko/luckperms/bukkit/migration/MigrationGroupManager.java index 53da05bd..3b60fcb1 100644 --- a/bukkit/src/main/java/me/lucko/luckperms/bukkit/migration/MigrationGroupManager.java +++ b/bukkit/src/main/java/me/lucko/luckperms/bukkit/migration/MigrationGroupManager.java @@ -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.impl.migration.MigrationUtils; import me.lucko.luckperms.common.commands.sender.Sender; -import me.lucko.luckperms.common.constants.Permission; -import me.lucko.luckperms.common.core.NodeFactory; +import me.lucko.luckperms.common.constants.CommandPermission; import me.lucko.luckperms.common.locale.CommandSpec; 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.utils.Predicates; -import me.lucko.luckperms.common.utils.ProgressLogger; import org.anjocaido.groupmanager.GlobalGroups; import org.anjocaido.groupmanager.GroupManager; @@ -62,7 +62,7 @@ import java.util.stream.Collectors; public class MigrationGroupManager extends SubCommand { 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 @@ -97,7 +97,7 @@ public class MigrationGroupManager extends SubCommand { String groupName = MigrationUtils.standardizeName(g.getName()); 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()) { if (node.isEmpty()) { @@ -248,7 +248,7 @@ public class MigrationGroupManager extends SubCommand { AtomicInteger groupCount = new AtomicInteger(0); for (Map.Entry> e : groups.entrySet()) { 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()) { group.setPermission(node); @@ -263,7 +263,7 @@ public class MigrationGroupManager extends SubCommand { AtomicInteger userCount = new AtomicInteger(0); for (Map.Entry> e : users.entrySet()) { 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()) { user.setPermission(node); diff --git a/bukkit/src/main/java/me/lucko/luckperms/bukkit/migration/MigrationPermissionsEx.java b/bukkit/src/main/java/me/lucko/luckperms/bukkit/migration/MigrationPermissionsEx.java index eee988e8..f52d1cbf 100644 --- a/bukkit/src/main/java/me/lucko/luckperms/bukkit/migration/MigrationPermissionsEx.java +++ b/bukkit/src/main/java/me/lucko/luckperms/bukkit/migration/MigrationPermissionsEx.java @@ -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.impl.migration.MigrationUtils; import me.lucko.luckperms.common.commands.sender.Sender; -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.constants.CommandPermission; import me.lucko.luckperms.common.locale.CommandSpec; 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.utils.Predicates; -import me.lucko.luckperms.common.utils.ProgressLogger; import org.bukkit.Bukkit; @@ -59,7 +59,7 @@ import java.util.concurrent.atomic.AtomicInteger; public class MigrationPermissionsEx extends SubCommand { 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") diff --git a/bukkit/src/main/java/me/lucko/luckperms/bukkit/migration/MigrationPowerfulPerms.java b/bukkit/src/main/java/me/lucko/luckperms/bukkit/migration/MigrationPowerfulPerms.java index 56617121..e2c617da 100644 --- a/bukkit/src/main/java/me/lucko/luckperms/bukkit/migration/MigrationPowerfulPerms.java +++ b/bukkit/src/main/java/me/lucko/luckperms/bukkit/migration/MigrationPowerfulPerms.java @@ -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.sender.Sender; 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.locale.CommandSpec; 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.storage.StorageType; import me.lucko.luckperms.common.utils.HikariSupplier; import me.lucko.luckperms.common.utils.Predicates; -import me.lucko.luckperms.common.utils.ProgressLogger; import org.bukkit.Bukkit; @@ -68,7 +68,7 @@ import java.util.UUID; import java.util.concurrent.Future; 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) public class MigrationPowerfulPerms extends SubCommand { @@ -167,7 +167,7 @@ public class MigrationPowerfulPerms extends SubCommand { final String groupName = MigrationUtils.standardizeName(g.getName()); 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()); diff --git a/bukkit/src/main/java/me/lucko/luckperms/bukkit/migration/MigrationZPermissions.java b/bukkit/src/main/java/me/lucko/luckperms/bukkit/migration/MigrationZPermissions.java index 605eb304..63cccc79 100644 --- a/bukkit/src/main/java/me/lucko/luckperms/bukkit/migration/MigrationZPermissions.java +++ b/bukkit/src/main/java/me/lucko/luckperms/bukkit/migration/MigrationZPermissions.java @@ -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.sender.Sender; import me.lucko.luckperms.common.commands.utils.Util; -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.Track; -import me.lucko.luckperms.common.core.model.User; +import me.lucko.luckperms.common.constants.CommandPermission; import me.lucko.luckperms.common.locale.CommandSpec; 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.utils.Predicates; -import me.lucko.luckperms.common.utils.ProgressLogger; import org.bukkit.Bukkit; import org.tyrannyofheaven.bukkit.zPermissions.ZPermissionsService; @@ -65,7 +65,7 @@ import java.util.concurrent.atomic.AtomicInteger; public class MigrationZPermissions extends SubCommand { 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 diff --git a/bukkit/src/main/java/me/lucko/luckperms/bukkit/model/LPPermissible.java b/bukkit/src/main/java/me/lucko/luckperms/bukkit/model/LPPermissible.java index 8c774876..8b85eef4 100644 --- a/bukkit/src/main/java/me/lucko/luckperms/bukkit/model/LPPermissible.java +++ b/bukkit/src/main/java/me/lucko/luckperms/bukkit/model/LPPermissible.java @@ -34,7 +34,7 @@ import me.lucko.luckperms.api.Tristate; import me.lucko.luckperms.bukkit.LPBukkitPlugin; import me.lucko.luckperms.common.caching.UserCache; 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.entity.Player; diff --git a/bukkit/src/main/java/me/lucko/luckperms/bukkit/calculators/AttachmentProcessor.java b/bukkit/src/main/java/me/lucko/luckperms/bukkit/processors/AttachmentProcessor.java similarity index 95% rename from bukkit/src/main/java/me/lucko/luckperms/bukkit/calculators/AttachmentProcessor.java rename to bukkit/src/main/java/me/lucko/luckperms/bukkit/processors/AttachmentProcessor.java index df449780..9e25b185 100644 --- a/bukkit/src/main/java/me/lucko/luckperms/bukkit/calculators/AttachmentProcessor.java +++ b/bukkit/src/main/java/me/lucko/luckperms/bukkit/processors/AttachmentProcessor.java @@ -23,13 +23,13 @@ * SOFTWARE. */ -package me.lucko.luckperms.bukkit.calculators; +package me.lucko.luckperms.bukkit.processors; import lombok.AllArgsConstructor; import lombok.Getter; 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; diff --git a/bukkit/src/main/java/me/lucko/luckperms/bukkit/model/ChildPermissionProvider.java b/bukkit/src/main/java/me/lucko/luckperms/bukkit/processors/ChildPermissionProvider.java similarity index 98% rename from bukkit/src/main/java/me/lucko/luckperms/bukkit/model/ChildPermissionProvider.java rename to bukkit/src/main/java/me/lucko/luckperms/bukkit/processors/ChildPermissionProvider.java index 88414cec..1b38b927 100644 --- a/bukkit/src/main/java/me/lucko/luckperms/bukkit/model/ChildPermissionProvider.java +++ b/bukkit/src/main/java/me/lucko/luckperms/bukkit/processors/ChildPermissionProvider.java @@ -23,7 +23,7 @@ * SOFTWARE. */ -package me.lucko.luckperms.bukkit.model; +package me.lucko.luckperms.bukkit.processors; import lombok.Getter; diff --git a/bukkit/src/main/java/me/lucko/luckperms/bukkit/calculators/ChildProcessor.java b/bukkit/src/main/java/me/lucko/luckperms/bukkit/processors/ChildProcessor.java similarity index 92% rename from bukkit/src/main/java/me/lucko/luckperms/bukkit/calculators/ChildProcessor.java rename to bukkit/src/main/java/me/lucko/luckperms/bukkit/processors/ChildProcessor.java index 066f2f48..80ff8542 100644 --- a/bukkit/src/main/java/me/lucko/luckperms/bukkit/calculators/ChildProcessor.java +++ b/bukkit/src/main/java/me/lucko/luckperms/bukkit/processors/ChildProcessor.java @@ -23,15 +23,14 @@ * SOFTWARE. */ -package me.lucko.luckperms.bukkit.calculators; +package me.lucko.luckperms.bukkit.processors; import lombok.RequiredArgsConstructor; import com.google.common.collect.Maps; import me.lucko.luckperms.api.Tristate; -import me.lucko.luckperms.bukkit.model.ChildPermissionProvider; -import me.lucko.luckperms.common.calculators.PermissionProcessor; +import me.lucko.luckperms.common.processors.PermissionProcessor; import java.util.Map; import java.util.concurrent.ConcurrentHashMap; diff --git a/bukkit/src/main/java/me/lucko/luckperms/bukkit/calculators/DefaultsProcessor.java b/bukkit/src/main/java/me/lucko/luckperms/bukkit/processors/DefaultsProcessor.java similarity index 92% rename from bukkit/src/main/java/me/lucko/luckperms/bukkit/calculators/DefaultsProcessor.java rename to bukkit/src/main/java/me/lucko/luckperms/bukkit/processors/DefaultsProcessor.java index 3be1c584..690efca2 100644 --- a/bukkit/src/main/java/me/lucko/luckperms/bukkit/calculators/DefaultsProcessor.java +++ b/bukkit/src/main/java/me/lucko/luckperms/bukkit/processors/DefaultsProcessor.java @@ -23,13 +23,12 @@ * SOFTWARE. */ -package me.lucko.luckperms.bukkit.calculators; +package me.lucko.luckperms.bukkit.processors; import lombok.AllArgsConstructor; import me.lucko.luckperms.api.Tristate; -import me.lucko.luckperms.bukkit.model.DefaultsProvider; -import me.lucko.luckperms.common.calculators.PermissionProcessor; +import me.lucko.luckperms.common.processors.PermissionProcessor; import org.bukkit.Bukkit; import org.bukkit.permissions.Permission; diff --git a/bukkit/src/main/java/me/lucko/luckperms/bukkit/model/DefaultsProvider.java b/bukkit/src/main/java/me/lucko/luckperms/bukkit/processors/DefaultsProvider.java similarity index 98% rename from bukkit/src/main/java/me/lucko/luckperms/bukkit/model/DefaultsProvider.java rename to bukkit/src/main/java/me/lucko/luckperms/bukkit/processors/DefaultsProvider.java index d96cf359..79e14226 100644 --- a/bukkit/src/main/java/me/lucko/luckperms/bukkit/model/DefaultsProvider.java +++ b/bukkit/src/main/java/me/lucko/luckperms/bukkit/processors/DefaultsProvider.java @@ -23,13 +23,14 @@ * SOFTWARE. */ -package me.lucko.luckperms.bukkit.model; +package me.lucko.luckperms.bukkit.processors; import lombok.Getter; import com.google.common.collect.ImmutableMap; import me.lucko.luckperms.api.Tristate; +import me.lucko.luckperms.bukkit.model.DummyPermissible; import org.bukkit.Bukkit; import org.bukkit.permissions.Permission; diff --git a/bukkit/src/main/java/me/lucko/luckperms/bukkit/vault/VaultChatHook.java b/bukkit/src/main/java/me/lucko/luckperms/bukkit/vault/VaultChatHook.java index d5b5cb61..8c37986b 100644 --- a/bukkit/src/main/java/me/lucko/luckperms/bukkit/vault/VaultChatHook.java +++ b/bukkit/src/main/java/me/lucko/luckperms/bukkit/vault/VaultChatHook.java @@ -32,11 +32,11 @@ import me.lucko.luckperms.api.Contexts; import me.lucko.luckperms.api.Node; import me.lucko.luckperms.api.caching.MetaData; import me.lucko.luckperms.common.caching.MetaAccumulator; -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.utils.ExtractedContexts; +import me.lucko.luckperms.common.contexts.ExtractedContexts; +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 net.milkbowl.vault.chat.Chat; diff --git a/bukkit/src/main/java/me/lucko/luckperms/bukkit/vault/VaultPermissionHook.java b/bukkit/src/main/java/me/lucko/luckperms/bukkit/vault/VaultPermissionHook.java index debc1ecd..7dee2417 100644 --- a/bukkit/src/main/java/me/lucko/luckperms/bukkit/vault/VaultPermissionHook.java +++ b/bukkit/src/main/java/me/lucko/luckperms/bukkit/vault/VaultPermissionHook.java @@ -37,11 +37,11 @@ import me.lucko.luckperms.api.context.ImmutableContextSet; import me.lucko.luckperms.api.context.MutableContextSet; import me.lucko.luckperms.bukkit.LPBukkitPlugin; import me.lucko.luckperms.common.config.ConfigKeys; -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.utils.ExtractedContexts; +import me.lucko.luckperms.common.contexts.ExtractedContexts; +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 net.milkbowl.vault.permission.Permission; diff --git a/bungee/src/main/java/me/lucko/luckperms/bungee/BungeeListener.java b/bungee/src/main/java/me/lucko/luckperms/bungee/BungeeListener.java index e15733a5..002dbd81 100644 --- a/bungee/src/main/java/me/lucko/luckperms/bungee/BungeeListener.java +++ b/bungee/src/main/java/me/lucko/luckperms/bungee/BungeeListener.java @@ -32,8 +32,8 @@ import me.lucko.luckperms.api.Tristate; import me.lucko.luckperms.api.context.MutableContextSet; import me.lucko.luckperms.bungee.event.TristateCheckEvent; 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.model.User; import me.lucko.luckperms.common.utils.LoginHelper; import net.md_5.bungee.api.chat.TextComponent; diff --git a/bungee/src/main/java/me/lucko/luckperms/bungee/LPBungeePlugin.java b/bungee/src/main/java/me/lucko/luckperms/bungee/LPBungeePlugin.java index 6d783c33..4c09d727 100644 --- a/bungee/src/main/java/me/lucko/luckperms/bungee/LPBungeePlugin.java +++ b/bungee/src/main/java/me/lucko/luckperms/bungee/LPBungeePlugin.java @@ -32,11 +32,14 @@ import me.lucko.luckperms.api.Logger; import me.lucko.luckperms.api.PlatformType; import me.lucko.luckperms.api.context.ContextSet; 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.RedisBungeeMessagingService; import me.lucko.luckperms.bungee.util.RedisBungeeUtil; import me.lucko.luckperms.common.api.ApiHandler; 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.calculators.CalculatorFactory; 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.LuckPermsConfiguration; import me.lucko.luckperms.common.contexts.ContextManager; -import me.lucko.luckperms.common.contexts.StaticCalculator; -import me.lucko.luckperms.common.core.UuidCache; -import me.lucko.luckperms.common.core.model.User; +import me.lucko.luckperms.common.contexts.LuckPermsCalculator; import me.lucko.luckperms.common.dependencies.Dependency; import me.lucko.luckperms.common.dependencies.DependencyManager; import me.lucko.luckperms.common.locale.LocaleManager; import me.lucko.luckperms.common.locale.NoopLocaleManager; 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.TrackManager; import me.lucko.luckperms.common.managers.UserManager; -import me.lucko.luckperms.common.managers.impl.GenericGroupManager; -import me.lucko.luckperms.common.managers.impl.GenericTrackManager; -import me.lucko.luckperms.common.managers.impl.GenericUserManager; import me.lucko.luckperms.common.messaging.InternalMessagingService; import me.lucko.luckperms.common.messaging.NoopMessagingService; 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.LuckPermsScheduler; import me.lucko.luckperms.common.storage.Storage; import me.lucko.luckperms.common.storage.StorageFactory; 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.ExpireTemporaryTask; import me.lucko.luckperms.common.tasks.UpdateTask; 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.SenderLogger; +import me.lucko.luckperms.common.utils.UuidCache; import me.lucko.luckperms.common.verbose.VerboseHandler; import net.md_5.bungee.api.connection.ProxiedPlayer; @@ -230,7 +232,7 @@ public class LPBungeePlugin extends Plugin implements LuckPermsPlugin { groupManager = new GenericGroupManager(this); trackManager = new GenericTrackManager(this); calculatorFactory = new BungeeCalculatorFactory(this); - cachedStateManager = new CachedStateManager(this); + cachedStateManager = new CachedStateManager(); contextManager = new ContextManager() { @Override @@ -250,7 +252,7 @@ public class LPBungeePlugin extends Plugin implements LuckPermsPlugin { BackendServerCalculator serverCalculator = new BackendServerCalculator(this); contextManager.registerCalculator(serverCalculator); - StaticCalculator staticCalculator = new StaticCalculator<>(getConfiguration()); + LuckPermsCalculator staticCalculator = new LuckPermsCalculator<>(getConfiguration()); contextManager.registerCalculator(staticCalculator, true); // register with the LP API diff --git a/bungee/src/main/java/me/lucko/luckperms/bungee/BungeeCalculatorFactory.java b/bungee/src/main/java/me/lucko/luckperms/bungee/calculators/BungeeCalculatorFactory.java similarity index 87% rename from bungee/src/main/java/me/lucko/luckperms/bungee/BungeeCalculatorFactory.java rename to bungee/src/main/java/me/lucko/luckperms/bungee/calculators/BungeeCalculatorFactory.java index 8612e10c..457042fc 100644 --- a/bungee/src/main/java/me/lucko/luckperms/bungee/BungeeCalculatorFactory.java +++ b/bungee/src/main/java/me/lucko/luckperms/bungee/calculators/BungeeCalculatorFactory.java @@ -23,21 +23,22 @@ * SOFTWARE. */ -package me.lucko.luckperms.bungee; +package me.lucko.luckperms.bungee.calculators; import lombok.AllArgsConstructor; import com.google.common.collect.ImmutableList; 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.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.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; diff --git a/bungee/src/main/java/me/lucko/luckperms/bungee/BackendServerCalculator.java b/bungee/src/main/java/me/lucko/luckperms/bungee/contexts/BackendServerCalculator.java similarity index 98% rename from bungee/src/main/java/me/lucko/luckperms/bungee/BackendServerCalculator.java rename to bungee/src/main/java/me/lucko/luckperms/bungee/contexts/BackendServerCalculator.java index c6f806aa..139ea18d 100644 --- a/bungee/src/main/java/me/lucko/luckperms/bungee/BackendServerCalculator.java +++ b/bungee/src/main/java/me/lucko/luckperms/bungee/contexts/BackendServerCalculator.java @@ -23,7 +23,7 @@ * SOFTWARE. */ -package me.lucko.luckperms.bungee; +package me.lucko.luckperms.bungee.contexts; import lombok.RequiredArgsConstructor; diff --git a/bungee/src/main/java/me/lucko/luckperms/bungee/migration/MigrationBungeePerms.java b/bungee/src/main/java/me/lucko/luckperms/bungee/migration/MigrationBungeePerms.java index 653a4889..6e8cbd26 100644 --- a/bungee/src/main/java/me/lucko/luckperms/bungee/migration/MigrationBungeePerms.java +++ b/bungee/src/main/java/me/lucko/luckperms/bungee/migration/MigrationBungeePerms.java @@ -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.impl.migration.MigrationUtils; import me.lucko.luckperms.common.commands.sender.Sender; -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.constants.CommandPermission; import me.lucko.luckperms.common.locale.CommandSpec; 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.utils.Predicates; -import me.lucko.luckperms.common.utils.ProgressLogger; import net.alpenblock.bungeeperms.BungeePerms; import net.alpenblock.bungeeperms.Group; @@ -53,7 +53,7 @@ import java.util.concurrent.atomic.AtomicInteger; public class MigrationBungeePerms extends SubCommand { 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 @@ -89,7 +89,7 @@ public class MigrationBungeePerms extends SubCommand { // Make a LuckPerms group for the one being migrated String groupName = MigrationUtils.standardizeName(g.getName()); 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); migrateHolder(g, g.getInheritances(), groupWeight, group); @@ -114,7 +114,7 @@ public class MigrationBungeePerms extends SubCommand { // Make a LuckPerms user for the one being migrated. 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); diff --git a/common/src/main/java/me/lucko/luckperms/common/api/ApiProvider.java b/common/src/main/java/me/lucko/luckperms/common/api/ApiProvider.java index 1854c163..2fa8efbb 100644 --- a/common/src/main/java/me/lucko/luckperms/common/api/ApiProvider.java +++ b/common/src/main/java/me/lucko/luckperms/common/api/ApiProvider.java @@ -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.NodeFactoryDelegate; 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.LuckPermsEventBus; import me.lucko.luckperms.common.messaging.InternalMessagingService; import me.lucko.luckperms.common.messaging.NoopMessagingService; import me.lucko.luckperms.common.plugin.LuckPermsPlugin; +import me.lucko.luckperms.common.references.UserIdentifier; import java.util.Optional; import java.util.Set; @@ -128,7 +128,7 @@ public class ApiProvider implements LuckPermsApi { @Override 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(); } @@ -139,7 +139,7 @@ public class ApiProvider implements LuckPermsApi { @Override 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(); } @@ -165,7 +165,7 @@ public class ApiProvider implements LuckPermsApi { @Override 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(); } @@ -186,7 +186,7 @@ public class ApiProvider implements LuckPermsApi { @Override 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(); } @@ -212,7 +212,7 @@ public class ApiProvider implements LuckPermsApi { @Override 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") diff --git a/common/src/main/java/me/lucko/luckperms/common/api/delegates/GroupDelegate.java b/common/src/main/java/me/lucko/luckperms/common/api/delegates/GroupDelegate.java index 652a34d2..9a6bf145 100644 --- a/common/src/main/java/me/lucko/luckperms/common/api/delegates/GroupDelegate.java +++ b/common/src/main/java/me/lucko/luckperms/common/api/delegates/GroupDelegate.java @@ -34,7 +34,7 @@ import com.google.common.base.Preconditions; import me.lucko.luckperms.api.Group; import me.lucko.luckperms.api.Node; 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.ObjectLacksException; @@ -45,18 +45,18 @@ import java.util.stream.Collectors; 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 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."); return ((GroupDelegate) g).getHandle(); } @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); this.handle = handle; } diff --git a/common/src/main/java/me/lucko/luckperms/common/api/delegates/NodeFactoryDelegate.java b/common/src/main/java/me/lucko/luckperms/common/api/delegates/NodeFactoryDelegate.java index 4edee6d1..5786ee67 100644 --- a/common/src/main/java/me/lucko/luckperms/common/api/delegates/NodeFactoryDelegate.java +++ b/common/src/main/java/me/lucko/luckperms/common/api/delegates/NodeFactoryDelegate.java @@ -30,7 +30,7 @@ import lombok.NonNull; import me.lucko.luckperms.api.ChatMetaType; import me.lucko.luckperms.api.Group; 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 static final NodeFactoryDelegate INSTANCE = new NodeFactoryDelegate(); diff --git a/common/src/main/java/me/lucko/luckperms/common/api/delegates/PermissionHolderDelegate.java b/common/src/main/java/me/lucko/luckperms/common/api/delegates/PermissionHolderDelegate.java index f786d7d1..3afe7604 100644 --- a/common/src/main/java/me/lucko/luckperms/common/api/delegates/PermissionHolderDelegate.java +++ b/common/src/main/java/me/lucko/luckperms/common/api/delegates/PermissionHolderDelegate.java @@ -39,9 +39,9 @@ import me.lucko.luckperms.api.PermissionHolder; import me.lucko.luckperms.api.Tristate; import me.lucko.luckperms.api.context.ContextSet; import me.lucko.luckperms.api.context.MutableContextSet; -import me.lucko.luckperms.common.core.NodeFactory; -import me.lucko.luckperms.common.core.model.User; -import me.lucko.luckperms.common.utils.ExtractedContexts; +import me.lucko.luckperms.common.contexts.ExtractedContexts; +import me.lucko.luckperms.common.model.User; +import me.lucko.luckperms.common.node.NodeFactory; import me.lucko.luckperms.exceptions.ObjectAlreadyHasException; import me.lucko.luckperms.exceptions.ObjectLacksException; @@ -56,11 +56,11 @@ import java.util.function.Predicate; 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 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 public String getObjectName() { diff --git a/common/src/main/java/me/lucko/luckperms/common/api/delegates/TrackDelegate.java b/common/src/main/java/me/lucko/luckperms/common/api/delegates/TrackDelegate.java index 6f0a9305..d640b7f7 100644 --- a/common/src/main/java/me/lucko/luckperms/common/api/delegates/TrackDelegate.java +++ b/common/src/main/java/me/lucko/luckperms/common/api/delegates/TrackDelegate.java @@ -40,17 +40,17 @@ import me.lucko.luckperms.exceptions.ObjectLacksException; 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 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."); return ((TrackDelegate) g).getHandle(); } @Getter(AccessLevel.PACKAGE) - private final me.lucko.luckperms.common.core.model.Track handle; + private final me.lucko.luckperms.common.model.Track handle; @Override public String getName() { diff --git a/common/src/main/java/me/lucko/luckperms/common/api/delegates/UserDelegate.java b/common/src/main/java/me/lucko/luckperms/common/api/delegates/UserDelegate.java index a4d0fdf4..16fc2623 100644 --- a/common/src/main/java/me/lucko/luckperms/common/api/delegates/UserDelegate.java +++ b/common/src/main/java/me/lucko/luckperms/common/api/delegates/UserDelegate.java @@ -35,7 +35,7 @@ import me.lucko.luckperms.api.Node; import me.lucko.luckperms.api.User; import me.lucko.luckperms.api.caching.UserData; 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.ObjectLacksException; @@ -47,18 +47,18 @@ import java.util.stream.Collectors; 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 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."); return ((UserDelegate) u).getHandle(); } @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); this.handle = handle; } diff --git a/common/src/main/java/me/lucko/luckperms/common/api/delegates/UuidCacheDelegate.java b/common/src/main/java/me/lucko/luckperms/common/api/delegates/UuidCacheDelegate.java index e9e571f3..67f1f156 100644 --- a/common/src/main/java/me/lucko/luckperms/common/api/delegates/UuidCacheDelegate.java +++ b/common/src/main/java/me/lucko/luckperms/common/api/delegates/UuidCacheDelegate.java @@ -33,11 +33,11 @@ import me.lucko.luckperms.api.UuidCache; 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 public class UuidCacheDelegate implements UuidCache { - private final me.lucko.luckperms.common.core.UuidCache handle; + private final me.lucko.luckperms.common.utils.UuidCache handle; @Override public UUID getUUID(@NonNull UUID external) { diff --git a/common/src/main/java/me/lucko/luckperms/common/utils/Buffer.java b/common/src/main/java/me/lucko/luckperms/common/buffers/Buffer.java similarity index 99% rename from common/src/main/java/me/lucko/luckperms/common/utils/Buffer.java rename to common/src/main/java/me/lucko/luckperms/common/buffers/Buffer.java index 48bf765d..37a87e61 100644 --- a/common/src/main/java/me/lucko/luckperms/common/utils/Buffer.java +++ b/common/src/main/java/me/lucko/luckperms/common/buffers/Buffer.java @@ -23,7 +23,7 @@ * SOFTWARE. */ -package me.lucko.luckperms.common.utils; +package me.lucko.luckperms.common.buffers; import lombok.AllArgsConstructor; import lombok.EqualsAndHashCode; diff --git a/common/src/main/java/me/lucko/luckperms/common/utils/BufferedRequest.java b/common/src/main/java/me/lucko/luckperms/common/buffers/BufferedRequest.java similarity index 98% rename from common/src/main/java/me/lucko/luckperms/common/utils/BufferedRequest.java rename to common/src/main/java/me/lucko/luckperms/common/buffers/BufferedRequest.java index 97daadcd..d29b7e01 100644 --- a/common/src/main/java/me/lucko/luckperms/common/utils/BufferedRequest.java +++ b/common/src/main/java/me/lucko/luckperms/common/buffers/BufferedRequest.java @@ -23,7 +23,7 @@ * SOFTWARE. */ -package me.lucko.luckperms.common.utils; +package me.lucko.luckperms.common.buffers; import lombok.Getter; import lombok.RequiredArgsConstructor; diff --git a/common/src/main/java/me/lucko/luckperms/common/utils/Cache.java b/common/src/main/java/me/lucko/luckperms/common/buffers/Cache.java similarity index 98% rename from common/src/main/java/me/lucko/luckperms/common/utils/Cache.java rename to common/src/main/java/me/lucko/luckperms/common/buffers/Cache.java index 9525f646..18c83386 100644 --- a/common/src/main/java/me/lucko/luckperms/common/utils/Cache.java +++ b/common/src/main/java/me/lucko/luckperms/common/buffers/Cache.java @@ -23,7 +23,7 @@ * SOFTWARE. */ -package me.lucko.luckperms.common.utils; +package me.lucko.luckperms.common.buffers; import lombok.RequiredArgsConstructor; diff --git a/common/src/main/java/me/lucko/luckperms/common/bulkupdate/BulkUpdate.java b/common/src/main/java/me/lucko/luckperms/common/bulkupdate/BulkUpdate.java index f46fa77a..70270c76 100644 --- a/common/src/main/java/me/lucko/luckperms/common/bulkupdate/BulkUpdate.java +++ b/common/src/main/java/me/lucko/luckperms/common/bulkupdate/BulkUpdate.java @@ -32,7 +32,7 @@ import lombok.ToString; import me.lucko.luckperms.common.bulkupdate.action.Action; 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; diff --git a/common/src/main/java/me/lucko/luckperms/common/bulkupdate/action/Action.java b/common/src/main/java/me/lucko/luckperms/common/bulkupdate/action/Action.java index 31a55f15..eca6182d 100644 --- a/common/src/main/java/me/lucko/luckperms/common/bulkupdate/action/Action.java +++ b/common/src/main/java/me/lucko/luckperms/common/bulkupdate/action/Action.java @@ -25,10 +25,18 @@ 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 { + /** + * Gets the name of this action + * + * @return the name of the action + */ String getName(); /** @@ -39,6 +47,13 @@ public interface Action { */ 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(); } diff --git a/common/src/main/java/me/lucko/luckperms/common/bulkupdate/action/DeleteAction.java b/common/src/main/java/me/lucko/luckperms/common/bulkupdate/action/DeleteAction.java index 76320c0e..b2a6b65f 100644 --- a/common/src/main/java/me/lucko/luckperms/common/bulkupdate/action/DeleteAction.java +++ b/common/src/main/java/me/lucko/luckperms/common/bulkupdate/action/DeleteAction.java @@ -27,7 +27,7 @@ package me.lucko.luckperms.common.bulkupdate.action; import lombok.AllArgsConstructor; -import me.lucko.luckperms.common.core.NodeModel; +import me.lucko.luckperms.common.node.NodeModel; @AllArgsConstructor(staticName = "create") public class DeleteAction implements Action { @@ -39,7 +39,7 @@ public class DeleteAction implements Action { @Override public NodeModel apply(NodeModel from) { - return null; + return null; // this action just deletes nodes, so return null } @Override diff --git a/common/src/main/java/me/lucko/luckperms/common/bulkupdate/action/UpdateAction.java b/common/src/main/java/me/lucko/luckperms/common/bulkupdate/action/UpdateAction.java index 33af350b..3d6cb732 100644 --- a/common/src/main/java/me/lucko/luckperms/common/bulkupdate/action/UpdateAction.java +++ b/common/src/main/java/me/lucko/luckperms/common/bulkupdate/action/UpdateAction.java @@ -29,12 +29,15 @@ import lombok.AllArgsConstructor; import me.lucko.luckperms.common.bulkupdate.BulkUpdate; 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") public class UpdateAction implements Action { + // the field we're updating private final QueryField field; + + // the new value of the field private final String value; @Override diff --git a/common/src/main/java/me/lucko/luckperms/common/bulkupdate/comparisons/Comparison.java b/common/src/main/java/me/lucko/luckperms/common/bulkupdate/comparisons/Comparison.java index e8ac09d1..20ad5661 100644 --- a/common/src/main/java/me/lucko/luckperms/common/bulkupdate/comparisons/Comparison.java +++ b/common/src/main/java/me/lucko/luckperms/common/bulkupdate/comparisons/Comparison.java @@ -25,10 +25,26 @@ package me.lucko.luckperms.common.bulkupdate.comparisons; +/** + * A method of comparing two strings + */ public interface Comparison { + /** + * Gets the symbol which represents this comparison + * + * @return the comparison symbol + */ 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); } diff --git a/common/src/main/java/me/lucko/luckperms/common/bulkupdate/comparisons/ComparisonType.java b/common/src/main/java/me/lucko/luckperms/common/bulkupdate/comparisons/ComparisonType.java index 684773a5..a55fa67c 100644 --- a/common/src/main/java/me/lucko/luckperms/common/bulkupdate/comparisons/ComparisonType.java +++ b/common/src/main/java/me/lucko/luckperms/common/bulkupdate/comparisons/ComparisonType.java @@ -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.ComparisonSimilar; +/** + * An enumeration of all {@link Comparison}s. + */ @AllArgsConstructor public enum ComparisonType { @@ -47,7 +50,7 @@ public enum ComparisonType { return symbol; } - public Comparison get() { + public Comparison getComparison() { return instance; } diff --git a/common/src/main/java/me/lucko/luckperms/common/bulkupdate/comparisons/impl/ComparisonNotEqual.java b/common/src/main/java/me/lucko/luckperms/common/bulkupdate/comparisons/impl/ComparisonNotEqual.java index 5ea4118c..10d96834 100644 --- a/common/src/main/java/me/lucko/luckperms/common/bulkupdate/comparisons/impl/ComparisonNotEqual.java +++ b/common/src/main/java/me/lucko/luckperms/common/bulkupdate/comparisons/impl/ComparisonNotEqual.java @@ -38,4 +38,5 @@ public class ComparisonNotEqual implements Comparison { public boolean matches(String str, String expr) { return !str.equalsIgnoreCase(expr); } + } diff --git a/common/src/main/java/me/lucko/luckperms/common/bulkupdate/comparisons/impl/ComparisonNotSimilar.java b/common/src/main/java/me/lucko/luckperms/common/bulkupdate/comparisons/impl/ComparisonNotSimilar.java index 56298e55..a92410a1 100644 --- a/common/src/main/java/me/lucko/luckperms/common/bulkupdate/comparisons/impl/ComparisonNotSimilar.java +++ b/common/src/main/java/me/lucko/luckperms/common/bulkupdate/comparisons/impl/ComparisonNotSimilar.java @@ -46,4 +46,5 @@ public class ComparisonNotSimilar implements Comparison { return !str.toLowerCase().matches(expr); } + } diff --git a/common/src/main/java/me/lucko/luckperms/common/bulkupdate/comparisons/impl/ComparisonSimilar.java b/common/src/main/java/me/lucko/luckperms/common/bulkupdate/comparisons/impl/ComparisonSimilar.java index 67628637..8afccff2 100644 --- a/common/src/main/java/me/lucko/luckperms/common/bulkupdate/comparisons/impl/ComparisonSimilar.java +++ b/common/src/main/java/me/lucko/luckperms/common/bulkupdate/comparisons/impl/ComparisonSimilar.java @@ -28,6 +28,7 @@ package me.lucko.luckperms.common.bulkupdate.comparisons.impl; import me.lucko.luckperms.common.bulkupdate.comparisons.Comparison; public class ComparisonSimilar implements Comparison { + @Override public String getSymbol() { return "~~"; @@ -45,4 +46,5 @@ public class ComparisonSimilar implements Comparison { return str.toLowerCase().matches(expr); } + } diff --git a/common/src/main/java/me/lucko/luckperms/common/bulkupdate/constraint/Constraint.java b/common/src/main/java/me/lucko/luckperms/common/bulkupdate/constraint/Constraint.java index f1033c22..653641a9 100644 --- a/common/src/main/java/me/lucko/luckperms/common/bulkupdate/constraint/Constraint.java +++ b/common/src/main/java/me/lucko/luckperms/common/bulkupdate/constraint/Constraint.java @@ -30,7 +30,7 @@ import lombok.Getter; import me.lucko.luckperms.common.bulkupdate.BulkUpdate; 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 @@ -43,7 +43,7 @@ public class Constraint { private final QueryField field; // the comparison type being used in this constraint - private final ComparisonType comparison; + private final ComparisonType comparisonType; // the expression being compared against private final String value; @@ -57,23 +57,18 @@ public class Constraint { public boolean isSatisfiedBy(NodeModel node) { switch (field) { case PERMISSION: - return comparison.get().matches(node.getPermission(), value); + return comparisonType.getComparison().matches(node.getPermission(), value); case SERVER: - return comparison.get().matches(node.getServer(), value); + return comparisonType.getComparison().matches(node.getServer(), value); case WORLD: - return comparison.get().matches(node.getWorld(), value); + return comparisonType.getComparison().matches(node.getWorld(), value); default: throw new RuntimeException(); } } public String getAsSql() { - // WHERE permission = "thing" - // WHERE permission != "" - // WHERE permission LIKE "" - // WHERE permission NOT LIKE "" - - switch (comparison) { + switch (comparisonType) { case EQUAL: return field.getSqlName() + " = " + BulkUpdate.escapeStringForSql(value); case NOT_EQUAL: diff --git a/common/src/main/java/me/lucko/luckperms/common/caching/PermissionCache.java b/common/src/main/java/me/lucko/luckperms/common/caching/PermissionCache.java index c2bb3044..1b8a6cac 100644 --- a/common/src/main/java/me/lucko/luckperms/common/caching/PermissionCache.java +++ b/common/src/main/java/me/lucko/luckperms/common/caching/PermissionCache.java @@ -27,15 +27,14 @@ package me.lucko.luckperms.common.caching; import lombok.NonNull; -import com.google.common.collect.ImmutableMap; - import me.lucko.luckperms.api.Contexts; import me.lucko.luckperms.api.Tristate; import me.lucko.luckperms.api.caching.PermissionData; import me.lucko.luckperms.common.calculators.CalculatorFactory; 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.concurrent.ConcurrentHashMap; @@ -49,6 +48,11 @@ public class PermissionCache implements PermissionData { */ private final Map permissions; + /** + * An immutable copy of {@link #permissions} + */ + private final Map permissionsUnmodifiable; + /** * 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 @@ -58,6 +62,8 @@ public class PermissionCache implements PermissionData { public PermissionCache(Contexts contexts, User user, CalculatorFactory calculatorFactory) { permissions = new ConcurrentHashMap<>(); + permissionsUnmodifiable = Collections.unmodifiableMap(permissions); + calculator = calculatorFactory.build(contexts, user); calculator.updateBacking(permissions); // Initial setup. } @@ -82,7 +88,7 @@ public class PermissionCache implements PermissionData { @Override public Map getImmutableBacking() { - return ImmutableMap.copyOf(permissions); + return permissionsUnmodifiable; } @Override diff --git a/common/src/main/java/me/lucko/luckperms/common/caching/UserCache.java b/common/src/main/java/me/lucko/luckperms/common/caching/UserCache.java index c0a57706..8181a428 100644 --- a/common/src/main/java/me/lucko/luckperms/common/caching/UserCache.java +++ b/common/src/main/java/me/lucko/luckperms/common/caching/UserCache.java @@ -40,10 +40,10 @@ import me.lucko.luckperms.api.caching.MetaData; import me.lucko.luckperms.api.caching.PermissionData; import me.lucko.luckperms.api.caching.UserData; 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.model.User; import me.lucko.luckperms.common.plugin.LuckPermsPlugin; -import me.lucko.luckperms.common.utils.ExtractedContexts; import java.util.Set; import java.util.concurrent.TimeUnit; diff --git a/common/src/main/java/me/lucko/luckperms/common/caching/handlers/CachedStateManager.java b/common/src/main/java/me/lucko/luckperms/common/caching/handlers/CachedStateManager.java index 71ff1ea8..73e5be69 100644 --- a/common/src/main/java/me/lucko/luckperms/common/caching/handlers/CachedStateManager.java +++ b/common/src/main/java/me/lucko/luckperms/common/caching/handlers/CachedStateManager.java @@ -25,12 +25,10 @@ package me.lucko.luckperms.common.caching.handlers; -import lombok.RequiredArgsConstructor; - import com.google.common.collect.HashMultimap; 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.Set; @@ -39,11 +37,7 @@ import java.util.concurrent.locks.ReentrantLock; /** * Manages the cached state of all permission holders */ -@RequiredArgsConstructor public class CachedStateManager { - // private static final Consumer INVALIDATE_CONSUMER = PermissionHolder::invalidateInheritanceCaches; - - private final LuckPermsPlugin plugin; // Group --> Groups/Users that inherit from that group. (reverse relationship) private final Multimap map = HashMultimap.create(); @@ -118,15 +112,4 @@ public class CachedStateManager { } } - /* - public void invalidateInheritances(HolderReference holder) { - Set toInvalidate = getInheritances(holder); - invalidateInheritances(plugin, toInvalidate); - } - - public static void invalidateInheritances(LuckPermsPlugin plugin, Set references) { - references.forEach(hr -> hr.apply(plugin, INVALIDATE_CONSUMER)); - } - */ - } diff --git a/common/src/main/java/me/lucko/luckperms/common/calculators/CalculatorFactory.java b/common/src/main/java/me/lucko/luckperms/common/calculators/CalculatorFactory.java index cc89d78e..d66e085e 100644 --- a/common/src/main/java/me/lucko/luckperms/common/calculators/CalculatorFactory.java +++ b/common/src/main/java/me/lucko/luckperms/common/calculators/CalculatorFactory.java @@ -26,7 +26,7 @@ package me.lucko.luckperms.common.calculators; 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; diff --git a/common/src/main/java/me/lucko/luckperms/common/calculators/PermissionCalculator.java b/common/src/main/java/me/lucko/luckperms/common/calculators/PermissionCalculator.java index 1354274f..2bce7a3b 100644 --- a/common/src/main/java/me/lucko/luckperms/common/calculators/PermissionCalculator.java +++ b/common/src/main/java/me/lucko/luckperms/common/calculators/PermissionCalculator.java @@ -32,6 +32,7 @@ import com.github.benmanes.caffeine.cache.LoadingCache; import me.lucko.luckperms.api.Tristate; import me.lucko.luckperms.common.plugin.LuckPermsPlugin; +import me.lucko.luckperms.common.processors.PermissionProcessor; import java.util.List; import java.util.Map; @@ -45,28 +46,44 @@ public class PermissionCalculator { private final String objectName; private final List processors; - private final LoadingCache cache = Caffeine.newBuilder().build(this::lookupPermissionValue); + // caches lookup calls. + private final LoadingCache lookupCache = Caffeine.newBuilder() + .build(this::lookupPermissionValue); public void invalidateCache() { - cache.invalidateAll(); + lookupCache.invalidateAll(); } 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(); - Tristate t = cache.get(permission); - plugin.getVerboseHandler().offer(objectName, permission, t); - plugin.getPermissionVault().offer(permission); - return t; + + // get the result + Tristate result = lookupCache.get(permission); + + // log this permission lookup to the verbose handler + plugin.getVerboseHandler().offer(objectName, permission, result); + + // return the result + return result; } 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) { - Tristate v = processor.hasPermission(permission); - if (v == Tristate.UNDEFINED) { + Tristate result = processor.hasPermission(permission); + if (result == Tristate.UNDEFINED) { continue; } - return v; + return result; } return Tristate.UNDEFINED; diff --git a/common/src/main/java/me/lucko/luckperms/common/commands/ArgumentPermissions.java b/common/src/main/java/me/lucko/luckperms/common/commands/ArgumentPermissions.java index 34e4e492..7f6cb04c 100644 --- a/common/src/main/java/me/lucko/luckperms/common/commands/ArgumentPermissions.java +++ b/common/src/main/java/me/lucko/luckperms/common/commands/ArgumentPermissions.java @@ -31,10 +31,10 @@ import me.lucko.luckperms.api.Tristate; import me.lucko.luckperms.api.context.ContextSet; import me.lucko.luckperms.common.commands.sender.Sender; import me.lucko.luckperms.common.config.ConfigKeys; -import me.lucko.luckperms.common.constants.Permission; -import me.lucko.luckperms.common.core.model.Group; -import me.lucko.luckperms.common.core.model.Track; -import me.lucko.luckperms.common.core.model.User; +import me.lucko.luckperms.common.constants.CommandPermission; +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 java.util.Map; @@ -43,20 +43,20 @@ import java.util.function.Function; @UtilityClass public class ArgumentPermissions { - private static final String USER_MODIFY_SELF = Permission.ROOT + "modify.user.self"; - private static final String USER_MODIFY_OTHERS = Permission.ROOT + "modify.user.others"; - private static final Function GROUP_MODIFY = s -> Permission.ROOT + "modify.group." + s; - private static final Function TRACK_MODIFY = s -> Permission.ROOT + "modify.track." + s; + private static final String USER_MODIFY_SELF = CommandPermission.ROOT + "modify.user.self"; + private static final String USER_MODIFY_OTHERS = CommandPermission.ROOT + "modify.user.others"; + private static final Function GROUP_MODIFY = s -> CommandPermission.ROOT + "modify.group." + s; + private static final Function 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_OTHERS = Permission.ROOT + "view.user.others"; - private static final Function GROUP_VIEW = s -> Permission.ROOT + "view.group." + s; - private static final Function TRACK_VIEW = s -> Permission.ROOT + "view.track." + s; + private static final String USER_VIEW_SELF = CommandPermission.ROOT + "view.user.self"; + private static final String USER_VIEW_OTHERS = CommandPermission.ROOT + "view.user.others"; + private static final Function GROUP_VIEW = s -> CommandPermission.ROOT + "view.group." + s; + private static final Function TRACK_VIEW = s -> CommandPermission.ROOT + "view.track." + s; - private static final String CONTEXT_USE_GLOBAL = Permission.ROOT + "usecontext.global"; - private static final BiFunction CONTEXT_USE = (k, v) -> Permission.ROOT + "usecontext." + k + "." + v; + private static final String CONTEXT_USE_GLOBAL = CommandPermission.ROOT + "usecontext.global"; + private static final BiFunction 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)) { return false; } @@ -65,7 +65,7 @@ public class ArgumentPermissions { throw new IllegalStateException(); } - StringBuilder permission = new StringBuilder(base.getPrimaryPermission()); + StringBuilder permission = new StringBuilder(base.getPermission()); for (String arg : args) { permission.append(".").append(arg); } @@ -73,7 +73,7 @@ public class ArgumentPermissions { 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)) { return false; } @@ -83,7 +83,7 @@ public class ArgumentPermissions { if (plugin.getUuidCache().getExternalUUID(targetUser.getUuid()).equals(sender.getUuid())) { // 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) { return !ret.asBoolean(); } else { @@ -93,7 +93,7 @@ public class ArgumentPermissions { } } else { // 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) { return !ret.asBoolean(); } else { @@ -105,7 +105,7 @@ public class ArgumentPermissions { } else if (target instanceof Group) { 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) { return !ret.asBoolean(); } else { @@ -116,7 +116,7 @@ public class ArgumentPermissions { } else if (target instanceof Track) { 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) { return !ret.asBoolean(); } 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)) { return false; } @@ -139,7 +139,7 @@ public class ArgumentPermissions { if (plugin.getUuidCache().getExternalUUID(targetUser.getUuid()).equals(sender.getUuid())) { // 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) { return !ret.asBoolean(); } else { @@ -149,7 +149,7 @@ public class ArgumentPermissions { } } else { // 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) { return !ret.asBoolean(); } else { @@ -161,7 +161,7 @@ public class ArgumentPermissions { } else if (target instanceof Group) { 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) { return !ret.asBoolean(); } else { @@ -172,7 +172,7 @@ public class ArgumentPermissions { } else if (target instanceof Track) { 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) { return !ret.asBoolean(); } else { @@ -185,13 +185,13 @@ public class ArgumentPermissions { 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)) { return false; } if (contextSet.isEmpty()) { - Tristate ret = sender.getPermissionValue(base.getPrimaryPermission() + ".usecontext.global"); + Tristate ret = sender.getPermissionValue(base.getPermission() + ".usecontext.global"); if (ret != Tristate.UNDEFINED) { return !ret.asBoolean(); } else { @@ -202,7 +202,7 @@ public class ArgumentPermissions { } for (Map.Entry 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.FALSE) { return true; diff --git a/common/src/main/java/me/lucko/luckperms/common/commands/CommandManager.java b/common/src/main/java/me/lucko/luckperms/common/commands/CommandManager.java index 25257dd7..e185058b 100644 --- a/common/src/main/java/me/lucko/luckperms/common/commands/CommandManager.java +++ b/common/src/main/java/me/lucko/luckperms/common/commands/CommandManager.java @@ -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.utils.ArgumentUtils; 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.Permission; import me.lucko.luckperms.common.locale.LocaleManager; import me.lucko.luckperms.common.locale.Message; import me.lucko.luckperms.common.plugin.LuckPermsPlugin; @@ -253,7 +253,7 @@ public class CommandManager { .filter(c -> c.isAuthorized(sender)) .forEach(c -> { @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) .applyRecursively(comp -> { diff --git a/common/src/main/java/me/lucko/luckperms/common/commands/abstraction/Command.java b/common/src/main/java/me/lucko/luckperms/common/commands/abstraction/Command.java index c711e933..ab1fdf28 100644 --- a/common/src/main/java/me/lucko/luckperms/common/commands/abstraction/Command.java +++ b/common/src/main/java/me/lucko/luckperms/common/commands/abstraction/Command.java @@ -33,7 +33,7 @@ import me.lucko.luckperms.common.commands.Arg; import me.lucko.luckperms.common.commands.CommandException; import me.lucko.luckperms.common.commands.CommandResult; 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.plugin.LuckPermsPlugin; @@ -62,7 +62,7 @@ public abstract class Command { /** * 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 @@ -75,7 +75,7 @@ public abstract class Command { */ private final List> children; - public Command(LocalizedSpec spec, String name, Permission permission, Predicate argumentCheck, List> children) { + public Command(LocalizedSpec spec, String name, CommandPermission permission, Predicate argumentCheck, List> children) { this.spec = spec; this.name = name; this.permission = permission; @@ -83,7 +83,7 @@ public abstract class Command { this.children = children == null ? null : ImmutableList.copyOf(children); } - public Command(LocalizedSpec spec, String name, Permission permission, Predicate argumentCheck) { + public Command(LocalizedSpec spec, String name, CommandPermission permission, Predicate argumentCheck) { this(spec, name, permission, argumentCheck, null); } @@ -152,7 +152,7 @@ public abstract class Command { return usage == null ? "" : usage; } - public Optional getPermission() { + public Optional getPermission() { return Optional.ofNullable(permission); } diff --git a/common/src/main/java/me/lucko/luckperms/common/commands/abstraction/SharedMainCommand.java b/common/src/main/java/me/lucko/luckperms/common/commands/abstraction/SharedMainCommand.java index df515898..fc52ba89 100644 --- a/common/src/main/java/me/lucko/luckperms/common/commands/abstraction/SharedMainCommand.java +++ b/common/src/main/java/me/lucko/luckperms/common/commands/abstraction/SharedMainCommand.java @@ -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.utils.ArgumentUtils; 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.Message; +import me.lucko.luckperms.common.model.PermissionHolder; import me.lucko.luckperms.common.plugin.LuckPermsPlugin; import me.lucko.luckperms.common.utils.Predicates; diff --git a/common/src/main/java/me/lucko/luckperms/common/commands/abstraction/SharedSubCommand.java b/common/src/main/java/me/lucko/luckperms/common/commands/abstraction/SharedSubCommand.java index ff419967..314c44c4 100644 --- a/common/src/main/java/me/lucko/luckperms/common/commands/abstraction/SharedSubCommand.java +++ b/common/src/main/java/me/lucko/luckperms/common/commands/abstraction/SharedSubCommand.java @@ -32,11 +32,11 @@ import me.lucko.luckperms.common.commands.CommandException; import me.lucko.luckperms.common.commands.CommandResult; import me.lucko.luckperms.common.commands.sender.Sender; import me.lucko.luckperms.common.commands.utils.Util; -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.User; +import me.lucko.luckperms.common.constants.CommandPermission; 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 java.util.Collections; @@ -60,15 +60,15 @@ public abstract class SharedSubCommand { /** * The permission needed to use this command */ - private final Permission userPermission; - private final Permission groupPermission; + private final CommandPermission userPermission; + private final CommandPermission groupPermission; /** * Predicate to test if the argument length given is invalid */ private final Predicate argumentCheck; - public SharedSubCommand(LocalizedSpec spec, String name, Permission userPermission, Permission groupPermission, Predicate argumentCheck) { + public SharedSubCommand(LocalizedSpec spec, String name, CommandPermission userPermission, CommandPermission groupPermission, Predicate argumentCheck) { this.spec = spec; this.name = name; this.userPermission = userPermission; @@ -76,7 +76,7 @@ public abstract class SharedSubCommand { this.argumentCheck = argumentCheck; } - public abstract CommandResult execute(LuckPermsPlugin plugin, Sender sender, PermissionHolder holder, List args, String label, Permission permission) throws CommandException; + public abstract CommandResult execute(LuckPermsPlugin plugin, Sender sender, PermissionHolder holder, List args, String label, CommandPermission permission) throws CommandException; public List onTabComplete(LuckPermsPlugin plugin, Sender sender, List args) { return Collections.emptyList(); diff --git a/common/src/main/java/me/lucko/luckperms/common/commands/abstraction/SingleCommand.java b/common/src/main/java/me/lucko/luckperms/common/commands/abstraction/SingleCommand.java index 76a2a321..ff58473a 100644 --- a/common/src/main/java/me/lucko/luckperms/common/commands/abstraction/SingleCommand.java +++ b/common/src/main/java/me/lucko/luckperms/common/commands/abstraction/SingleCommand.java @@ -30,7 +30,7 @@ import me.lucko.luckperms.common.commands.CommandException; import me.lucko.luckperms.common.commands.CommandResult; import me.lucko.luckperms.common.commands.sender.Sender; 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.plugin.LuckPermsPlugin; @@ -42,7 +42,7 @@ import java.util.function.Predicate; */ public abstract class SingleCommand extends Command { - public SingleCommand(LocalizedSpec spec, String name, Permission permission, Predicate argumentCheck) { + public SingleCommand(LocalizedSpec spec, String name, CommandPermission permission, Predicate argumentCheck) { super(spec, name, permission, argumentCheck, null); } diff --git a/common/src/main/java/me/lucko/luckperms/common/commands/abstraction/SubCommand.java b/common/src/main/java/me/lucko/luckperms/common/commands/abstraction/SubCommand.java index 1f34d72f..bce94c6d 100644 --- a/common/src/main/java/me/lucko/luckperms/common/commands/abstraction/SubCommand.java +++ b/common/src/main/java/me/lucko/luckperms/common/commands/abstraction/SubCommand.java @@ -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.utils.Util; import me.lucko.luckperms.common.config.ConfigKeys; -import me.lucko.luckperms.common.constants.Permission; -import me.lucko.luckperms.common.core.model.Group; -import me.lucko.luckperms.common.core.model.Track; -import me.lucko.luckperms.common.core.model.User; +import me.lucko.luckperms.common.constants.CommandPermission; import me.lucko.luckperms.common.locale.LocalizedSpec; import me.lucko.luckperms.common.locale.Message; import me.lucko.luckperms.common.messaging.InternalMessagingService; 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.treeview.PermissionVault; import me.lucko.luckperms.common.treeview.TreeNode; @@ -59,7 +59,7 @@ import java.util.stream.Collectors; @Getter public abstract class SubCommand extends Command { - public SubCommand(LocalizedSpec spec, String name, Permission permission, Predicate argumentCheck) { + public SubCommand(LocalizedSpec spec, String name, CommandPermission permission, Predicate argumentCheck) { super(spec, name, permission, argumentCheck); } diff --git a/common/src/main/java/me/lucko/luckperms/common/commands/impl/generic/meta/CommandMeta.java b/common/src/main/java/me/lucko/luckperms/common/commands/impl/generic/meta/CommandMeta.java index 81c0c0e1..bfc0387a 100644 --- a/common/src/main/java/me/lucko/luckperms/common/commands/impl/generic/meta/CommandMeta.java +++ b/common/src/main/java/me/lucko/luckperms/common/commands/impl/generic/meta/CommandMeta.java @@ -30,9 +30,9 @@ import com.google.common.collect.ImmutableList; import me.lucko.luckperms.api.ChatMetaType; import me.lucko.luckperms.common.commands.abstraction.SharedMainCommand; 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.LocaleManager; +import me.lucko.luckperms.common.model.PermissionHolder; public class CommandMeta extends SharedMainCommand { public CommandMeta(LocaleManager locale, boolean user) { diff --git a/common/src/main/java/me/lucko/luckperms/common/commands/impl/generic/meta/MetaAddChatMeta.java b/common/src/main/java/me/lucko/luckperms/common/commands/impl/generic/meta/MetaAddChatMeta.java index 39dc5e56..691bdcbf 100644 --- a/common/src/main/java/me/lucko/luckperms/common/commands/impl/generic/meta/MetaAddChatMeta.java +++ b/common/src/main/java/me/lucko/luckperms/common/commands/impl/generic/meta/MetaAddChatMeta.java @@ -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.utils.ArgumentUtils; 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.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.locale.CommandSpec; import me.lucko.luckperms.common.locale.LocaleManager; 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.utils.Predicates; @@ -60,15 +60,15 @@ public class MetaAddChatMeta extends SharedSubCommand { super( type == ChatMetaType.PREFIX ? CommandSpec.META_ADDPREFIX.spec(locale) : CommandSpec.META_ADDSUFFIX.spec(locale), "add" + type.name().toLowerCase(), - type == ChatMetaType.PREFIX ? Permission.USER_META_ADDPREFIX : Permission.USER_META_ADDSUFFIX, - type == ChatMetaType.PREFIX ? Permission.GROUP_META_ADDPREFIX : Permission.GROUP_META_ADDSUFFIX, + type == ChatMetaType.PREFIX ? CommandPermission.USER_META_ADDPREFIX : CommandPermission.USER_META_ADDSUFFIX, + type == ChatMetaType.PREFIX ? CommandPermission.GROUP_META_ADDPREFIX : CommandPermission.GROUP_META_ADDSUFFIX, Predicates.inRange(0, 1) ); this.type = type; } @Override - public CommandResult execute(LuckPermsPlugin plugin, Sender sender, PermissionHolder holder, List args, String label, Permission permission) throws CommandException { + public CommandResult execute(LuckPermsPlugin plugin, Sender sender, PermissionHolder holder, List args, String label, CommandPermission permission) throws CommandException { if (ArgumentPermissions.checkModifyPerms(plugin, sender, permission, holder)) { Message.COMMAND_NO_PERMISSION.send(sender); return CommandResult.NO_PERMISSION; diff --git a/common/src/main/java/me/lucko/luckperms/common/commands/impl/generic/meta/MetaAddTempChatMeta.java b/common/src/main/java/me/lucko/luckperms/common/commands/impl/generic/meta/MetaAddTempChatMeta.java index a04b7978..1e60aae5 100644 --- a/common/src/main/java/me/lucko/luckperms/common/commands/impl/generic/meta/MetaAddTempChatMeta.java +++ b/common/src/main/java/me/lucko/luckperms/common/commands/impl/generic/meta/MetaAddTempChatMeta.java @@ -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.Util; 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.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.locale.CommandSpec; import me.lucko.luckperms.common.locale.LocaleManager; 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.utils.DateUtil; import me.lucko.luckperms.common.utils.Predicates; @@ -65,15 +65,15 @@ public class MetaAddTempChatMeta extends SharedSubCommand { super( type == ChatMetaType.PREFIX ? CommandSpec.META_ADDTEMP_PREFIX.spec(locale) : CommandSpec.META_ADDTEMP_SUFFIX.spec(locale), "addtemp" + type.name().toLowerCase(), - type == ChatMetaType.PREFIX ? Permission.USER_META_ADDTEMP_PREFIX : Permission.USER_META_ADDTEMP_SUFFIX, - type == ChatMetaType.PREFIX ? Permission.GROUP_META_ADDTEMP_PREFIX : Permission.GROUP_META_ADDTEMP_SUFFIX, + type == ChatMetaType.PREFIX ? CommandPermission.USER_META_ADDTEMP_PREFIX : CommandPermission.USER_META_ADDTEMP_SUFFIX, + type == ChatMetaType.PREFIX ? CommandPermission.GROUP_META_ADDTEMP_PREFIX : CommandPermission.GROUP_META_ADDTEMP_SUFFIX, Predicates.inRange(0, 2) ); this.type = type; } @Override - public CommandResult execute(LuckPermsPlugin plugin, Sender sender, PermissionHolder holder, List args, String label, Permission permission) throws CommandException { + public CommandResult execute(LuckPermsPlugin plugin, Sender sender, PermissionHolder holder, List args, String label, CommandPermission permission) throws CommandException { if (ArgumentPermissions.checkModifyPerms(plugin, sender, permission, holder)) { Message.COMMAND_NO_PERMISSION.send(sender); return CommandResult.NO_PERMISSION; diff --git a/common/src/main/java/me/lucko/luckperms/common/commands/impl/generic/meta/MetaClear.java b/common/src/main/java/me/lucko/luckperms/common/commands/impl/generic/meta/MetaClear.java index ef1786d6..31d5536d 100644 --- a/common/src/main/java/me/lucko/luckperms/common/commands/impl/generic/meta/MetaClear.java +++ b/common/src/main/java/me/lucko/luckperms/common/commands/impl/generic/meta/MetaClear.java @@ -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.utils.ArgumentUtils; import me.lucko.luckperms.common.commands.utils.Util; -import me.lucko.luckperms.common.constants.Permission; -import me.lucko.luckperms.common.core.model.PermissionHolder; +import me.lucko.luckperms.common.constants.CommandPermission; import me.lucko.luckperms.common.data.LogEntry; import me.lucko.luckperms.common.locale.CommandSpec; import me.lucko.luckperms.common.locale.LocaleManager; 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.utils.Predicates; @@ -47,11 +47,11 @@ import java.util.stream.Collectors; public class MetaClear extends SharedSubCommand { 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 - public CommandResult execute(LuckPermsPlugin plugin, Sender sender, PermissionHolder holder, List args, String label, Permission permission) throws CommandException { + public CommandResult execute(LuckPermsPlugin plugin, Sender sender, PermissionHolder holder, List args, String label, CommandPermission permission) throws CommandException { if (ArgumentPermissions.checkModifyPerms(plugin, sender, permission, holder)) { Message.COMMAND_NO_PERMISSION.send(sender); return CommandResult.NO_PERMISSION; diff --git a/common/src/main/java/me/lucko/luckperms/common/commands/impl/generic/meta/MetaInfo.java b/common/src/main/java/me/lucko/luckperms/common/commands/impl/generic/meta/MetaInfo.java index 70cae773..38c9d70e 100644 --- a/common/src/main/java/me/lucko/luckperms/common/commands/impl/generic/meta/MetaInfo.java +++ b/common/src/main/java/me/lucko/luckperms/common/commands/impl/generic/meta/MetaInfo.java @@ -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.utils.MetaComparator; 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.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.LocaleManager; 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.utils.Predicates; import me.lucko.luckperms.common.utils.TextUtils; @@ -68,11 +68,11 @@ public class MetaInfo extends SharedSubCommand { } 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 - public CommandResult execute(LuckPermsPlugin plugin, Sender sender, PermissionHolder holder, List args, String label, Permission permission) throws CommandException { + public CommandResult execute(LuckPermsPlugin plugin, Sender sender, PermissionHolder holder, List args, String label, CommandPermission permission) throws CommandException { if (ArgumentPermissions.checkViewPerms(plugin, sender, permission, holder)) { Message.COMMAND_NO_PERMISSION.send(sender); return CommandResult.NO_PERMISSION; diff --git a/common/src/main/java/me/lucko/luckperms/common/commands/impl/generic/meta/MetaRemoveChatMeta.java b/common/src/main/java/me/lucko/luckperms/common/commands/impl/generic/meta/MetaRemoveChatMeta.java index bf660a14..5bc7bdf5 100644 --- a/common/src/main/java/me/lucko/luckperms/common/commands/impl/generic/meta/MetaRemoveChatMeta.java +++ b/common/src/main/java/me/lucko/luckperms/common/commands/impl/generic/meta/MetaRemoveChatMeta.java @@ -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.utils.ArgumentUtils; 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.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.locale.CommandSpec; import me.lucko.luckperms.common.locale.LocaleManager; 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.utils.Predicates; @@ -60,15 +60,15 @@ public class MetaRemoveChatMeta extends SharedSubCommand { super( type == ChatMetaType.PREFIX ? CommandSpec.META_REMOVEPREFIX.spec(locale) : CommandSpec.META_REMOVESUFFIX.spec(locale), "remove" + type.name().toLowerCase(), - type == ChatMetaType.PREFIX ? Permission.USER_META_REMOVEPREFIX : Permission.USER_META_REMOVESUFFIX, - type == ChatMetaType.PREFIX ? Permission.GROUP_META_REMOVEPREFIX : Permission.GROUP_META_REMOVESUFFIX, + type == ChatMetaType.PREFIX ? CommandPermission.USER_META_REMOVEPREFIX : CommandPermission.USER_META_REMOVESUFFIX, + type == ChatMetaType.PREFIX ? CommandPermission.GROUP_META_REMOVEPREFIX : CommandPermission.GROUP_META_REMOVESUFFIX, Predicates.is(0) ); this.type = type; } @Override - public CommandResult execute(LuckPermsPlugin plugin, Sender sender, PermissionHolder holder, List args, String label, Permission permission) throws CommandException { + public CommandResult execute(LuckPermsPlugin plugin, Sender sender, PermissionHolder holder, List args, String label, CommandPermission permission) throws CommandException { if (ArgumentPermissions.checkModifyPerms(plugin, sender, permission, holder)) { Message.COMMAND_NO_PERMISSION.send(sender); return CommandResult.NO_PERMISSION; diff --git a/common/src/main/java/me/lucko/luckperms/common/commands/impl/generic/meta/MetaRemoveTempChatMeta.java b/common/src/main/java/me/lucko/luckperms/common/commands/impl/generic/meta/MetaRemoveTempChatMeta.java index 1d560f8a..38dbad59 100644 --- a/common/src/main/java/me/lucko/luckperms/common/commands/impl/generic/meta/MetaRemoveTempChatMeta.java +++ b/common/src/main/java/me/lucko/luckperms/common/commands/impl/generic/meta/MetaRemoveTempChatMeta.java @@ -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.utils.ArgumentUtils; 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.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.locale.CommandSpec; import me.lucko.luckperms.common.locale.LocaleManager; 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.utils.Predicates; @@ -60,15 +60,15 @@ public class MetaRemoveTempChatMeta extends SharedSubCommand { super( type == ChatMetaType.PREFIX ? CommandSpec.META_REMOVETEMP_PREFIX.spec(locale) : CommandSpec.META_REMOVETEMP_SUFFIX.spec(locale), "removetemp" + type.name().toLowerCase(), - type == ChatMetaType.PREFIX ? Permission.USER_META_REMOVETEMP_PREFIX : Permission.USER_META_REMOVETEMP_SUFFIX, - type == ChatMetaType.PREFIX ? Permission.GROUP_META_REMOVETEMP_PREFIX : Permission.GROUP_META_REMOVETEMP_SUFFIX, + type == ChatMetaType.PREFIX ? CommandPermission.USER_META_REMOVETEMP_PREFIX : CommandPermission.USER_META_REMOVETEMP_SUFFIX, + type == ChatMetaType.PREFIX ? CommandPermission.GROUP_META_REMOVETEMP_PREFIX : CommandPermission.GROUP_META_REMOVETEMP_SUFFIX, Predicates.is(0) ); this.type = type; } @Override - public CommandResult execute(LuckPermsPlugin plugin, Sender sender, PermissionHolder holder, List args, String label, Permission permission) throws CommandException { + public CommandResult execute(LuckPermsPlugin plugin, Sender sender, PermissionHolder holder, List args, String label, CommandPermission permission) throws CommandException { if (ArgumentPermissions.checkModifyPerms(plugin, sender, permission, holder)) { Message.COMMAND_NO_PERMISSION.send(sender); return CommandResult.NO_PERMISSION; diff --git a/common/src/main/java/me/lucko/luckperms/common/commands/impl/generic/meta/MetaSet.java b/common/src/main/java/me/lucko/luckperms/common/commands/impl/generic/meta/MetaSet.java index 4e7125c2..9b4aadaf 100644 --- a/common/src/main/java/me/lucko/luckperms/common/commands/impl/generic/meta/MetaSet.java +++ b/common/src/main/java/me/lucko/luckperms/common/commands/impl/generic/meta/MetaSet.java @@ -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.utils.ArgumentUtils; 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.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.locale.CommandSpec; import me.lucko.luckperms.common.locale.LocaleManager; 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.utils.Predicates; import me.lucko.luckperms.common.utils.TextUtils; @@ -55,11 +55,11 @@ import java.util.stream.Collectors; public class MetaSet extends SharedSubCommand { 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 - public CommandResult execute(LuckPermsPlugin plugin, Sender sender, PermissionHolder holder, List args, String label, Permission permission) throws CommandException { + public CommandResult execute(LuckPermsPlugin plugin, Sender sender, PermissionHolder holder, List args, String label, CommandPermission permission) throws CommandException { if (ArgumentPermissions.checkModifyPerms(plugin, sender, permission, holder)) { Message.COMMAND_NO_PERMISSION.send(sender); return CommandResult.NO_PERMISSION; diff --git a/common/src/main/java/me/lucko/luckperms/common/commands/impl/generic/meta/MetaSetTemp.java b/common/src/main/java/me/lucko/luckperms/common/commands/impl/generic/meta/MetaSetTemp.java index 840f610e..90ba797d 100644 --- a/common/src/main/java/me/lucko/luckperms/common/commands/impl/generic/meta/MetaSetTemp.java +++ b/common/src/main/java/me/lucko/luckperms/common/commands/impl/generic/meta/MetaSetTemp.java @@ -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.Util; 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.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.locale.CommandSpec; import me.lucko.luckperms.common.locale.LocaleManager; 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.utils.DateUtil; import me.lucko.luckperms.common.utils.Predicates; @@ -58,11 +58,11 @@ import java.util.stream.Collectors; public class MetaSetTemp extends SharedSubCommand { 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 - public CommandResult execute(LuckPermsPlugin plugin, Sender sender, PermissionHolder holder, List args, String label, Permission permission) throws CommandException { + public CommandResult execute(LuckPermsPlugin plugin, Sender sender, PermissionHolder holder, List args, String label, CommandPermission permission) throws CommandException { if (ArgumentPermissions.checkModifyPerms(plugin, sender, permission, holder)) { Message.COMMAND_NO_PERMISSION.send(sender); return CommandResult.NO_PERMISSION; diff --git a/common/src/main/java/me/lucko/luckperms/common/commands/impl/generic/meta/MetaUnset.java b/common/src/main/java/me/lucko/luckperms/common/commands/impl/generic/meta/MetaUnset.java index 2047fd02..04f1629a 100644 --- a/common/src/main/java/me/lucko/luckperms/common/commands/impl/generic/meta/MetaUnset.java +++ b/common/src/main/java/me/lucko/luckperms/common/commands/impl/generic/meta/MetaUnset.java @@ -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.utils.ArgumentUtils; import me.lucko.luckperms.common.commands.utils.Util; -import me.lucko.luckperms.common.constants.Permission; -import me.lucko.luckperms.common.core.model.PermissionHolder; +import me.lucko.luckperms.common.constants.CommandPermission; import me.lucko.luckperms.common.data.LogEntry; import me.lucko.luckperms.common.locale.CommandSpec; import me.lucko.luckperms.common.locale.LocaleManager; 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.utils.Predicates; @@ -47,11 +47,11 @@ import java.util.stream.Collectors; public class MetaUnset extends SharedSubCommand { 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 - public CommandResult execute(LuckPermsPlugin plugin, Sender sender, PermissionHolder holder, List args, String label, Permission permission) throws CommandException { + public CommandResult execute(LuckPermsPlugin plugin, Sender sender, PermissionHolder holder, List args, String label, CommandPermission permission) throws CommandException { if (ArgumentPermissions.checkModifyPerms(plugin, sender, permission, holder)) { Message.COMMAND_NO_PERMISSION.send(sender); return CommandResult.NO_PERMISSION; diff --git a/common/src/main/java/me/lucko/luckperms/common/commands/impl/generic/meta/MetaUnsetTemp.java b/common/src/main/java/me/lucko/luckperms/common/commands/impl/generic/meta/MetaUnsetTemp.java index 5875272d..bfaabe17 100644 --- a/common/src/main/java/me/lucko/luckperms/common/commands/impl/generic/meta/MetaUnsetTemp.java +++ b/common/src/main/java/me/lucko/luckperms/common/commands/impl/generic/meta/MetaUnsetTemp.java @@ -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.utils.ArgumentUtils; import me.lucko.luckperms.common.commands.utils.Util; -import me.lucko.luckperms.common.constants.Permission; -import me.lucko.luckperms.common.core.model.PermissionHolder; +import me.lucko.luckperms.common.constants.CommandPermission; import me.lucko.luckperms.common.data.LogEntry; import me.lucko.luckperms.common.locale.CommandSpec; import me.lucko.luckperms.common.locale.LocaleManager; 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.utils.Predicates; @@ -47,11 +47,11 @@ import java.util.stream.Collectors; public class MetaUnsetTemp extends SharedSubCommand { 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 - public CommandResult execute(LuckPermsPlugin plugin, Sender sender, PermissionHolder holder, List args, String label, Permission permission) throws CommandException { + public CommandResult execute(LuckPermsPlugin plugin, Sender sender, PermissionHolder holder, List args, String label, CommandPermission permission) throws CommandException { if (ArgumentPermissions.checkModifyPerms(plugin, sender, permission, holder)) { Message.COMMAND_NO_PERMISSION.send(sender); return CommandResult.NO_PERMISSION; diff --git a/common/src/main/java/me/lucko/luckperms/common/commands/impl/generic/other/HolderClear.java b/common/src/main/java/me/lucko/luckperms/common/commands/impl/generic/other/HolderClear.java index 50e9156d..d70c3582 100644 --- a/common/src/main/java/me/lucko/luckperms/common/commands/impl/generic/other/HolderClear.java +++ b/common/src/main/java/me/lucko/luckperms/common/commands/impl/generic/other/HolderClear.java @@ -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.utils.ArgumentUtils; import me.lucko.luckperms.common.commands.utils.Util; -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.User; +import me.lucko.luckperms.common.constants.CommandPermission; import me.lucko.luckperms.common.data.LogEntry; import me.lucko.luckperms.common.locale.CommandSpec; import me.lucko.luckperms.common.locale.LocaleManager; 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.utils.Predicates; @@ -49,7 +49,7 @@ import java.util.stream.Collectors; public class HolderClear extends SubCommand { 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 diff --git a/common/src/main/java/me/lucko/luckperms/common/commands/impl/generic/other/HolderEditor.java b/common/src/main/java/me/lucko/luckperms/common/commands/impl/generic/other/HolderEditor.java index 5369cd6c..0b284d3a 100644 --- a/common/src/main/java/me/lucko/luckperms/common/commands/impl/generic/other/HolderEditor.java +++ b/common/src/main/java/me/lucko/luckperms/common/commands/impl/generic/other/HolderEditor.java @@ -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.sender.Sender; import me.lucko.luckperms.common.config.ConfigKeys; -import me.lucko.luckperms.common.constants.Permission; -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.constants.CommandPermission; import me.lucko.luckperms.common.locale.CommandSpec; import me.lucko.luckperms.common.locale.LocaleManager; 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.utils.Predicates; @@ -72,7 +72,7 @@ public class HolderEditor extends SubCommand { private static final String FILE_NAME = "luckperms-data.json"; 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 diff --git a/common/src/main/java/me/lucko/luckperms/common/commands/impl/generic/other/HolderShowTracks.java b/common/src/main/java/me/lucko/luckperms/common/commands/impl/generic/other/HolderShowTracks.java index bb922f42..b32d6400 100644 --- a/common/src/main/java/me/lucko/luckperms/common/commands/impl/generic/other/HolderShowTracks.java +++ b/common/src/main/java/me/lucko/luckperms/common/commands/impl/generic/other/HolderShowTracks.java @@ -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.sender.Sender; import me.lucko.luckperms.common.commands.utils.Util; -import me.lucko.luckperms.common.constants.Permission; -import me.lucko.luckperms.common.core.model.PermissionHolder; +import me.lucko.luckperms.common.constants.CommandPermission; import me.lucko.luckperms.common.locale.CommandSpec; import me.lucko.luckperms.common.locale.LocaleManager; 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.utils.Predicates; @@ -46,7 +46,7 @@ import java.util.stream.Collectors; public class HolderShowTracks extends SubCommand { 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 diff --git a/common/src/main/java/me/lucko/luckperms/common/commands/impl/generic/parent/CommandParent.java b/common/src/main/java/me/lucko/luckperms/common/commands/impl/generic/parent/CommandParent.java index 50b0d25c..53cc1913 100644 --- a/common/src/main/java/me/lucko/luckperms/common/commands/impl/generic/parent/CommandParent.java +++ b/common/src/main/java/me/lucko/luckperms/common/commands/impl/generic/parent/CommandParent.java @@ -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.SharedSubCommand; -import me.lucko.luckperms.common.core.model.PermissionHolder; import me.lucko.luckperms.common.locale.CommandSpec; import me.lucko.luckperms.common.locale.LocaleManager; +import me.lucko.luckperms.common.model.PermissionHolder; public class CommandParent extends SharedMainCommand { public CommandParent(LocaleManager locale, boolean user) { diff --git a/common/src/main/java/me/lucko/luckperms/common/commands/impl/generic/parent/ParentAdd.java b/common/src/main/java/me/lucko/luckperms/common/commands/impl/generic/parent/ParentAdd.java index f970b62b..7ff1fbf4 100644 --- a/common/src/main/java/me/lucko/luckperms/common/commands/impl/generic/parent/ParentAdd.java +++ b/common/src/main/java/me/lucko/luckperms/common/commands/impl/generic/parent/ParentAdd.java @@ -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.utils.ArgumentUtils; import me.lucko.luckperms.common.commands.utils.Util; -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.constants.CommandPermission; import me.lucko.luckperms.common.data.LogEntry; import me.lucko.luckperms.common.locale.CommandSpec; import me.lucko.luckperms.common.locale.LocaleManager; 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.utils.Predicates; @@ -51,11 +51,11 @@ import static me.lucko.luckperms.common.commands.abstraction.SubCommand.getGroup public class ParentAdd extends SharedSubCommand { 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 - public CommandResult execute(LuckPermsPlugin plugin, Sender sender, PermissionHolder holder, List args, String label, Permission permission) throws CommandException { + public CommandResult execute(LuckPermsPlugin plugin, Sender sender, PermissionHolder holder, List args, String label, CommandPermission permission) throws CommandException { if (ArgumentPermissions.checkModifyPerms(plugin, sender, permission, holder)) { Message.COMMAND_NO_PERMISSION.send(sender); return CommandResult.NO_PERMISSION; diff --git a/common/src/main/java/me/lucko/luckperms/common/commands/impl/generic/parent/ParentAddTemp.java b/common/src/main/java/me/lucko/luckperms/common/commands/impl/generic/parent/ParentAddTemp.java index 796c761c..77a18117 100644 --- a/common/src/main/java/me/lucko/luckperms/common/commands/impl/generic/parent/ParentAddTemp.java +++ b/common/src/main/java/me/lucko/luckperms/common/commands/impl/generic/parent/ParentAddTemp.java @@ -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.Util; import me.lucko.luckperms.common.config.ConfigKeys; -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.Group; -import me.lucko.luckperms.common.core.model.PermissionHolder; +import me.lucko.luckperms.common.constants.CommandPermission; import me.lucko.luckperms.common.data.LogEntry; import me.lucko.luckperms.common.locale.CommandSpec; import me.lucko.luckperms.common.locale.LocaleManager; 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.utils.DateUtil; 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 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 - public CommandResult execute(LuckPermsPlugin plugin, Sender sender, PermissionHolder holder, List args, String label, Permission permission) throws CommandException { + public CommandResult execute(LuckPermsPlugin plugin, Sender sender, PermissionHolder holder, List args, String label, CommandPermission permission) throws CommandException { if (ArgumentPermissions.checkModifyPerms(plugin, sender, permission, holder)) { Message.COMMAND_NO_PERMISSION.send(sender); return CommandResult.NO_PERMISSION; diff --git a/common/src/main/java/me/lucko/luckperms/common/commands/impl/generic/parent/ParentClear.java b/common/src/main/java/me/lucko/luckperms/common/commands/impl/generic/parent/ParentClear.java index c4d2b670..ad6224d2 100644 --- a/common/src/main/java/me/lucko/luckperms/common/commands/impl/generic/parent/ParentClear.java +++ b/common/src/main/java/me/lucko/luckperms/common/commands/impl/generic/parent/ParentClear.java @@ -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.utils.ArgumentUtils; import me.lucko.luckperms.common.commands.utils.Util; -import me.lucko.luckperms.common.constants.Permission; -import me.lucko.luckperms.common.core.model.PermissionHolder; +import me.lucko.luckperms.common.constants.CommandPermission; import me.lucko.luckperms.common.data.LogEntry; import me.lucko.luckperms.common.locale.CommandSpec; import me.lucko.luckperms.common.locale.LocaleManager; 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.utils.Predicates; @@ -47,11 +47,11 @@ import java.util.stream.Collectors; public class ParentClear extends SharedSubCommand { 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 - public CommandResult execute(LuckPermsPlugin plugin, Sender sender, PermissionHolder holder, List args, String label, Permission permission) throws CommandException { + public CommandResult execute(LuckPermsPlugin plugin, Sender sender, PermissionHolder holder, List args, String label, CommandPermission permission) throws CommandException { if (ArgumentPermissions.checkModifyPerms(plugin, sender, permission, holder)) { Message.COMMAND_NO_PERMISSION.send(sender); return CommandResult.NO_PERMISSION; diff --git a/common/src/main/java/me/lucko/luckperms/common/commands/impl/generic/parent/ParentClearTrack.java b/common/src/main/java/me/lucko/luckperms/common/commands/impl/generic/parent/ParentClearTrack.java index 89c1d963..a02adf42 100644 --- a/common/src/main/java/me/lucko/luckperms/common/commands/impl/generic/parent/ParentClearTrack.java +++ b/common/src/main/java/me/lucko/luckperms/common/commands/impl/generic/parent/ParentClearTrack.java @@ -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.utils.ArgumentUtils; 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.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.locale.CommandSpec; import me.lucko.luckperms.common.locale.LocaleManager; 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.utils.Predicates; @@ -52,11 +52,11 @@ import static me.lucko.luckperms.common.commands.abstraction.SubCommand.getTrack public class ParentClearTrack extends SharedSubCommand { 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 - public CommandResult execute(LuckPermsPlugin plugin, Sender sender, PermissionHolder holder, List args, String label, Permission permission) throws CommandException { + public CommandResult execute(LuckPermsPlugin plugin, Sender sender, PermissionHolder holder, List args, String label, CommandPermission permission) throws CommandException { if (ArgumentPermissions.checkModifyPerms(plugin, sender, permission, holder)) { Message.COMMAND_NO_PERMISSION.send(sender); return CommandResult.NO_PERMISSION; diff --git a/common/src/main/java/me/lucko/luckperms/common/commands/impl/generic/parent/ParentInfo.java b/common/src/main/java/me/lucko/luckperms/common/commands/impl/generic/parent/ParentInfo.java index bbf88312..3de52f75 100644 --- a/common/src/main/java/me/lucko/luckperms/common/commands/impl/generic/parent/ParentInfo.java +++ b/common/src/main/java/me/lucko/luckperms/common/commands/impl/generic/parent/ParentInfo.java @@ -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.sender.Sender; 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.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.LocaleManager; 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.utils.DateUtil; import me.lucko.luckperms.common.utils.Predicates; @@ -59,11 +59,11 @@ import java.util.function.Consumer; public class ParentInfo extends SharedSubCommand { 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 - public CommandResult execute(LuckPermsPlugin plugin, Sender sender, PermissionHolder holder, List args, String label, Permission permission) throws CommandException { + public CommandResult execute(LuckPermsPlugin plugin, Sender sender, PermissionHolder holder, List args, String label, CommandPermission permission) throws CommandException { if (ArgumentPermissions.checkViewPerms(plugin, sender, permission, holder)) { Message.COMMAND_NO_PERMISSION.send(sender); return CommandResult.NO_PERMISSION; diff --git a/common/src/main/java/me/lucko/luckperms/common/commands/impl/generic/parent/ParentRemove.java b/common/src/main/java/me/lucko/luckperms/common/commands/impl/generic/parent/ParentRemove.java index 4c3b554d..6890b798 100644 --- a/common/src/main/java/me/lucko/luckperms/common/commands/impl/generic/parent/ParentRemove.java +++ b/common/src/main/java/me/lucko/luckperms/common/commands/impl/generic/parent/ParentRemove.java @@ -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.Util; import me.lucko.luckperms.common.config.ConfigKeys; -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.constants.CommandPermission; import me.lucko.luckperms.common.data.LogEntry; import me.lucko.luckperms.common.locale.CommandSpec; import me.lucko.luckperms.common.locale.LocaleManager; 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.utils.Predicates; @@ -53,11 +53,11 @@ import static me.lucko.luckperms.common.commands.abstraction.SubCommand.getGroup public class ParentRemove extends SharedSubCommand { 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 - public CommandResult execute(LuckPermsPlugin plugin, Sender sender, PermissionHolder holder, List args, String label, Permission permission) throws CommandException { + public CommandResult execute(LuckPermsPlugin plugin, Sender sender, PermissionHolder holder, List args, String label, CommandPermission permission) throws CommandException { if (ArgumentPermissions.checkModifyPerms(plugin, sender, permission, holder)) { Message.COMMAND_NO_PERMISSION.send(sender); return CommandResult.NO_PERMISSION; diff --git a/common/src/main/java/me/lucko/luckperms/common/commands/impl/generic/parent/ParentRemoveTemp.java b/common/src/main/java/me/lucko/luckperms/common/commands/impl/generic/parent/ParentRemoveTemp.java index 3245cd2f..22692125 100644 --- a/common/src/main/java/me/lucko/luckperms/common/commands/impl/generic/parent/ParentRemoveTemp.java +++ b/common/src/main/java/me/lucko/luckperms/common/commands/impl/generic/parent/ParentRemoveTemp.java @@ -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.utils.ArgumentUtils; import me.lucko.luckperms.common.commands.utils.Util; -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.constants.CommandPermission; import me.lucko.luckperms.common.data.LogEntry; import me.lucko.luckperms.common.locale.CommandSpec; import me.lucko.luckperms.common.locale.LocaleManager; 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.utils.Predicates; @@ -51,11 +51,11 @@ import static me.lucko.luckperms.common.commands.abstraction.SubCommand.getGroup public class ParentRemoveTemp extends SharedSubCommand { 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 - public CommandResult execute(LuckPermsPlugin plugin, Sender sender, PermissionHolder holder, List args, String label, Permission permission) throws CommandException { + public CommandResult execute(LuckPermsPlugin plugin, Sender sender, PermissionHolder holder, List args, String label, CommandPermission permission) throws CommandException { if (ArgumentPermissions.checkModifyPerms(plugin, sender, permission, holder)) { Message.COMMAND_NO_PERMISSION.send(sender); return CommandResult.NO_PERMISSION; diff --git a/common/src/main/java/me/lucko/luckperms/common/commands/impl/generic/parent/ParentSet.java b/common/src/main/java/me/lucko/luckperms/common/commands/impl/generic/parent/ParentSet.java index 6d2e84ef..f9315bcc 100644 --- a/common/src/main/java/me/lucko/luckperms/common/commands/impl/generic/parent/ParentSet.java +++ b/common/src/main/java/me/lucko/luckperms/common/commands/impl/generic/parent/ParentSet.java @@ -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.utils.ArgumentUtils; import me.lucko.luckperms.common.commands.utils.Util; -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.User; +import me.lucko.luckperms.common.constants.CommandPermission; import me.lucko.luckperms.common.data.LogEntry; import me.lucko.luckperms.common.locale.CommandSpec; import me.lucko.luckperms.common.locale.LocaleManager; 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.utils.Predicates; @@ -51,11 +51,11 @@ import static me.lucko.luckperms.common.commands.abstraction.SubCommand.getGroup public class ParentSet extends SharedSubCommand { 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 - public CommandResult execute(LuckPermsPlugin plugin, Sender sender, PermissionHolder holder, List args, String label, Permission permission) throws CommandException { + public CommandResult execute(LuckPermsPlugin plugin, Sender sender, PermissionHolder holder, List args, String label, CommandPermission permission) throws CommandException { if (ArgumentPermissions.checkModifyPerms(plugin, sender, permission, holder)) { Message.COMMAND_NO_PERMISSION.send(sender); return CommandResult.NO_PERMISSION; diff --git a/common/src/main/java/me/lucko/luckperms/common/commands/impl/generic/parent/ParentSetTrack.java b/common/src/main/java/me/lucko/luckperms/common/commands/impl/generic/parent/ParentSetTrack.java index e95898cf..255b45d7 100644 --- a/common/src/main/java/me/lucko/luckperms/common/commands/impl/generic/parent/ParentSetTrack.java +++ b/common/src/main/java/me/lucko/luckperms/common/commands/impl/generic/parent/ParentSetTrack.java @@ -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.utils.ArgumentUtils; 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.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.locale.CommandSpec; import me.lucko.luckperms.common.locale.LocaleManager; 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.utils.Predicates; @@ -53,11 +53,11 @@ import static me.lucko.luckperms.common.commands.abstraction.SubCommand.getTrack public class ParentSetTrack extends SharedSubCommand { 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 - public CommandResult execute(LuckPermsPlugin plugin, Sender sender, PermissionHolder holder, List args, String label, Permission permission) throws CommandException { + public CommandResult execute(LuckPermsPlugin plugin, Sender sender, PermissionHolder holder, List args, String label, CommandPermission permission) throws CommandException { if (ArgumentPermissions.checkModifyPerms(plugin, sender, permission, holder)) { Message.COMMAND_NO_PERMISSION.send(sender); return CommandResult.NO_PERMISSION; diff --git a/common/src/main/java/me/lucko/luckperms/common/commands/impl/generic/permission/CommandPermission.java b/common/src/main/java/me/lucko/luckperms/common/commands/impl/generic/permission/CommandPermission.java index 8819a177..d511fc34 100644 --- a/common/src/main/java/me/lucko/luckperms/common/commands/impl/generic/permission/CommandPermission.java +++ b/common/src/main/java/me/lucko/luckperms/common/commands/impl/generic/permission/CommandPermission.java @@ -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.SharedSubCommand; -import me.lucko.luckperms.common.core.model.PermissionHolder; import me.lucko.luckperms.common.locale.CommandSpec; import me.lucko.luckperms.common.locale.LocaleManager; +import me.lucko.luckperms.common.model.PermissionHolder; public class CommandPermission extends SharedMainCommand { public CommandPermission(LocaleManager locale, boolean user) { diff --git a/common/src/main/java/me/lucko/luckperms/common/commands/impl/generic/permission/PermissionCheck.java b/common/src/main/java/me/lucko/luckperms/common/commands/impl/generic/permission/PermissionCheck.java index 08aa8b10..591662d1 100644 --- a/common/src/main/java/me/lucko/luckperms/common/commands/impl/generic/permission/PermissionCheck.java +++ b/common/src/main/java/me/lucko/luckperms/common/commands/impl/generic/permission/PermissionCheck.java @@ -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.utils.ArgumentUtils; import me.lucko.luckperms.common.commands.utils.Util; -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.constants.CommandPermission; import me.lucko.luckperms.common.locale.CommandSpec; import me.lucko.luckperms.common.locale.LocaleManager; 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.utils.Predicates; @@ -49,11 +49,11 @@ import static me.lucko.luckperms.common.commands.abstraction.SubCommand.getPermi public class PermissionCheck extends SharedSubCommand { 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 - public CommandResult execute(LuckPermsPlugin plugin, Sender sender, PermissionHolder holder, List args, String label, Permission permission) throws CommandException { + public CommandResult execute(LuckPermsPlugin plugin, Sender sender, PermissionHolder holder, List args, String label, CommandPermission permission) throws CommandException { if (ArgumentPermissions.checkViewPerms(plugin, sender, permission, holder)) { Message.COMMAND_NO_PERMISSION.send(sender); return CommandResult.NO_PERMISSION; diff --git a/common/src/main/java/me/lucko/luckperms/common/commands/impl/generic/permission/PermissionCheckInherits.java b/common/src/main/java/me/lucko/luckperms/common/commands/impl/generic/permission/PermissionCheckInherits.java index 2cd973d2..d98a6dfa 100644 --- a/common/src/main/java/me/lucko/luckperms/common/commands/impl/generic/permission/PermissionCheckInherits.java +++ b/common/src/main/java/me/lucko/luckperms/common/commands/impl/generic/permission/PermissionCheckInherits.java @@ -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.utils.ArgumentUtils; import me.lucko.luckperms.common.commands.utils.Util; -import me.lucko.luckperms.common.constants.Permission; -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.constants.CommandPermission; import me.lucko.luckperms.common.locale.CommandSpec; import me.lucko.luckperms.common.locale.LocaleManager; 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.utils.Predicates; @@ -49,11 +49,11 @@ import static me.lucko.luckperms.common.commands.abstraction.SubCommand.getPermi public class PermissionCheckInherits extends SharedSubCommand { 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 - public CommandResult execute(LuckPermsPlugin plugin, Sender sender, PermissionHolder holder, List args, String label, Permission permission) throws CommandException { + public CommandResult execute(LuckPermsPlugin plugin, Sender sender, PermissionHolder holder, List args, String label, CommandPermission permission) throws CommandException { if (ArgumentPermissions.checkViewPerms(plugin, sender, permission, holder)) { Message.COMMAND_NO_PERMISSION.send(sender); return CommandResult.NO_PERMISSION; diff --git a/common/src/main/java/me/lucko/luckperms/common/commands/impl/generic/permission/PermissionInfo.java b/common/src/main/java/me/lucko/luckperms/common/commands/impl/generic/permission/PermissionInfo.java index 390d7400..25bdf429 100644 --- a/common/src/main/java/me/lucko/luckperms/common/commands/impl/generic/permission/PermissionInfo.java +++ b/common/src/main/java/me/lucko/luckperms/common/commands/impl/generic/permission/PermissionInfo.java @@ -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.utils.ArgumentUtils; 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.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.LocaleManager; 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.utils.DateUtil; import me.lucko.luckperms.common.utils.Predicates; @@ -63,11 +63,11 @@ import java.util.function.Consumer; public class PermissionInfo extends SharedSubCommand { 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 - public CommandResult execute(LuckPermsPlugin plugin, Sender sender, PermissionHolder holder, List args, String label, Permission permission) throws CommandException { + public CommandResult execute(LuckPermsPlugin plugin, Sender sender, PermissionHolder holder, List args, String label, CommandPermission permission) throws CommandException { if (ArgumentPermissions.checkViewPerms(plugin, sender, permission, holder)) { Message.COMMAND_NO_PERMISSION.send(sender); return CommandResult.NO_PERMISSION; diff --git a/common/src/main/java/me/lucko/luckperms/common/commands/impl/generic/permission/PermissionSet.java b/common/src/main/java/me/lucko/luckperms/common/commands/impl/generic/permission/PermissionSet.java index 00994579..845be76b 100644 --- a/common/src/main/java/me/lucko/luckperms/common/commands/impl/generic/permission/PermissionSet.java +++ b/common/src/main/java/me/lucko/luckperms/common/commands/impl/generic/permission/PermissionSet.java @@ -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.utils.ArgumentUtils; import me.lucko.luckperms.common.commands.utils.Util; -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.constants.CommandPermission; import me.lucko.luckperms.common.data.LogEntry; import me.lucko.luckperms.common.locale.CommandSpec; import me.lucko.luckperms.common.locale.LocaleManager; 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.utils.Predicates; @@ -52,11 +52,11 @@ import static me.lucko.luckperms.common.commands.abstraction.SubCommand.getPermi public class PermissionSet extends SharedSubCommand { 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 - public CommandResult execute(LuckPermsPlugin plugin, Sender sender, PermissionHolder holder, List args, String label, Permission permission) throws CommandException { + public CommandResult execute(LuckPermsPlugin plugin, Sender sender, PermissionHolder holder, List args, String label, CommandPermission permission) throws CommandException { if (ArgumentPermissions.checkModifyPerms(plugin, sender, permission, holder)) { Message.COMMAND_NO_PERMISSION.send(sender); return CommandResult.NO_PERMISSION; diff --git a/common/src/main/java/me/lucko/luckperms/common/commands/impl/generic/permission/PermissionSetTemp.java b/common/src/main/java/me/lucko/luckperms/common/commands/impl/generic/permission/PermissionSetTemp.java index c410aa03..ec67e647 100644 --- a/common/src/main/java/me/lucko/luckperms/common/commands/impl/generic/permission/PermissionSetTemp.java +++ b/common/src/main/java/me/lucko/luckperms/common/commands/impl/generic/permission/PermissionSetTemp.java @@ -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.Util; import me.lucko.luckperms.common.config.ConfigKeys; -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.constants.CommandPermission; import me.lucko.luckperms.common.data.LogEntry; import me.lucko.luckperms.common.locale.CommandSpec; import me.lucko.luckperms.common.locale.LocaleManager; 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.utils.DateUtil; 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 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 - public CommandResult execute(LuckPermsPlugin plugin, Sender sender, PermissionHolder holder, List args, String label, Permission permission) throws CommandException { + public CommandResult execute(LuckPermsPlugin plugin, Sender sender, PermissionHolder holder, List args, String label, CommandPermission permission) throws CommandException { if (ArgumentPermissions.checkModifyPerms(plugin, sender, permission, holder)) { Message.COMMAND_NO_PERMISSION.send(sender); return CommandResult.NO_PERMISSION; diff --git a/common/src/main/java/me/lucko/luckperms/common/commands/impl/generic/permission/PermissionUnset.java b/common/src/main/java/me/lucko/luckperms/common/commands/impl/generic/permission/PermissionUnset.java index b5229fe8..7027cee6 100644 --- a/common/src/main/java/me/lucko/luckperms/common/commands/impl/generic/permission/PermissionUnset.java +++ b/common/src/main/java/me/lucko/luckperms/common/commands/impl/generic/permission/PermissionUnset.java @@ -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.utils.ArgumentUtils; import me.lucko.luckperms.common.commands.utils.Util; -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.constants.CommandPermission; import me.lucko.luckperms.common.data.LogEntry; import me.lucko.luckperms.common.locale.CommandSpec; import me.lucko.luckperms.common.locale.LocaleManager; 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.utils.Predicates; @@ -51,11 +51,11 @@ import static me.lucko.luckperms.common.commands.abstraction.SubCommand.getPermi public class PermissionUnset extends SharedSubCommand { 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 - public CommandResult execute(LuckPermsPlugin plugin, Sender sender, PermissionHolder holder, List args, String label, Permission permission) throws CommandException { + public CommandResult execute(LuckPermsPlugin plugin, Sender sender, PermissionHolder holder, List args, String label, CommandPermission permission) throws CommandException { if (ArgumentPermissions.checkModifyPerms(plugin, sender, permission, holder)) { Message.COMMAND_NO_PERMISSION.send(sender); return CommandResult.NO_PERMISSION; diff --git a/common/src/main/java/me/lucko/luckperms/common/commands/impl/generic/permission/PermissionUnsetTemp.java b/common/src/main/java/me/lucko/luckperms/common/commands/impl/generic/permission/PermissionUnsetTemp.java index aafd054e..aba9a55b 100644 --- a/common/src/main/java/me/lucko/luckperms/common/commands/impl/generic/permission/PermissionUnsetTemp.java +++ b/common/src/main/java/me/lucko/luckperms/common/commands/impl/generic/permission/PermissionUnsetTemp.java @@ -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.utils.ArgumentUtils; import me.lucko.luckperms.common.commands.utils.Util; -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.constants.CommandPermission; import me.lucko.luckperms.common.data.LogEntry; import me.lucko.luckperms.common.locale.CommandSpec; import me.lucko.luckperms.common.locale.LocaleManager; 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.utils.Predicates; @@ -51,11 +51,11 @@ import static me.lucko.luckperms.common.commands.abstraction.SubCommand.getPermi public class PermissionUnsetTemp extends SharedSubCommand { 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 - public CommandResult execute(LuckPermsPlugin plugin, Sender sender, PermissionHolder holder, List args, String label, Permission permission) throws CommandException { + public CommandResult execute(LuckPermsPlugin plugin, Sender sender, PermissionHolder holder, List args, String label, CommandPermission permission) throws CommandException { if (ArgumentPermissions.checkModifyPerms(plugin, sender, permission, holder)) { Message.COMMAND_NO_PERMISSION.send(sender); return CommandResult.NO_PERMISSION; diff --git a/common/src/main/java/me/lucko/luckperms/common/commands/impl/group/CreateGroup.java b/common/src/main/java/me/lucko/luckperms/common/commands/impl/group/CreateGroup.java index 1358f819..b8508f32 100644 --- a/common/src/main/java/me/lucko/luckperms/common/commands/impl/group/CreateGroup.java +++ b/common/src/main/java/me/lucko/luckperms/common/commands/impl/group/CreateGroup.java @@ -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.abstraction.SingleCommand; 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.Permission; import me.lucko.luckperms.common.data.LogEntry; import me.lucko.luckperms.common.locale.CommandSpec; import me.lucko.luckperms.common.locale.LocaleManager; @@ -42,7 +42,7 @@ import java.util.List; public class CreateGroup extends SingleCommand { 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 diff --git a/common/src/main/java/me/lucko/luckperms/common/commands/impl/group/DeleteGroup.java b/common/src/main/java/me/lucko/luckperms/common/commands/impl/group/DeleteGroup.java index b34b71ad..2215d9f6 100644 --- a/common/src/main/java/me/lucko/luckperms/common/commands/impl/group/DeleteGroup.java +++ b/common/src/main/java/me/lucko/luckperms/common/commands/impl/group/DeleteGroup.java @@ -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.sender.Sender; import me.lucko.luckperms.common.config.ConfigKeys; -import me.lucko.luckperms.common.constants.Permission; -import me.lucko.luckperms.common.core.model.Group; +import me.lucko.luckperms.common.constants.CommandPermission; import me.lucko.luckperms.common.data.LogEntry; import me.lucko.luckperms.common.locale.CommandSpec; import me.lucko.luckperms.common.locale.LocaleManager; 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.utils.Predicates; @@ -44,7 +44,7 @@ import java.util.List; public class DeleteGroup extends SingleCommand { 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 diff --git a/common/src/main/java/me/lucko/luckperms/common/commands/impl/group/GroupClone.java b/common/src/main/java/me/lucko/luckperms/common/commands/impl/group/GroupClone.java index 0fbd928b..4396adb8 100644 --- a/common/src/main/java/me/lucko/luckperms/common/commands/impl/group/GroupClone.java +++ b/common/src/main/java/me/lucko/luckperms/common/commands/impl/group/GroupClone.java @@ -31,13 +31,13 @@ import me.lucko.luckperms.common.commands.CommandException; import me.lucko.luckperms.common.commands.CommandResult; import me.lucko.luckperms.common.commands.abstraction.SubCommand; 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.Permission; -import me.lucko.luckperms.common.core.model.Group; import me.lucko.luckperms.common.data.LogEntry; import me.lucko.luckperms.common.locale.CommandSpec; import me.lucko.luckperms.common.locale.LocaleManager; 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.utils.Predicates; @@ -45,7 +45,7 @@ import java.util.List; public class GroupClone extends SubCommand { 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 diff --git a/common/src/main/java/me/lucko/luckperms/common/commands/impl/group/GroupInfo.java b/common/src/main/java/me/lucko/luckperms/common/commands/impl/group/GroupInfo.java index 8cfff35c..e24aa6d1 100644 --- a/common/src/main/java/me/lucko/luckperms/common/commands/impl/group/GroupInfo.java +++ b/common/src/main/java/me/lucko/luckperms/common/commands/impl/group/GroupInfo.java @@ -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.sender.Sender; import me.lucko.luckperms.common.commands.utils.Util; -import me.lucko.luckperms.common.constants.Permission; -import me.lucko.luckperms.common.core.model.Group; +import me.lucko.luckperms.common.constants.CommandPermission; import me.lucko.luckperms.common.locale.CommandSpec; import me.lucko.luckperms.common.locale.LocaleManager; 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.utils.DateUtil; import me.lucko.luckperms.common.utils.Predicates; @@ -47,7 +47,7 @@ import java.util.stream.Collectors; public class GroupInfo extends SubCommand { 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 diff --git a/common/src/main/java/me/lucko/luckperms/common/commands/impl/group/GroupListMembers.java b/common/src/main/java/me/lucko/luckperms/common/commands/impl/group/GroupListMembers.java index 8aac373a..6e145ed7 100644 --- a/common/src/main/java/me/lucko/luckperms/common/commands/impl/group/GroupListMembers.java +++ b/common/src/main/java/me/lucko/luckperms/common/commands/impl/group/GroupListMembers.java @@ -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.utils.ArgumentUtils; 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.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.LocaleManager; 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.utils.DateUtil; import me.lucko.luckperms.common.utils.Predicates; @@ -66,7 +66,7 @@ import java.util.stream.Collectors; public class GroupListMembers extends SubCommand { 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 diff --git a/common/src/main/java/me/lucko/luckperms/common/commands/impl/group/GroupMainCommand.java b/common/src/main/java/me/lucko/luckperms/common/commands/impl/group/GroupMainCommand.java index 988370c0..12424a87 100644 --- a/common/src/main/java/me/lucko/luckperms/common/commands/impl/group/GroupMainCommand.java +++ b/common/src/main/java/me/lucko/luckperms/common/commands/impl/group/GroupMainCommand.java @@ -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.permission.CommandPermission; 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.LocaleManager; import me.lucko.luckperms.common.locale.Message; +import me.lucko.luckperms.common.model.Group; import me.lucko.luckperms.common.plugin.LuckPermsPlugin; import java.util.ArrayList; diff --git a/common/src/main/java/me/lucko/luckperms/common/commands/impl/group/GroupRename.java b/common/src/main/java/me/lucko/luckperms/common/commands/impl/group/GroupRename.java index 4216d268..c017176e 100644 --- a/common/src/main/java/me/lucko/luckperms/common/commands/impl/group/GroupRename.java +++ b/common/src/main/java/me/lucko/luckperms/common/commands/impl/group/GroupRename.java @@ -31,13 +31,13 @@ import me.lucko.luckperms.common.commands.CommandException; import me.lucko.luckperms.common.commands.CommandResult; import me.lucko.luckperms.common.commands.abstraction.SubCommand; 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.Permission; -import me.lucko.luckperms.common.core.model.Group; import me.lucko.luckperms.common.data.LogEntry; import me.lucko.luckperms.common.locale.CommandSpec; import me.lucko.luckperms.common.locale.LocaleManager; 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.utils.Predicates; @@ -45,7 +45,7 @@ import java.util.List; public class GroupRename extends SubCommand { 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 diff --git a/common/src/main/java/me/lucko/luckperms/common/commands/impl/group/GroupSetWeight.java b/common/src/main/java/me/lucko/luckperms/common/commands/impl/group/GroupSetWeight.java index 52f5d775..a8e4157f 100644 --- a/common/src/main/java/me/lucko/luckperms/common/commands/impl/group/GroupSetWeight.java +++ b/common/src/main/java/me/lucko/luckperms/common/commands/impl/group/GroupSetWeight.java @@ -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.sender.Sender; import me.lucko.luckperms.common.commands.utils.ArgumentUtils; -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.constants.CommandPermission; import me.lucko.luckperms.common.locale.CommandSpec; import me.lucko.luckperms.common.locale.LocaleManager; 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.utils.Predicates; @@ -44,7 +44,7 @@ import java.util.List; public class GroupSetWeight extends SubCommand { 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 diff --git a/common/src/main/java/me/lucko/luckperms/common/commands/impl/group/ListGroups.java b/common/src/main/java/me/lucko/luckperms/common/commands/impl/group/ListGroups.java index 7156df03..7adaa91d 100644 --- a/common/src/main/java/me/lucko/luckperms/common/commands/impl/group/ListGroups.java +++ b/common/src/main/java/me/lucko/luckperms/common/commands/impl/group/ListGroups.java @@ -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.sender.Sender; 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.Permission; -import me.lucko.luckperms.common.core.model.Track; import me.lucko.luckperms.common.locale.CommandSpec; import me.lucko.luckperms.common.locale.LocaleManager; 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.utils.Predicates; @@ -49,7 +49,7 @@ import java.util.stream.Collectors; public class ListGroups extends SingleCommand { 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 diff --git a/common/src/main/java/me/lucko/luckperms/common/commands/impl/log/LogGroupHistory.java b/common/src/main/java/me/lucko/luckperms/common/commands/impl/log/LogGroupHistory.java index f6fee7a6..31dbbc56 100644 --- a/common/src/main/java/me/lucko/luckperms/common/commands/impl/log/LogGroupHistory.java +++ b/common/src/main/java/me/lucko/luckperms/common/commands/impl/log/LogGroupHistory.java @@ -30,8 +30,8 @@ import me.lucko.luckperms.common.commands.CommandException; import me.lucko.luckperms.common.commands.CommandResult; import me.lucko.luckperms.common.commands.abstraction.SubCommand; 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.Permission; import me.lucko.luckperms.common.data.Log; import me.lucko.luckperms.common.locale.CommandSpec; import me.lucko.luckperms.common.locale.LocaleManager; @@ -46,7 +46,7 @@ import java.util.SortedMap; public class LogGroupHistory extends SubCommand { 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 diff --git a/common/src/main/java/me/lucko/luckperms/common/commands/impl/log/LogNotify.java b/common/src/main/java/me/lucko/luckperms/common/commands/impl/log/LogNotify.java index 09e3cc07..3bfedd13 100644 --- a/common/src/main/java/me/lucko/luckperms/common/commands/impl/log/LogNotify.java +++ b/common/src/main/java/me/lucko/luckperms/common/commands/impl/log/LogNotify.java @@ -29,7 +29,7 @@ import me.lucko.luckperms.common.commands.CommandException; import me.lucko.luckperms.common.commands.CommandResult; import me.lucko.luckperms.common.commands.abstraction.SubCommand; 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.locale.CommandSpec; import me.lucko.luckperms.common.locale.LocaleManager; @@ -43,7 +43,7 @@ import java.util.UUID; public class LogNotify extends SubCommand { 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 diff --git a/common/src/main/java/me/lucko/luckperms/common/commands/impl/log/LogRecent.java b/common/src/main/java/me/lucko/luckperms/common/commands/impl/log/LogRecent.java index 3adb42eb..7da927b1 100644 --- a/common/src/main/java/me/lucko/luckperms/common/commands/impl/log/LogRecent.java +++ b/common/src/main/java/me/lucko/luckperms/common/commands/impl/log/LogRecent.java @@ -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.sender.Sender; 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.Permission; import me.lucko.luckperms.common.data.Log; import me.lucko.luckperms.common.locale.CommandSpec; import me.lucko.luckperms.common.locale.LocaleManager; @@ -48,7 +48,7 @@ import java.util.UUID; public class LogRecent extends SubCommand { 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 diff --git a/common/src/main/java/me/lucko/luckperms/common/commands/impl/log/LogSearch.java b/common/src/main/java/me/lucko/luckperms/common/commands/impl/log/LogSearch.java index efc27daf..115458d2 100644 --- a/common/src/main/java/me/lucko/luckperms/common/commands/impl/log/LogSearch.java +++ b/common/src/main/java/me/lucko/luckperms/common/commands/impl/log/LogSearch.java @@ -30,7 +30,7 @@ import me.lucko.luckperms.common.commands.CommandException; import me.lucko.luckperms.common.commands.CommandResult; import me.lucko.luckperms.common.commands.abstraction.SubCommand; 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.locale.CommandSpec; import me.lucko.luckperms.common.locale.LocaleManager; @@ -46,7 +46,7 @@ import java.util.stream.Collectors; public class LogSearch extends SubCommand { 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 diff --git a/common/src/main/java/me/lucko/luckperms/common/commands/impl/log/LogTrackHistory.java b/common/src/main/java/me/lucko/luckperms/common/commands/impl/log/LogTrackHistory.java index f60284bc..1caf15b6 100644 --- a/common/src/main/java/me/lucko/luckperms/common/commands/impl/log/LogTrackHistory.java +++ b/common/src/main/java/me/lucko/luckperms/common/commands/impl/log/LogTrackHistory.java @@ -30,8 +30,8 @@ import me.lucko.luckperms.common.commands.CommandException; import me.lucko.luckperms.common.commands.CommandResult; import me.lucko.luckperms.common.commands.abstraction.SubCommand; 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.Permission; import me.lucko.luckperms.common.data.Log; import me.lucko.luckperms.common.locale.CommandSpec; import me.lucko.luckperms.common.locale.LocaleManager; @@ -46,7 +46,7 @@ import java.util.SortedMap; public class LogTrackHistory extends SubCommand { 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 diff --git a/common/src/main/java/me/lucko/luckperms/common/commands/impl/log/LogUserHistory.java b/common/src/main/java/me/lucko/luckperms/common/commands/impl/log/LogUserHistory.java index 4399aa00..a2b1b4b6 100644 --- a/common/src/main/java/me/lucko/luckperms/common/commands/impl/log/LogUserHistory.java +++ b/common/src/main/java/me/lucko/luckperms/common/commands/impl/log/LogUserHistory.java @@ -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.sender.Sender; 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.Permission; import me.lucko.luckperms.common.data.Log; import me.lucko.luckperms.common.locale.CommandSpec; import me.lucko.luckperms.common.locale.LocaleManager; @@ -48,7 +48,7 @@ import java.util.UUID; public class LogUserHistory extends SubCommand { public LogUserHistory(LocaleManager locale) { - super(CommandSpec.LOG_USER_HISTORY.spec(locale), "userhistory", Permission.LOG_USER_HISTORY, Predicates.notInRange(1, 2)); + super(CommandSpec.LOG_USER_HISTORY.spec(locale), "userhistory", CommandPermission.LOG_USER_HISTORY, Predicates.notInRange(1, 2)); } @Override diff --git a/common/src/main/java/me/lucko/luckperms/common/commands/impl/migration/MigrationMainCommand.java b/common/src/main/java/me/lucko/luckperms/common/commands/impl/migration/MigrationMainCommand.java index 12fd2c8a..3c2ba9c3 100644 --- a/common/src/main/java/me/lucko/luckperms/common/commands/impl/migration/MigrationMainCommand.java +++ b/common/src/main/java/me/lucko/luckperms/common/commands/impl/migration/MigrationMainCommand.java @@ -33,7 +33,7 @@ import me.lucko.luckperms.common.commands.abstraction.Command; import me.lucko.luckperms.common.commands.abstraction.MainCommand; import me.lucko.luckperms.common.commands.abstraction.SubCommand; 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.CommandSpec; import me.lucko.luckperms.common.locale.LocaleManager; import me.lucko.luckperms.common.plugin.LuckPermsPlugin; @@ -72,7 +72,7 @@ public class MigrationMainCommand extends MainCommand { // Add dummy command to show in the list. if (commands.isEmpty()) { display = false; - commands.add(new SubCommand(CommandSpec.MIGRATION_COMMAND.spec(getSpec().getLocaleManager()), "No available plugins to migrate from", Permission.MIGRATION, Predicates.alwaysFalse()) { + commands.add(new SubCommand(CommandSpec.MIGRATION_COMMAND.spec(getSpec().getLocaleManager()), "No available plugins to migrate from", CommandPermission.MIGRATION, Predicates.alwaysFalse()) { @Override public CommandResult execute(LuckPermsPlugin plugin, Sender sender, Object o, List args, String label) throws CommandException { return CommandResult.SUCCESS; @@ -86,7 +86,7 @@ public class MigrationMainCommand extends MainCommand { @Override public boolean isAuthorized(Sender sender) { - return sender.hasPermission(Permission.MIGRATION); + return sender.hasPermission(CommandPermission.MIGRATION); } @Override diff --git a/common/src/main/java/me/lucko/luckperms/common/commands/impl/migration/MigrationUtils.java b/common/src/main/java/me/lucko/luckperms/common/commands/impl/migration/MigrationUtils.java index 7a2d2540..17204ce4 100644 --- a/common/src/main/java/me/lucko/luckperms/common/commands/impl/migration/MigrationUtils.java +++ b/common/src/main/java/me/lucko/luckperms/common/commands/impl/migration/MigrationUtils.java @@ -28,8 +28,8 @@ package me.lucko.luckperms.common.commands.impl.migration; import lombok.experimental.UtilityClass; import me.lucko.luckperms.api.Node; -import me.lucko.luckperms.common.core.NodeFactory; -import me.lucko.luckperms.common.core.model.Group; +import me.lucko.luckperms.common.model.Group; +import me.lucko.luckperms.common.node.NodeFactory; @UtilityClass public class MigrationUtils { diff --git a/common/src/main/java/me/lucko/luckperms/common/commands/impl/misc/ApplyEditsCommand.java b/common/src/main/java/me/lucko/luckperms/common/commands/impl/misc/ApplyEditsCommand.java index 266dbb6b..9f77cf33 100644 --- a/common/src/main/java/me/lucko/luckperms/common/commands/impl/misc/ApplyEditsCommand.java +++ b/common/src/main/java/me/lucko/luckperms/common/commands/impl/misc/ApplyEditsCommand.java @@ -39,12 +39,12 @@ import me.lucko.luckperms.common.commands.abstraction.SharedSubCommand; import me.lucko.luckperms.common.commands.abstraction.SingleCommand; import me.lucko.luckperms.common.commands.sender.Sender; import me.lucko.luckperms.common.commands.utils.Util; -import me.lucko.luckperms.common.constants.Permission; -import me.lucko.luckperms.common.core.NodeModel; -import me.lucko.luckperms.common.core.model.PermissionHolder; +import me.lucko.luckperms.common.constants.CommandPermission; import me.lucko.luckperms.common.locale.CommandSpec; import me.lucko.luckperms.common.locale.LocaleManager; import me.lucko.luckperms.common.locale.Message; +import me.lucko.luckperms.common.model.PermissionHolder; +import me.lucko.luckperms.common.node.NodeModel; import me.lucko.luckperms.common.plugin.LuckPermsPlugin; import me.lucko.luckperms.common.utils.Predicates; @@ -62,7 +62,7 @@ import java.util.stream.Collectors; public class ApplyEditsCommand extends SingleCommand { public ApplyEditsCommand(LocaleManager locale) { - super(CommandSpec.APPLY_EDITS.spec(locale), "ApplyEdits", Permission.APPLY_EDITS, Predicates.notInRange(1, 2)); + super(CommandSpec.APPLY_EDITS.spec(locale), "ApplyEdits", CommandPermission.APPLY_EDITS, Predicates.notInRange(1, 2)); } @Override diff --git a/common/src/main/java/me/lucko/luckperms/common/commands/impl/misc/BulkUpdateCommand.java b/common/src/main/java/me/lucko/luckperms/common/commands/impl/misc/BulkUpdateCommand.java index 576b939d..fe694da4 100644 --- a/common/src/main/java/me/lucko/luckperms/common/commands/impl/misc/BulkUpdateCommand.java +++ b/common/src/main/java/me/lucko/luckperms/common/commands/impl/misc/BulkUpdateCommand.java @@ -41,7 +41,7 @@ import me.lucko.luckperms.common.commands.CommandResult; import me.lucko.luckperms.common.commands.abstraction.SingleCommand; import me.lucko.luckperms.common.commands.sender.Sender; 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.locale.CommandSpec; import me.lucko.luckperms.common.locale.LocaleManager; import me.lucko.luckperms.common.locale.Message; @@ -56,7 +56,7 @@ public class BulkUpdateCommand extends SingleCommand { private final Cache pendingOperations = Caffeine.newBuilder().expireAfterWrite(30, TimeUnit.SECONDS).build(); public BulkUpdateCommand(LocaleManager locale) { - super(CommandSpec.BULK_UPDATE.spec(locale), "BulkUpdate", Permission.BULK_UPDATE, Predicates.alwaysFalse()); + super(CommandSpec.BULK_UPDATE.spec(locale), "BulkUpdate", CommandPermission.BULK_UPDATE, Predicates.alwaysFalse()); } @Override diff --git a/common/src/main/java/me/lucko/luckperms/common/commands/impl/misc/CheckCommand.java b/common/src/main/java/me/lucko/luckperms/common/commands/impl/misc/CheckCommand.java index ca62f84e..5296ec23 100644 --- a/common/src/main/java/me/lucko/luckperms/common/commands/impl/misc/CheckCommand.java +++ b/common/src/main/java/me/lucko/luckperms/common/commands/impl/misc/CheckCommand.java @@ -32,11 +32,11 @@ import me.lucko.luckperms.common.commands.abstraction.SingleCommand; import me.lucko.luckperms.common.commands.abstraction.SubCommand; import me.lucko.luckperms.common.commands.sender.Sender; import me.lucko.luckperms.common.commands.utils.Util; -import me.lucko.luckperms.common.constants.Permission; -import me.lucko.luckperms.common.core.model.User; +import me.lucko.luckperms.common.constants.CommandPermission; import me.lucko.luckperms.common.locale.CommandSpec; import me.lucko.luckperms.common.locale.LocaleManager; import me.lucko.luckperms.common.locale.Message; +import me.lucko.luckperms.common.model.User; import me.lucko.luckperms.common.plugin.LuckPermsPlugin; import me.lucko.luckperms.common.utils.Predicates; @@ -46,7 +46,7 @@ import java.util.stream.Collectors; public class CheckCommand extends SingleCommand { public CheckCommand(LocaleManager locale) { - super(CommandSpec.CHECK.spec(locale), "Check", Permission.CHECK, Predicates.not(2)); + super(CommandSpec.CHECK.spec(locale), "Check", CommandPermission.CHECK, Predicates.not(2)); } @Override diff --git a/common/src/main/java/me/lucko/luckperms/common/commands/impl/misc/ExportCommand.java b/common/src/main/java/me/lucko/luckperms/common/commands/impl/misc/ExportCommand.java index 9d3e0677..febab7a2 100644 --- a/common/src/main/java/me/lucko/luckperms/common/commands/impl/misc/ExportCommand.java +++ b/common/src/main/java/me/lucko/luckperms/common/commands/impl/misc/ExportCommand.java @@ -28,7 +28,7 @@ package me.lucko.luckperms.common.commands.impl.misc; import me.lucko.luckperms.common.commands.CommandResult; import me.lucko.luckperms.common.commands.abstraction.SingleCommand; 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.Exporter; import me.lucko.luckperms.common.locale.CommandSpec; import me.lucko.luckperms.common.locale.LocaleManager; @@ -47,7 +47,7 @@ public class ExportCommand extends SingleCommand { private AtomicBoolean running = new AtomicBoolean(false); public ExportCommand(LocaleManager locale) { - super(CommandSpec.EXPORT.spec(locale), "Export", Permission.EXPORT, Predicates.not(1)); + super(CommandSpec.EXPORT.spec(locale), "Export", CommandPermission.EXPORT, Predicates.not(1)); } @Override diff --git a/common/src/main/java/me/lucko/luckperms/common/commands/impl/misc/ImportCommand.java b/common/src/main/java/me/lucko/luckperms/common/commands/impl/misc/ImportCommand.java index bab1e21f..cb669968 100644 --- a/common/src/main/java/me/lucko/luckperms/common/commands/impl/misc/ImportCommand.java +++ b/common/src/main/java/me/lucko/luckperms/common/commands/impl/misc/ImportCommand.java @@ -28,7 +28,7 @@ package me.lucko.luckperms.common.commands.impl.misc; import me.lucko.luckperms.common.commands.CommandResult; import me.lucko.luckperms.common.commands.abstraction.SingleCommand; 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.Importer; import me.lucko.luckperms.common.locale.CommandSpec; import me.lucko.luckperms.common.locale.LocaleManager; @@ -48,7 +48,7 @@ public class ImportCommand extends SingleCommand { private AtomicBoolean running = new AtomicBoolean(false); public ImportCommand(LocaleManager locale) { - super(CommandSpec.IMPORT.spec(locale), "Import", Permission.IMPORT, Predicates.not(1)); + super(CommandSpec.IMPORT.spec(locale), "Import", CommandPermission.IMPORT, Predicates.not(1)); } @Override diff --git a/common/src/main/java/me/lucko/luckperms/common/commands/impl/misc/InfoCommand.java b/common/src/main/java/me/lucko/luckperms/common/commands/impl/misc/InfoCommand.java index 76ddd983..a42522fe 100644 --- a/common/src/main/java/me/lucko/luckperms/common/commands/impl/misc/InfoCommand.java +++ b/common/src/main/java/me/lucko/luckperms/common/commands/impl/misc/InfoCommand.java @@ -31,7 +31,7 @@ import me.lucko.luckperms.common.commands.sender.Sender; import me.lucko.luckperms.common.commands.utils.Util; import me.lucko.luckperms.common.config.ConfigKeys; 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.locale.CommandSpec; import me.lucko.luckperms.common.locale.LocaleManager; import me.lucko.luckperms.common.locale.Message; @@ -47,7 +47,7 @@ import java.util.stream.Collectors; public class InfoCommand extends SingleCommand { public InfoCommand(LocaleManager locale) { - super(CommandSpec.INFO.spec(locale), "Info", Permission.INFO, Predicates.alwaysFalse()); + super(CommandSpec.INFO.spec(locale), "Info", CommandPermission.INFO, Predicates.alwaysFalse()); } @Override diff --git a/common/src/main/java/me/lucko/luckperms/common/commands/impl/misc/NetworkSyncCommand.java b/common/src/main/java/me/lucko/luckperms/common/commands/impl/misc/NetworkSyncCommand.java index 3f4b2aa6..4a6bfdd2 100644 --- a/common/src/main/java/me/lucko/luckperms/common/commands/impl/misc/NetworkSyncCommand.java +++ b/common/src/main/java/me/lucko/luckperms/common/commands/impl/misc/NetworkSyncCommand.java @@ -28,7 +28,7 @@ package me.lucko.luckperms.common.commands.impl.misc; import me.lucko.luckperms.common.commands.CommandResult; import me.lucko.luckperms.common.commands.abstraction.SingleCommand; 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.CommandSpec; import me.lucko.luckperms.common.locale.LocaleManager; import me.lucko.luckperms.common.locale.Message; @@ -41,7 +41,7 @@ import java.util.List; public class NetworkSyncCommand extends SingleCommand { public NetworkSyncCommand(LocaleManager locale) { - super(CommandSpec.NETWORK_SYNC.spec(locale), "NetworkSync", Permission.SYNC, Predicates.alwaysFalse()); + super(CommandSpec.NETWORK_SYNC.spec(locale), "NetworkSync", CommandPermission.SYNC, Predicates.alwaysFalse()); } @Override diff --git a/common/src/main/java/me/lucko/luckperms/common/commands/impl/misc/ReloadConfigCommand.java b/common/src/main/java/me/lucko/luckperms/common/commands/impl/misc/ReloadConfigCommand.java index 1494dac4..c53eaa6c 100644 --- a/common/src/main/java/me/lucko/luckperms/common/commands/impl/misc/ReloadConfigCommand.java +++ b/common/src/main/java/me/lucko/luckperms/common/commands/impl/misc/ReloadConfigCommand.java @@ -29,7 +29,7 @@ import me.lucko.luckperms.common.commands.CommandException; import me.lucko.luckperms.common.commands.CommandResult; import me.lucko.luckperms.common.commands.abstraction.SingleCommand; 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.CommandSpec; import me.lucko.luckperms.common.locale.LocaleManager; import me.lucko.luckperms.common.locale.Message; @@ -40,7 +40,7 @@ import java.util.List; public class ReloadConfigCommand extends SingleCommand { public ReloadConfigCommand(LocaleManager locale) { - super(CommandSpec.RELOAD_CONFIG.spec(locale), "ReloadConfig", Permission.RELOAD_CONFIG, Predicates.alwaysFalse()); + super(CommandSpec.RELOAD_CONFIG.spec(locale), "ReloadConfig", CommandPermission.RELOAD_CONFIG, Predicates.alwaysFalse()); } @Override diff --git a/common/src/main/java/me/lucko/luckperms/common/commands/impl/misc/SearchCommand.java b/common/src/main/java/me/lucko/luckperms/common/commands/impl/misc/SearchCommand.java index e0d370ac..c58466e7 100644 --- a/common/src/main/java/me/lucko/luckperms/common/commands/impl/misc/SearchCommand.java +++ b/common/src/main/java/me/lucko/luckperms/common/commands/impl/misc/SearchCommand.java @@ -36,12 +36,12 @@ import me.lucko.luckperms.common.commands.abstraction.SubCommand; import me.lucko.luckperms.common.commands.sender.Sender; import me.lucko.luckperms.common.commands.utils.ArgumentUtils; 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.Permission; -import me.lucko.luckperms.common.core.NodeFactory; import me.lucko.luckperms.common.locale.CommandSpec; import me.lucko.luckperms.common.locale.LocaleManager; import me.lucko.luckperms.common.locale.Message; +import me.lucko.luckperms.common.node.NodeFactory; import me.lucko.luckperms.common.plugin.LuckPermsPlugin; import me.lucko.luckperms.common.utils.DateUtil; import me.lucko.luckperms.common.utils.Predicates; @@ -65,7 +65,7 @@ import java.util.stream.Collectors; public class SearchCommand extends SingleCommand { public SearchCommand(LocaleManager locale) { - super(CommandSpec.SEARCH.spec(locale), "Search", Permission.SEARCH, Predicates.notInRange(1, 2)); + super(CommandSpec.SEARCH.spec(locale), "Search", CommandPermission.SEARCH, Predicates.notInRange(1, 2)); } @Override diff --git a/common/src/main/java/me/lucko/luckperms/common/commands/impl/misc/SyncCommand.java b/common/src/main/java/me/lucko/luckperms/common/commands/impl/misc/SyncCommand.java index 61fd4671..324722a8 100644 --- a/common/src/main/java/me/lucko/luckperms/common/commands/impl/misc/SyncCommand.java +++ b/common/src/main/java/me/lucko/luckperms/common/commands/impl/misc/SyncCommand.java @@ -28,7 +28,7 @@ package me.lucko.luckperms.common.commands.impl.misc; import me.lucko.luckperms.common.commands.CommandResult; import me.lucko.luckperms.common.commands.abstraction.SingleCommand; 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.CommandSpec; import me.lucko.luckperms.common.locale.LocaleManager; import me.lucko.luckperms.common.locale.Message; @@ -39,7 +39,7 @@ import java.util.List; public class SyncCommand extends SingleCommand { public SyncCommand(LocaleManager locale) { - super(CommandSpec.SYNC.spec(locale), "Sync", Permission.SYNC, Predicates.alwaysFalse()); + super(CommandSpec.SYNC.spec(locale), "Sync", CommandPermission.SYNC, Predicates.alwaysFalse()); } @Override diff --git a/common/src/main/java/me/lucko/luckperms/common/commands/impl/misc/TreeCommand.java b/common/src/main/java/me/lucko/luckperms/common/commands/impl/misc/TreeCommand.java index 86971fb2..9f6d4487 100644 --- a/common/src/main/java/me/lucko/luckperms/common/commands/impl/misc/TreeCommand.java +++ b/common/src/main/java/me/lucko/luckperms/common/commands/impl/misc/TreeCommand.java @@ -32,11 +32,11 @@ import me.lucko.luckperms.common.commands.abstraction.SingleCommand; import me.lucko.luckperms.common.commands.sender.Sender; import me.lucko.luckperms.common.commands.utils.ArgumentUtils; import me.lucko.luckperms.common.commands.utils.Util; -import me.lucko.luckperms.common.constants.Permission; -import me.lucko.luckperms.common.core.model.User; +import me.lucko.luckperms.common.constants.CommandPermission; import me.lucko.luckperms.common.locale.CommandSpec; import me.lucko.luckperms.common.locale.LocaleManager; import me.lucko.luckperms.common.locale.Message; +import me.lucko.luckperms.common.model.User; import me.lucko.luckperms.common.plugin.LuckPermsPlugin; import me.lucko.luckperms.common.treeview.TreeView; import me.lucko.luckperms.common.treeview.TreeViewBuilder; @@ -52,7 +52,7 @@ import java.util.UUID; public class TreeCommand extends SingleCommand { public TreeCommand(LocaleManager locale) { - super(CommandSpec.TREE.spec(locale), "Tree", Permission.TREE, Predicates.alwaysFalse()); + super(CommandSpec.TREE.spec(locale), "Tree", CommandPermission.TREE, Predicates.alwaysFalse()); } @Override diff --git a/common/src/main/java/me/lucko/luckperms/common/commands/impl/misc/VerboseCommand.java b/common/src/main/java/me/lucko/luckperms/common/commands/impl/misc/VerboseCommand.java index 86a01be5..da6feabf 100644 --- a/common/src/main/java/me/lucko/luckperms/common/commands/impl/misc/VerboseCommand.java +++ b/common/src/main/java/me/lucko/luckperms/common/commands/impl/misc/VerboseCommand.java @@ -30,7 +30,7 @@ import com.google.common.collect.ImmutableList; import me.lucko.luckperms.common.commands.CommandResult; import me.lucko.luckperms.common.commands.abstraction.SingleCommand; 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.CommandSpec; import me.lucko.luckperms.common.locale.LocaleManager; import me.lucko.luckperms.common.locale.Message; @@ -51,7 +51,7 @@ import java.util.stream.Stream; public class VerboseCommand extends SingleCommand { public VerboseCommand(LocaleManager locale) { - super(CommandSpec.VERBOSE.spec(locale), "Verbose", Permission.VERBOSE, Predicates.is(0)); + super(CommandSpec.VERBOSE.spec(locale), "Verbose", CommandPermission.VERBOSE, Predicates.is(0)); } @Override diff --git a/common/src/main/java/me/lucko/luckperms/common/commands/impl/track/CreateTrack.java b/common/src/main/java/me/lucko/luckperms/common/commands/impl/track/CreateTrack.java index a9c5c09b..e5a837a7 100644 --- a/common/src/main/java/me/lucko/luckperms/common/commands/impl/track/CreateTrack.java +++ b/common/src/main/java/me/lucko/luckperms/common/commands/impl/track/CreateTrack.java @@ -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.abstraction.SingleCommand; 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.Permission; import me.lucko.luckperms.common.data.LogEntry; import me.lucko.luckperms.common.locale.CommandSpec; import me.lucko.luckperms.common.locale.LocaleManager; @@ -42,7 +42,7 @@ import java.util.List; public class CreateTrack extends SingleCommand { public CreateTrack(LocaleManager locale) { - super(CommandSpec.CREATE_TRACK.spec(locale), "CreateTrack", Permission.CREATE_TRACK, Predicates.not(1)); + super(CommandSpec.CREATE_TRACK.spec(locale), "CreateTrack", CommandPermission.CREATE_TRACK, Predicates.not(1)); } @Override diff --git a/common/src/main/java/me/lucko/luckperms/common/commands/impl/track/DeleteTrack.java b/common/src/main/java/me/lucko/luckperms/common/commands/impl/track/DeleteTrack.java index 07bfd7b6..333e5600 100644 --- a/common/src/main/java/me/lucko/luckperms/common/commands/impl/track/DeleteTrack.java +++ b/common/src/main/java/me/lucko/luckperms/common/commands/impl/track/DeleteTrack.java @@ -30,12 +30,12 @@ import me.lucko.luckperms.common.commands.CommandResult; import me.lucko.luckperms.common.commands.abstraction.SingleCommand; import me.lucko.luckperms.common.commands.abstraction.SubCommand; import me.lucko.luckperms.common.commands.sender.Sender; -import me.lucko.luckperms.common.constants.Permission; -import me.lucko.luckperms.common.core.model.Track; +import me.lucko.luckperms.common.constants.CommandPermission; import me.lucko.luckperms.common.data.LogEntry; import me.lucko.luckperms.common.locale.CommandSpec; import me.lucko.luckperms.common.locale.LocaleManager; 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.utils.Predicates; @@ -43,7 +43,7 @@ import java.util.List; public class DeleteTrack extends SingleCommand { public DeleteTrack(LocaleManager locale) { - super(CommandSpec.DELETE_TRACK.spec(locale), "DeleteTrack", Permission.DELETE_TRACK, Predicates.not(1)); + super(CommandSpec.DELETE_TRACK.spec(locale), "DeleteTrack", CommandPermission.DELETE_TRACK, Predicates.not(1)); } @Override diff --git a/common/src/main/java/me/lucko/luckperms/common/commands/impl/track/ListTracks.java b/common/src/main/java/me/lucko/luckperms/common/commands/impl/track/ListTracks.java index cbc4a27d..9c199075 100644 --- a/common/src/main/java/me/lucko/luckperms/common/commands/impl/track/ListTracks.java +++ b/common/src/main/java/me/lucko/luckperms/common/commands/impl/track/ListTracks.java @@ -29,7 +29,7 @@ import me.lucko.luckperms.common.commands.CommandResult; import me.lucko.luckperms.common.commands.abstraction.SingleCommand; import me.lucko.luckperms.common.commands.sender.Sender; 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.CommandSpec; import me.lucko.luckperms.common.locale.LocaleManager; import me.lucko.luckperms.common.locale.Message; @@ -41,7 +41,7 @@ import java.util.stream.Collectors; public class ListTracks extends SingleCommand { public ListTracks(LocaleManager locale) { - super(CommandSpec.LIST_TRACKS.spec(locale), "ListTracks", Permission.LIST_TRACKS, Predicates.alwaysFalse()); + super(CommandSpec.LIST_TRACKS.spec(locale), "ListTracks", CommandPermission.LIST_TRACKS, Predicates.alwaysFalse()); } @Override diff --git a/common/src/main/java/me/lucko/luckperms/common/commands/impl/track/TrackAppend.java b/common/src/main/java/me/lucko/luckperms/common/commands/impl/track/TrackAppend.java index 16b952f5..e4feb9c2 100644 --- a/common/src/main/java/me/lucko/luckperms/common/commands/impl/track/TrackAppend.java +++ b/common/src/main/java/me/lucko/luckperms/common/commands/impl/track/TrackAppend.java @@ -30,14 +30,14 @@ import me.lucko.luckperms.common.commands.CommandResult; import me.lucko.luckperms.common.commands.abstraction.SubCommand; import me.lucko.luckperms.common.commands.sender.Sender; 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.Permission; -import me.lucko.luckperms.common.core.model.Group; -import me.lucko.luckperms.common.core.model.Track; import me.lucko.luckperms.common.data.LogEntry; import me.lucko.luckperms.common.locale.CommandSpec; import me.lucko.luckperms.common.locale.LocaleManager; import me.lucko.luckperms.common.locale.Message; +import me.lucko.luckperms.common.model.Group; +import me.lucko.luckperms.common.model.Track; import me.lucko.luckperms.common.plugin.LuckPermsPlugin; import me.lucko.luckperms.common.utils.Predicates; import me.lucko.luckperms.exceptions.ObjectAlreadyHasException; @@ -46,7 +46,7 @@ import java.util.List; public class TrackAppend extends SubCommand { public TrackAppend(LocaleManager locale) { - super(CommandSpec.TRACK_APPEND.spec(locale), "append", Permission.TRACK_APPEND, Predicates.not(1)); + super(CommandSpec.TRACK_APPEND.spec(locale), "append", CommandPermission.TRACK_APPEND, Predicates.not(1)); } @Override diff --git a/common/src/main/java/me/lucko/luckperms/common/commands/impl/track/TrackClear.java b/common/src/main/java/me/lucko/luckperms/common/commands/impl/track/TrackClear.java index 70de8e04..c295b470 100644 --- a/common/src/main/java/me/lucko/luckperms/common/commands/impl/track/TrackClear.java +++ b/common/src/main/java/me/lucko/luckperms/common/commands/impl/track/TrackClear.java @@ -29,12 +29,12 @@ import me.lucko.luckperms.common.commands.CommandException; import me.lucko.luckperms.common.commands.CommandResult; import me.lucko.luckperms.common.commands.abstraction.SubCommand; import me.lucko.luckperms.common.commands.sender.Sender; -import me.lucko.luckperms.common.constants.Permission; -import me.lucko.luckperms.common.core.model.Track; +import me.lucko.luckperms.common.constants.CommandPermission; import me.lucko.luckperms.common.data.LogEntry; import me.lucko.luckperms.common.locale.CommandSpec; import me.lucko.luckperms.common.locale.LocaleManager; 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.utils.Predicates; @@ -42,7 +42,7 @@ import java.util.List; public class TrackClear extends SubCommand { public TrackClear(LocaleManager locale) { - super(CommandSpec.TRACK_CLEAR.spec(locale), "clear", Permission.TRACK_CLEAR, Predicates.alwaysFalse()); + super(CommandSpec.TRACK_CLEAR.spec(locale), "clear", CommandPermission.TRACK_CLEAR, Predicates.alwaysFalse()); } @Override diff --git a/common/src/main/java/me/lucko/luckperms/common/commands/impl/track/TrackClone.java b/common/src/main/java/me/lucko/luckperms/common/commands/impl/track/TrackClone.java index 4dccc828..43beaf8a 100644 --- a/common/src/main/java/me/lucko/luckperms/common/commands/impl/track/TrackClone.java +++ b/common/src/main/java/me/lucko/luckperms/common/commands/impl/track/TrackClone.java @@ -30,13 +30,13 @@ import me.lucko.luckperms.common.commands.CommandException; import me.lucko.luckperms.common.commands.CommandResult; import me.lucko.luckperms.common.commands.abstraction.SubCommand; 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.Permission; -import me.lucko.luckperms.common.core.model.Track; import me.lucko.luckperms.common.data.LogEntry; import me.lucko.luckperms.common.locale.CommandSpec; import me.lucko.luckperms.common.locale.LocaleManager; 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.utils.Predicates; @@ -44,7 +44,7 @@ import java.util.List; public class TrackClone extends SubCommand { public TrackClone(LocaleManager locale) { - super(CommandSpec.TRACK_CLONE.spec(locale), "clone", Permission.TRACK_CLONE, Predicates.not(1)); + super(CommandSpec.TRACK_CLONE.spec(locale), "clone", CommandPermission.TRACK_CLONE, Predicates.not(1)); } @Override diff --git a/common/src/main/java/me/lucko/luckperms/common/commands/impl/track/TrackInfo.java b/common/src/main/java/me/lucko/luckperms/common/commands/impl/track/TrackInfo.java index d3407270..d2bb211f 100644 --- a/common/src/main/java/me/lucko/luckperms/common/commands/impl/track/TrackInfo.java +++ b/common/src/main/java/me/lucko/luckperms/common/commands/impl/track/TrackInfo.java @@ -30,11 +30,11 @@ import me.lucko.luckperms.common.commands.CommandResult; import me.lucko.luckperms.common.commands.abstraction.SubCommand; import me.lucko.luckperms.common.commands.sender.Sender; import me.lucko.luckperms.common.commands.utils.Util; -import me.lucko.luckperms.common.constants.Permission; -import me.lucko.luckperms.common.core.model.Track; +import me.lucko.luckperms.common.constants.CommandPermission; import me.lucko.luckperms.common.locale.CommandSpec; import me.lucko.luckperms.common.locale.LocaleManager; 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.utils.Predicates; @@ -42,7 +42,7 @@ import java.util.List; public class TrackInfo extends SubCommand { public TrackInfo(LocaleManager locale) { - super(CommandSpec.TRACK_INFO.spec(locale), "info", Permission.TRACK_INFO, Predicates.alwaysFalse()); + super(CommandSpec.TRACK_INFO.spec(locale), "info", CommandPermission.TRACK_INFO, Predicates.alwaysFalse()); } @Override diff --git a/common/src/main/java/me/lucko/luckperms/common/commands/impl/track/TrackInsert.java b/common/src/main/java/me/lucko/luckperms/common/commands/impl/track/TrackInsert.java index 6f0a0e52..8ae7182f 100644 --- a/common/src/main/java/me/lucko/luckperms/common/commands/impl/track/TrackInsert.java +++ b/common/src/main/java/me/lucko/luckperms/common/commands/impl/track/TrackInsert.java @@ -30,14 +30,14 @@ import me.lucko.luckperms.common.commands.CommandResult; import me.lucko.luckperms.common.commands.abstraction.SubCommand; import me.lucko.luckperms.common.commands.sender.Sender; 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.Permission; -import me.lucko.luckperms.common.core.model.Group; -import me.lucko.luckperms.common.core.model.Track; import me.lucko.luckperms.common.data.LogEntry; import me.lucko.luckperms.common.locale.CommandSpec; import me.lucko.luckperms.common.locale.LocaleManager; import me.lucko.luckperms.common.locale.Message; +import me.lucko.luckperms.common.model.Group; +import me.lucko.luckperms.common.model.Track; import me.lucko.luckperms.common.plugin.LuckPermsPlugin; import me.lucko.luckperms.common.utils.Predicates; import me.lucko.luckperms.exceptions.ObjectAlreadyHasException; @@ -46,7 +46,7 @@ import java.util.List; public class TrackInsert extends SubCommand { public TrackInsert(LocaleManager locale) { - super(CommandSpec.TRACK_INSERT.spec(locale), "insert", Permission.TRACK_INSERT, Predicates.not(2)); + super(CommandSpec.TRACK_INSERT.spec(locale), "insert", CommandPermission.TRACK_INSERT, Predicates.not(2)); } @Override diff --git a/common/src/main/java/me/lucko/luckperms/common/commands/impl/track/TrackMainCommand.java b/common/src/main/java/me/lucko/luckperms/common/commands/impl/track/TrackMainCommand.java index a9c6c8bb..df8f3d4b 100644 --- a/common/src/main/java/me/lucko/luckperms/common/commands/impl/track/TrackMainCommand.java +++ b/common/src/main/java/me/lucko/luckperms/common/commands/impl/track/TrackMainCommand.java @@ -30,10 +30,10 @@ import com.google.common.collect.ImmutableList; import me.lucko.luckperms.common.commands.abstraction.Command; import me.lucko.luckperms.common.commands.abstraction.MainCommand; import me.lucko.luckperms.common.commands.sender.Sender; -import me.lucko.luckperms.common.core.model.Track; import me.lucko.luckperms.common.locale.CommandSpec; import me.lucko.luckperms.common.locale.LocaleManager; import me.lucko.luckperms.common.locale.Message; +import me.lucko.luckperms.common.model.Track; import me.lucko.luckperms.common.plugin.LuckPermsPlugin; import java.util.ArrayList; diff --git a/common/src/main/java/me/lucko/luckperms/common/commands/impl/track/TrackRemove.java b/common/src/main/java/me/lucko/luckperms/common/commands/impl/track/TrackRemove.java index 5a3b724b..44dc57c4 100644 --- a/common/src/main/java/me/lucko/luckperms/common/commands/impl/track/TrackRemove.java +++ b/common/src/main/java/me/lucko/luckperms/common/commands/impl/track/TrackRemove.java @@ -30,13 +30,13 @@ import me.lucko.luckperms.common.commands.CommandResult; import me.lucko.luckperms.common.commands.abstraction.SubCommand; import me.lucko.luckperms.common.commands.sender.Sender; 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.Permission; -import me.lucko.luckperms.common.core.model.Track; import me.lucko.luckperms.common.data.LogEntry; import me.lucko.luckperms.common.locale.CommandSpec; import me.lucko.luckperms.common.locale.LocaleManager; 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.utils.Predicates; import me.lucko.luckperms.exceptions.ObjectLacksException; @@ -45,7 +45,7 @@ import java.util.List; public class TrackRemove extends SubCommand { public TrackRemove(LocaleManager locale) { - super(CommandSpec.TRACK_REMOVE.spec(locale), "remove", Permission.TRACK_REMOVE, Predicates.not(1)); + super(CommandSpec.TRACK_REMOVE.spec(locale), "remove", CommandPermission.TRACK_REMOVE, Predicates.not(1)); } @Override diff --git a/common/src/main/java/me/lucko/luckperms/common/commands/impl/track/TrackRename.java b/common/src/main/java/me/lucko/luckperms/common/commands/impl/track/TrackRename.java index 78185bec..63a9920f 100644 --- a/common/src/main/java/me/lucko/luckperms/common/commands/impl/track/TrackRename.java +++ b/common/src/main/java/me/lucko/luckperms/common/commands/impl/track/TrackRename.java @@ -31,13 +31,13 @@ import me.lucko.luckperms.common.commands.CommandException; import me.lucko.luckperms.common.commands.CommandResult; import me.lucko.luckperms.common.commands.abstraction.SubCommand; 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.Permission; -import me.lucko.luckperms.common.core.model.Track; import me.lucko.luckperms.common.data.LogEntry; import me.lucko.luckperms.common.locale.CommandSpec; import me.lucko.luckperms.common.locale.LocaleManager; 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.utils.Predicates; @@ -45,7 +45,7 @@ import java.util.List; public class TrackRename extends SubCommand { public TrackRename(LocaleManager locale) { - super(CommandSpec.TRACK_RENAME.spec(locale), "rename", Permission.TRACK_RENAME, Predicates.not(1)); + super(CommandSpec.TRACK_RENAME.spec(locale), "rename", CommandPermission.TRACK_RENAME, Predicates.not(1)); } @Override diff --git a/common/src/main/java/me/lucko/luckperms/common/commands/impl/user/UserDemote.java b/common/src/main/java/me/lucko/luckperms/common/commands/impl/user/UserDemote.java index 1c2c808c..d7acc8b0 100644 --- a/common/src/main/java/me/lucko/luckperms/common/commands/impl/user/UserDemote.java +++ b/common/src/main/java/me/lucko/luckperms/common/commands/impl/user/UserDemote.java @@ -36,16 +36,16 @@ import me.lucko.luckperms.common.commands.abstraction.SubCommand; import me.lucko.luckperms.common.commands.sender.Sender; import me.lucko.luckperms.common.commands.utils.ArgumentUtils; 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.Permission; -import me.lucko.luckperms.common.core.NodeFactory; -import me.lucko.luckperms.common.core.model.Group; -import me.lucko.luckperms.common.core.model.Track; -import me.lucko.luckperms.common.core.model.User; import me.lucko.luckperms.common.data.LogEntry; import me.lucko.luckperms.common.locale.CommandSpec; import me.lucko.luckperms.common.locale.LocaleManager; import me.lucko.luckperms.common.locale.Message; +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.node.NodeFactory; import me.lucko.luckperms.common.plugin.LuckPermsPlugin; import me.lucko.luckperms.common.utils.Predicates; import me.lucko.luckperms.exceptions.ObjectLacksException; @@ -56,7 +56,7 @@ import java.util.stream.Collectors; public class UserDemote extends SubCommand { public UserDemote(LocaleManager locale) { - super(CommandSpec.USER_DEMOTE.spec(locale), "demote", Permission.USER_DEMOTE, Predicates.is(0)); + super(CommandSpec.USER_DEMOTE.spec(locale), "demote", CommandPermission.USER_DEMOTE, Predicates.is(0)); } @Override diff --git a/common/src/main/java/me/lucko/luckperms/common/commands/impl/user/UserInfo.java b/common/src/main/java/me/lucko/luckperms/common/commands/impl/user/UserInfo.java index 56b392a9..1fdf94c3 100644 --- a/common/src/main/java/me/lucko/luckperms/common/commands/impl/user/UserInfo.java +++ b/common/src/main/java/me/lucko/luckperms/common/commands/impl/user/UserInfo.java @@ -34,11 +34,11 @@ import me.lucko.luckperms.common.commands.CommandResult; import me.lucko.luckperms.common.commands.abstraction.SubCommand; import me.lucko.luckperms.common.commands.sender.Sender; import me.lucko.luckperms.common.commands.utils.Util; -import me.lucko.luckperms.common.constants.Permission; -import me.lucko.luckperms.common.core.model.User; +import me.lucko.luckperms.common.constants.CommandPermission; import me.lucko.luckperms.common.locale.CommandSpec; import me.lucko.luckperms.common.locale.LocaleManager; import me.lucko.luckperms.common.locale.Message; +import me.lucko.luckperms.common.model.User; import me.lucko.luckperms.common.plugin.LuckPermsPlugin; import me.lucko.luckperms.common.utils.DateUtil; import me.lucko.luckperms.common.utils.Predicates; @@ -49,7 +49,7 @@ import java.util.stream.Collectors; public class UserInfo extends SubCommand { public UserInfo(LocaleManager locale) { - super(CommandSpec.USER_INFO.spec(locale), "info", Permission.USER_INFO, Predicates.alwaysFalse()); + super(CommandSpec.USER_INFO.spec(locale), "info", CommandPermission.USER_INFO, Predicates.alwaysFalse()); } @SuppressWarnings("unchecked") diff --git a/common/src/main/java/me/lucko/luckperms/common/commands/impl/user/UserMainCommand.java b/common/src/main/java/me/lucko/luckperms/common/commands/impl/user/UserMainCommand.java index d0bb3e86..c070a0d9 100644 --- a/common/src/main/java/me/lucko/luckperms/common/commands/impl/user/UserMainCommand.java +++ b/common/src/main/java/me/lucko/luckperms/common/commands/impl/user/UserMainCommand.java @@ -39,10 +39,10 @@ import me.lucko.luckperms.common.commands.sender.Sender; import me.lucko.luckperms.common.commands.utils.Util; import me.lucko.luckperms.common.config.ConfigKeys; import me.lucko.luckperms.common.constants.DataConstraints; -import me.lucko.luckperms.common.core.model.User; import me.lucko.luckperms.common.locale.CommandSpec; import me.lucko.luckperms.common.locale.LocaleManager; import me.lucko.luckperms.common.locale.Message; +import me.lucko.luckperms.common.model.User; import me.lucko.luckperms.common.plugin.LuckPermsPlugin; import java.util.List; diff --git a/common/src/main/java/me/lucko/luckperms/common/commands/impl/user/UserPromote.java b/common/src/main/java/me/lucko/luckperms/common/commands/impl/user/UserPromote.java index 37a74ff6..4cb33f5c 100644 --- a/common/src/main/java/me/lucko/luckperms/common/commands/impl/user/UserPromote.java +++ b/common/src/main/java/me/lucko/luckperms/common/commands/impl/user/UserPromote.java @@ -34,16 +34,16 @@ import me.lucko.luckperms.common.commands.abstraction.SubCommand; import me.lucko.luckperms.common.commands.sender.Sender; import me.lucko.luckperms.common.commands.utils.ArgumentUtils; 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.Permission; -import me.lucko.luckperms.common.core.NodeFactory; -import me.lucko.luckperms.common.core.model.Group; -import me.lucko.luckperms.common.core.model.Track; -import me.lucko.luckperms.common.core.model.User; import me.lucko.luckperms.common.data.LogEntry; import me.lucko.luckperms.common.locale.CommandSpec; import me.lucko.luckperms.common.locale.LocaleManager; import me.lucko.luckperms.common.locale.Message; +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.node.NodeFactory; import me.lucko.luckperms.common.plugin.LuckPermsPlugin; import me.lucko.luckperms.common.utils.Predicates; import me.lucko.luckperms.exceptions.ObjectLacksException; @@ -54,7 +54,7 @@ import java.util.stream.Collectors; public class UserPromote extends SubCommand { public UserPromote(LocaleManager locale) { - super(CommandSpec.USER_PROMOTE.spec(locale), "promote", Permission.USER_PROMOTE, Predicates.is(0)); + super(CommandSpec.USER_PROMOTE.spec(locale), "promote", CommandPermission.USER_PROMOTE, Predicates.is(0)); } @Override diff --git a/common/src/main/java/me/lucko/luckperms/common/commands/impl/user/UserSwitchPrimaryGroup.java b/common/src/main/java/me/lucko/luckperms/common/commands/impl/user/UserSwitchPrimaryGroup.java index cde78a82..77f4412a 100644 --- a/common/src/main/java/me/lucko/luckperms/common/commands/impl/user/UserSwitchPrimaryGroup.java +++ b/common/src/main/java/me/lucko/luckperms/common/commands/impl/user/UserSwitchPrimaryGroup.java @@ -32,13 +32,13 @@ import me.lucko.luckperms.common.commands.CommandResult; import me.lucko.luckperms.common.commands.abstraction.SubCommand; import me.lucko.luckperms.common.commands.sender.Sender; import me.lucko.luckperms.common.config.ConfigKeys; -import me.lucko.luckperms.common.constants.Permission; -import me.lucko.luckperms.common.core.model.Group; -import me.lucko.luckperms.common.core.model.User; +import me.lucko.luckperms.common.constants.CommandPermission; import me.lucko.luckperms.common.data.LogEntry; import me.lucko.luckperms.common.locale.CommandSpec; import me.lucko.luckperms.common.locale.LocaleManager; import me.lucko.luckperms.common.locale.Message; +import me.lucko.luckperms.common.model.Group; +import me.lucko.luckperms.common.model.User; import me.lucko.luckperms.common.plugin.LuckPermsPlugin; import me.lucko.luckperms.common.utils.Predicates; @@ -46,7 +46,7 @@ import java.util.List; public class UserSwitchPrimaryGroup extends SubCommand { public UserSwitchPrimaryGroup(LocaleManager locale) { - super(CommandSpec.USER_SWITCHPRIMARYGROUP.spec(locale), "switchprimarygroup", Permission.USER_SWITCHPRIMARYGROUP, Predicates.not(1)); + super(CommandSpec.USER_SWITCHPRIMARYGROUP.spec(locale), "switchprimarygroup", CommandPermission.USER_SWITCHPRIMARYGROUP, Predicates.not(1)); } @Override diff --git a/common/src/main/java/me/lucko/luckperms/common/commands/sender/AbstractSender.java b/common/src/main/java/me/lucko/luckperms/common/commands/sender/AbstractSender.java index 65a14ce6..cb3c26f1 100644 --- a/common/src/main/java/me/lucko/luckperms/common/commands/sender/AbstractSender.java +++ b/common/src/main/java/me/lucko/luckperms/common/commands/sender/AbstractSender.java @@ -31,8 +31,8 @@ import lombok.Getter; import com.google.common.base.Splitter; import me.lucko.luckperms.api.Tristate; +import me.lucko.luckperms.common.constants.CommandPermission; import me.lucko.luckperms.common.constants.Constants; -import me.lucko.luckperms.common.constants.Permission; import me.lucko.luckperms.common.plugin.LuckPermsPlugin; import net.kyori.text.Component; @@ -122,19 +122,8 @@ public final class AbstractSender implements Sender { } @Override - public boolean hasPermission(Permission permission) { - if (isConsole()) return true; - - T t = ref.get(); - if (t != null) { - for (String s : permission.getNodes()) { - if (factory.hasPermission(t, s)) { - return true; - } - } - } - - return false; + public boolean hasPermission(CommandPermission permission) { + return hasPermission(permission.getPermission()); } @Override diff --git a/common/src/main/java/me/lucko/luckperms/common/commands/sender/Sender.java b/common/src/main/java/me/lucko/luckperms/common/commands/sender/Sender.java index b01af03b..792cd355 100644 --- a/common/src/main/java/me/lucko/luckperms/common/commands/sender/Sender.java +++ b/common/src/main/java/me/lucko/luckperms/common/commands/sender/Sender.java @@ -26,8 +26,8 @@ package me.lucko.luckperms.common.commands.sender; import me.lucko.luckperms.api.Tristate; +import me.lucko.luckperms.common.constants.CommandPermission; import me.lucko.luckperms.common.constants.Constants; -import me.lucko.luckperms.common.constants.Permission; import me.lucko.luckperms.common.plugin.LuckPermsPlugin; import net.kyori.text.Component; @@ -96,7 +96,7 @@ public interface Sender { * @param permission the permission to check for * @return true if the sender has the permission */ - boolean hasPermission(Permission permission); + boolean hasPermission(CommandPermission permission); /** * Gets whether this sender is the console diff --git a/common/src/main/java/me/lucko/luckperms/common/commands/utils/ArgumentUtils.java b/common/src/main/java/me/lucko/luckperms/common/commands/utils/ArgumentUtils.java index 6ed6a72d..4f79b8c9 100644 --- a/common/src/main/java/me/lucko/luckperms/common/commands/utils/ArgumentUtils.java +++ b/common/src/main/java/me/lucko/luckperms/common/commands/utils/ArgumentUtils.java @@ -45,7 +45,6 @@ import java.util.function.Function; public class ArgumentUtils { public static final Function WRAPPER = s -> s.contains(" ") ? "\"" + s + "\"" : s; - public static String handleString(int index, List args) { return args.get(index).replace("{SPACE}", " "); } @@ -108,13 +107,6 @@ public class ArgumentUtils { return true; } - public static String handleServer(int index, List args) throws ArgumentException { - if (args.size() > index) { - return args.get(index).toLowerCase(); - } - return null; - } - public static long handleDuration(int index, List args) throws ArgumentException { long duration; try { @@ -134,10 +126,6 @@ public class ArgumentUtils { return duration; } - public static String handleWorld(int index, List args) { - return args.size() > index ? args.get(index).toLowerCase() : null; - } - public static MutableContextSet handleContext(int fromIndex, List args, LuckPermsPlugin plugin) throws CommandException { if (args.size() > fromIndex) { MutableContextSet set = MutableContextSet.create(); diff --git a/common/src/main/java/me/lucko/luckperms/common/config/AbstractConfiguration.java b/common/src/main/java/me/lucko/luckperms/common/config/AbstractConfiguration.java index 74043475..31346a1d 100644 --- a/common/src/main/java/me/lucko/luckperms/common/config/AbstractConfiguration.java +++ b/common/src/main/java/me/lucko/luckperms/common/config/AbstractConfiguration.java @@ -37,9 +37,14 @@ import java.util.Optional; import java.util.Set; import java.util.stream.Collectors; +/** + * An abstract implementation of {@link LuckPermsConfiguration}, backed by a cache. + */ public abstract class AbstractConfiguration implements LuckPermsConfiguration { - private final LoadingCache, Optional> cache = Caffeine.newBuilder() - .build(key -> Optional.ofNullable(key.get(AbstractConfiguration.this))); + + // the loading cache for config keys --> their value + // the value is wrapped in an optional as null values don't get cached. + private final LoadingCache, Optional> cache = Caffeine.newBuilder().build(this::loadKeyValue); @Getter private final LPConfigurationDelegate delegate = new LPConfigurationDelegate(this); @@ -50,7 +55,11 @@ public abstract class AbstractConfiguration implements LuckPermsConfiguration { @SuppressWarnings("unchecked") @Override public T get(ConfigKey key) { - return (T) cache.get(key).orElse(null); + Optional ret = cache.get(key); + if (ret == null) { + return null; + } + return (T) ret.orElse(null); } @Override @@ -69,4 +78,8 @@ public abstract class AbstractConfiguration implements LuckPermsConfiguration { loadAll(); getPlugin().getApiProvider().getEventFactory().handleConfigReload(); } + + private Optional loadKeyValue(ConfigKey key) { + return Optional.ofNullable(key.get(this)); + } } diff --git a/common/src/main/java/me/lucko/luckperms/common/config/ConfigKey.java b/common/src/main/java/me/lucko/luckperms/common/config/ConfigKey.java index 01d57d5e..79babef2 100644 --- a/common/src/main/java/me/lucko/luckperms/common/config/ConfigKey.java +++ b/common/src/main/java/me/lucko/luckperms/common/config/ConfigKey.java @@ -25,8 +25,22 @@ package me.lucko.luckperms.common.config; +/** + * Represents a key in the configuration. + * + * @param the value type + */ public interface ConfigKey { + /** + * Resolves and returns the value mapped to this key using the given config instance. + * + *

The {@link LuckPermsConfiguration#get(ConfigKey)} method should be used to + * retrieve the value, as opposed to calling this directly.

+ * + * @param config the config instance + * @return the value mapped to this key + */ T get(LuckPermsConfiguration config); } diff --git a/common/src/main/java/me/lucko/luckperms/common/config/ConfigKeys.java b/common/src/main/java/me/lucko/luckperms/common/config/ConfigKeys.java index bba8f318..8ffc1175 100644 --- a/common/src/main/java/me/lucko/luckperms/common/config/ConfigKeys.java +++ b/common/src/main/java/me/lucko/luckperms/common/config/ConfigKeys.java @@ -39,11 +39,11 @@ import me.lucko.luckperms.common.config.keys.LowercaseStringKey; import me.lucko.luckperms.common.config.keys.MapKey; import me.lucko.luckperms.common.config.keys.StaticKey; import me.lucko.luckperms.common.config.keys.StringKey; -import me.lucko.luckperms.common.core.TemporaryModifier; -import me.lucko.luckperms.common.core.model.User; import me.lucko.luckperms.common.defaults.Rule; import me.lucko.luckperms.common.metastacking.definition.SimpleMetaStackDefinition; import me.lucko.luckperms.common.metastacking.definition.StandardStackElements; +import me.lucko.luckperms.common.model.TemporaryModifier; +import me.lucko.luckperms.common.model.User; import me.lucko.luckperms.common.primarygroup.AllParentsByWeightHolder; import me.lucko.luckperms.common.primarygroup.ParentsByWeightHolder; import me.lucko.luckperms.common.primarygroup.PrimaryGroupHolder; @@ -59,7 +59,7 @@ import java.util.Map; import java.util.function.Function; /** - * A class of static {@link ConfigKey}s used by the plugin. + * All of the {@link ConfigKey}s used by LuckPerms. */ @UtilityClass public class ConfigKeys { diff --git a/common/src/main/java/me/lucko/luckperms/common/config/ContextsFile.java b/common/src/main/java/me/lucko/luckperms/common/config/ContextsFile.java index 81d0a415..da9e688b 100644 --- a/common/src/main/java/me/lucko/luckperms/common/config/ContextsFile.java +++ b/common/src/main/java/me/lucko/luckperms/common/config/ContextsFile.java @@ -34,7 +34,7 @@ import com.google.gson.GsonBuilder; import com.google.gson.JsonObject; import me.lucko.luckperms.api.context.ImmutableContextSet; -import me.lucko.luckperms.common.core.NodeModel; +import me.lucko.luckperms.common.node.NodeModel; import java.io.BufferedReader; import java.io.BufferedWriter; @@ -43,6 +43,9 @@ import java.io.IOException; import java.nio.charset.StandardCharsets; import java.nio.file.Files; +/** + * A wrapper for the 'contexts.json' file. + */ @RequiredArgsConstructor public class ContextsFile { private final LuckPermsConfiguration configuration; diff --git a/common/src/main/java/me/lucko/luckperms/common/config/LuckPermsConfiguration.java b/common/src/main/java/me/lucko/luckperms/common/config/LuckPermsConfiguration.java index 540e7155..79e12d8b 100644 --- a/common/src/main/java/me/lucko/luckperms/common/config/LuckPermsConfiguration.java +++ b/common/src/main/java/me/lucko/luckperms/common/config/LuckPermsConfiguration.java @@ -31,20 +31,60 @@ import me.lucko.luckperms.common.plugin.LuckPermsPlugin; import java.util.List; import java.util.Map; +/** + * The master configuration used by LuckPerms. + */ public interface LuckPermsConfiguration { + /** + * Gets the API delegate for this class. + * + * @return the api delegate + */ LPConfigurationDelegate getDelegate(); + /** + * Gets the main plugin instance. + * + * @return the plugin instance + */ LuckPermsPlugin getPlugin(); + /** + * Gets the object which wraps the 'contexts.json' file. + * + * @return the contexts file wrapper object + */ ContextsFile getContextsFile(); + /** + * Initialises the configuration. + */ void init(); + /** + * Reloads the configuration. + */ void reload(); + /** + * Pre-loads all configuration keys into the cache. + */ void loadAll(); + /** + * Gets the value of a given context key. + * + * @param key the key + * @param the key return type + * @return the value mapped to the given key. May be null. + */ + T get(ConfigKey key); + + + + /* methods used by config keys to load their values */ + boolean contains(String path); String getString(String path, String def); @@ -59,6 +99,4 @@ public interface LuckPermsConfiguration { Map getMap(String path, Map def); - T get(ConfigKey key); - } diff --git a/common/src/main/java/me/lucko/luckperms/common/constants/CommandPermission.java b/common/src/main/java/me/lucko/luckperms/common/constants/CommandPermission.java new file mode 100644 index 00000000..ae69f562 --- /dev/null +++ b/common/src/main/java/me/lucko/luckperms/common/constants/CommandPermission.java @@ -0,0 +1,210 @@ +/* + * This file is part of LuckPerms, licensed under the MIT License. + * + * Copyright (c) lucko (Luck) + * Copyright (c) contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +package me.lucko.luckperms.common.constants; + +import lombok.AllArgsConstructor; +import lombok.Getter; + +import me.lucko.luckperms.common.commands.sender.Sender; + +import static me.lucko.luckperms.common.constants.CommandPermission.Type.GROUP; +import static me.lucko.luckperms.common.constants.CommandPermission.Type.LOG; +import static me.lucko.luckperms.common.constants.CommandPermission.Type.NONE; +import static me.lucko.luckperms.common.constants.CommandPermission.Type.SPONGE; +import static me.lucko.luckperms.common.constants.CommandPermission.Type.TRACK; +import static me.lucko.luckperms.common.constants.CommandPermission.Type.USER; + +/** + * An enumeration of the permissions required to execute built in LuckPerms commands. + */ +public enum CommandPermission { + + SYNC("sync", NONE), + INFO("info", NONE), + VERBOSE("verbose", NONE), + TREE("tree", NONE), + SEARCH("search", NONE), + CHECK("check", NONE), + IMPORT("import", NONE), + EXPORT("export", NONE), + RELOAD_CONFIG("reloadconfig", NONE), + BULK_UPDATE("bulkupdate", NONE), + APPLY_EDITS("applyedits", NONE), + MIGRATION("migration", NONE), + + CREATE_GROUP("creategroup", NONE), + DELETE_GROUP("deletegroup", NONE), + LIST_GROUPS("listgroups", NONE), + + CREATE_TRACK("createtrack", NONE), + DELETE_TRACK("deletetrack", NONE), + LIST_TRACKS("listtracks", NONE), + + USER_INFO("info", USER), + USER_PERM_INFO("permission.info", USER), + USER_PERM_SET("permission.set", USER), + USER_PERM_UNSET("permission.unset", USER), + USER_PERM_SETTEMP("permission.settemp", USER), + USER_PERM_UNSETTEMP("permission.unsettemp", USER), + USER_PERM_CHECK("permission.check", USER), + USER_PERM_CHECK_INHERITS("permission.checkinherits", USER), + USER_PARENT_INFO("parent.info", USER), + USER_PARENT_SET("parent.set", USER), + USER_PARENT_SET_TRACK("parent.settrack", USER), + USER_PARENT_ADD("parent.add", USER), + USER_PARENT_REMOVE("parent.remove", USER), + USER_PARENT_ADDTEMP("parent.addtemp", USER), + USER_PARENT_REMOVETEMP("parent.removetemp", USER), + USER_PARENT_CLEAR("parent.clear", USER), + USER_PARENT_CLEAR_TRACK("parent.cleartrack", USER), + USER_META_INFO("meta.info", USER), + USER_META_SET("meta.set", USER), + USER_META_UNSET("meta.unset", USER), + USER_META_SETTEMP("meta.settemp", USER), + USER_META_UNSETTEMP("meta.unsettemp", USER), + USER_META_ADDPREFIX("meta.addprefix", USER), + USER_META_ADDSUFFIX("meta.addsuffix", USER), + USER_META_REMOVEPREFIX("meta.removeprefix", USER), + USER_META_REMOVESUFFIX("meta.removesuffix", USER), + USER_META_ADDTEMP_PREFIX("meta.addtempprefix", USER), + USER_META_ADDTEMP_SUFFIX("meta.addtempsuffix", USER), + USER_META_REMOVETEMP_PREFIX("meta.removetempprefix", USER), + USER_META_REMOVETEMP_SUFFIX("meta.removetempsuffix", USER), + USER_META_CLEAR("meta.clear", USER), + USER_EDITOR("editor", USER), + USER_SWITCHPRIMARYGROUP("switchprimarygroup", USER), + USER_SHOWTRACKS("showtracks", USER), + USER_PROMOTE("promote", USER), + USER_DEMOTE("demote", USER), + USER_CLEAR("clear", USER), + + GROUP_INFO("info", GROUP), + GROUP_PERM_INFO("permission.info", GROUP), + GROUP_PERM_SET("permission.set", GROUP), + GROUP_PERM_UNSET("permission.unset", GROUP), + GROUP_PERM_SETTEMP("permission.settemp", GROUP), + GROUP_PERM_UNSETTEMP("permission.unsettemp", GROUP), + GROUP_PERM_CHECK("permission.check", GROUP), + GROUP_PERM_CHECK_INHERITS("permission.checkinherits", GROUP), + GROUP_PARENT_INFO("parent.info", GROUP), + GROUP_PARENT_SET("parent.set", GROUP), + GROUP_PARENT_SET_TRACK("parent.settrack", GROUP), + GROUP_PARENT_ADD("parent.add", GROUP), + GROUP_PARENT_REMOVE("parent.remove", GROUP), + GROUP_PARENT_ADDTEMP("parent.addtemp", GROUP), + GROUP_PARENT_REMOVETEMP("parent.removetemp", GROUP), + GROUP_PARENT_CLEAR("parent.clear", GROUP), + GROUP_PARENT_CLEAR_TRACK("parent.cleartrack", GROUP), + GROUP_META_INFO("meta.info", GROUP), + GROUP_META_SET("meta.set", GROUP), + GROUP_META_UNSET("meta.unset", GROUP), + GROUP_META_SETTEMP("meta.settemp", GROUP), + GROUP_META_UNSETTEMP("meta.unsettemp", GROUP), + GROUP_META_ADDPREFIX("meta.addprefix", GROUP), + GROUP_META_ADDSUFFIX("meta.addsuffix", GROUP), + GROUP_META_REMOVEPREFIX("meta.removeprefix", GROUP), + GROUP_META_REMOVESUFFIX("meta.removesuffix", GROUP), + GROUP_META_ADDTEMP_PREFIX("meta.addtempprefix", GROUP), + GROUP_META_ADDTEMP_SUFFIX("meta.addtempsuffix", GROUP), + GROUP_META_REMOVETEMP_PREFIX("meta.removetempprefix", GROUP), + GROUP_META_REMOVETEMP_SUFFIX("meta.removetempsuffix", GROUP), + GROUP_META_CLEAR("meta.clear", GROUP), + GROUP_EDITOR("editor", GROUP), + GROUP_LISTMEMBERS("listmembers", GROUP), + GROUP_SHOWTRACKS("showtracks", GROUP), + GROUP_SETWEIGHT("setweight", GROUP), + GROUP_CLEAR("clear", GROUP), + GROUP_RENAME("rename", GROUP), + GROUP_CLONE("clone", GROUP), + + TRACK_INFO("info", TRACK), + TRACK_APPEND("append", TRACK), + TRACK_INSERT("insert", TRACK), + TRACK_REMOVE("remove", TRACK), + TRACK_CLEAR("clear", TRACK), + TRACK_RENAME("rename", TRACK), + TRACK_CLONE("clone", TRACK), + + LOG_RECENT("recent", LOG), + LOG_USER_HISTORY("userhistory", LOG), + LOG_GROUP_HISTORY("grouphistory", LOG), + LOG_TRACK_HISTORY("trackhistory", LOG), + LOG_SEARCH("search", LOG), + LOG_NOTIFY("notify", LOG), + + SPONGE_PERMISSION_INFO("permission.info", SPONGE), + SPONGE_PERMISSION_SET("permission.set", SPONGE), + SPONGE_PERMISSION_CLEAR("permission.clear", SPONGE), + SPONGE_PARENT_INFO("parent.info", SPONGE), + SPONGE_PARENT_ADD("parent.add", SPONGE), + SPONGE_PARENT_REMOVE("parent.remove", SPONGE), + SPONGE_PARENT_CLEAR("parent.clear", SPONGE), + SPONGE_OPTION_INFO("option.info", SPONGE), + SPONGE_OPTION_SET("option.set", SPONGE), + SPONGE_OPTION_UNSET("option.unset", SPONGE), + SPONGE_OPTION_CLEAR("option.clear", SPONGE); + + public static final String ROOT = "luckperms."; + + private String node; + + @Getter + private Type type; + + CommandPermission(String node, Type type) { + this.type = type; + + if (type == NONE) { + this.node = ROOT + node; + } else { + this.node = ROOT + type.getTag() + "." + node; + } + } + + public String getPermission() { + return node; + } + + public boolean isAuthorized(Sender sender) { + return sender.hasPermission(this); + } + + @Getter + @AllArgsConstructor + public enum Type { + + NONE(null), + USER("user"), + GROUP("group"), + TRACK("track"), + LOG("log"), + SPONGE("sponge"); + + private final String tag; + + } + +} diff --git a/common/src/main/java/me/lucko/luckperms/common/constants/Constants.java b/common/src/main/java/me/lucko/luckperms/common/constants/Constants.java index a0728546..767db34d 100644 --- a/common/src/main/java/me/lucko/luckperms/common/constants/Constants.java +++ b/common/src/main/java/me/lucko/luckperms/common/constants/Constants.java @@ -29,14 +29,18 @@ import lombok.experimental.UtilityClass; import java.util.UUID; +/** + * Random constants used throughout the plugin implementation. + */ @UtilityClass public class Constants { public static final UUID CONSOLE_UUID = UUID.fromString("00000000-0000-0000-0000-000000000000"); public static final String CONSOLE_NAME = "Console"; + public static final UUID IMPORT_UUID = UUID.fromString("11111111-1111-1111-1111-111111111111"); public static final String IMPORT_NAME = "Import"; - public static final String LOG_FORMAT = "&8(&e%s&8) [&a%s&8] (&b%s&8) &7--> &f%s"; + public static final char COLOR_CHAR = '\u00A7'; public static final char FORMAT_CHAR = '&'; diff --git a/common/src/main/java/me/lucko/luckperms/common/constants/Permission.java b/common/src/main/java/me/lucko/luckperms/common/constants/Permission.java deleted file mode 100644 index 9aead92b..00000000 --- a/common/src/main/java/me/lucko/luckperms/common/constants/Permission.java +++ /dev/null @@ -1,211 +0,0 @@ -/* - * This file is part of LuckPerms, licensed under the MIT License. - * - * Copyright (c) lucko (Luck) - * Copyright (c) contributors - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. - */ - -package me.lucko.luckperms.common.constants; - -import lombok.AllArgsConstructor; -import lombok.Getter; - -import com.google.common.base.Preconditions; - -import me.lucko.luckperms.common.commands.sender.Sender; -import me.lucko.luckperms.common.utils.ImmutableCollectors; - -import java.util.Arrays; -import java.util.List; - -@SuppressWarnings("SpellCheckingInspection") -@Getter -public enum Permission { - - SYNC(list("sync"), Type.NONE), - INFO(list("info"), Type.NONE), - VERBOSE(list("verbose"), Type.NONE), - TREE(list("tree"), Type.NONE), - SEARCH(list("search"), Type.NONE), - CHECK(list("check"), Type.NONE), - IMPORT(list("import"), Type.NONE), - EXPORT(list("export"), Type.NONE), - RELOAD_CONFIG(list("reloadconfig"), Type.NONE), - BULK_UPDATE(list("bulkupdate"), Type.NONE), - APPLY_EDITS(list("applyedits"), Type.NONE), - MIGRATION(list("migration"), Type.NONE), - - CREATE_GROUP(list("creategroup"), Type.NONE), - DELETE_GROUP(list("deletegroup"), Type.NONE), - LIST_GROUPS(list("listgroups"), Type.NONE), - - CREATE_TRACK(list("createtrack"), Type.NONE), - DELETE_TRACK(list("deletetrack"), Type.NONE), - LIST_TRACKS(list("listtracks"), Type.NONE), - - USER_INFO(list("info"), Type.USER), - USER_PERM_INFO(list("permission.info", "listnodes"), Type.USER), - USER_PERM_SET(list("permission.set", "setpermission"), Type.USER), - USER_PERM_UNSET(list("permission.unset", "unsetpermission"), Type.USER), - USER_PERM_SETTEMP(list("permission.settemp", "settemppermission"), Type.USER), - USER_PERM_UNSETTEMP(list("permission.unsettemp", "unsettemppermission"), Type.USER), - USER_PERM_CHECK(list("permission.check", "haspermission"), Type.USER), - USER_PERM_CHECK_INHERITS(list("permission.checkinherits", "inheritspermission"), Type.USER), - USER_PARENT_INFO(list("parent.info", "listgroups"), Type.USER), - USER_PARENT_SET(list("parent.set"), Type.USER), - USER_PARENT_SET_TRACK(list("parent.settrack"), Type.USER), - USER_PARENT_ADD(list("parent.add", "addgroup"), Type.USER), - USER_PARENT_REMOVE(list("parent.remove", "removegroup"), Type.USER), - USER_PARENT_ADDTEMP(list("parent.addtemp", "addtempgroup"), Type.USER), - USER_PARENT_REMOVETEMP(list("parent.removetemp", "removetempgroup"), Type.USER), - USER_PARENT_CLEAR(list("parent.clear"), Type.USER), - USER_PARENT_CLEAR_TRACK(list("parent.cleartrack"), Type.USER), - USER_META_INFO(list("meta.info", "chatmeta"), Type.USER), - USER_META_SET(list("meta.set", "setmeta"), Type.USER), - USER_META_UNSET(list("meta.unset", "unsetmeta"), Type.USER), - USER_META_SETTEMP(list("meta.settemp", "settempmeta"), Type.USER), - USER_META_UNSETTEMP(list("meta.unsettemp", "unsettempmeta"), Type.USER), - USER_META_ADDPREFIX(list("meta.addprefix", "addprefix"), Type.USER), - USER_META_ADDSUFFIX(list("meta.addsuffix", "addsuffix"), Type.USER), - USER_META_REMOVEPREFIX(list("meta.removeprefix", "removeprefix"), Type.USER), - USER_META_REMOVESUFFIX(list("meta.removesuffix", "removesuffix"), Type.USER), - USER_META_ADDTEMP_PREFIX(list("meta.addtempprefix", "addtempprefix"), Type.USER), - USER_META_ADDTEMP_SUFFIX(list("meta.addtempsuffix", "addtempsuffix"), Type.USER), - USER_META_REMOVETEMP_PREFIX(list("meta.removetempprefix", "removetempprefix"), Type.USER), - USER_META_REMOVETEMP_SUFFIX(list("meta.removetempsuffix", "removetempsuffix"), Type.USER), - USER_META_CLEAR(list("meta.clear", "clearmeta"), Type.USER), - USER_EDITOR(list("editor"), Type.USER), - USER_SWITCHPRIMARYGROUP(list("switchprimarygroup", "setprimarygroup"), Type.USER), - USER_SHOWTRACKS(list("showtracks"), Type.USER), - USER_PROMOTE(list("promote"), Type.USER), - USER_DEMOTE(list("demote"), Type.USER), - USER_CLEAR(list("clear"), Type.USER), - - GROUP_INFO(list("info"), Type.GROUP), - GROUP_PERM_INFO(list("permission.info", "listnodes"), Type.GROUP), - GROUP_PERM_SET(list("permission.set", "setpermission"), Type.GROUP), - GROUP_PERM_UNSET(list("permission.unset", "unsetpermission"), Type.GROUP), - GROUP_PERM_SETTEMP(list("permission.settemp", "settemppermission"), Type.GROUP), - GROUP_PERM_UNSETTEMP(list("permission.unsettemp", "unsettemppermission"), Type.GROUP), - GROUP_PERM_CHECK(list("permission.check", "haspermission"), Type.GROUP), - GROUP_PERM_CHECK_INHERITS(list("permission.checkinherits", "inheritspermission"), Type.GROUP), - GROUP_PARENT_INFO(list("parent.info", "listparents"), Type.GROUP), - GROUP_PARENT_SET(list("parent.set"), Type.GROUP), - GROUP_PARENT_SET_TRACK(list("parent.settrack"), Type.GROUP), - GROUP_PARENT_ADD(list("parent.add", "setinherit"), Type.GROUP), - GROUP_PARENT_REMOVE(list("parent.remove", "unsetinherit"), Type.GROUP), - GROUP_PARENT_ADDTEMP(list("parent.addtemp", "settempinherit"), Type.GROUP), - GROUP_PARENT_REMOVETEMP(list("parent.removetemp", "unsettempinherit"), Type.GROUP), - GROUP_PARENT_CLEAR(list("parent.clear"), Type.GROUP), - GROUP_PARENT_CLEAR_TRACK(list("parent.cleartrack"), Type.GROUP), - GROUP_META_INFO(list("meta.info", "chatmeta"), Type.GROUP), - GROUP_META_SET(list("meta.set", "setmeta"), Type.GROUP), - GROUP_META_UNSET(list("meta.unset", "unsetmeta"), Type.GROUP), - GROUP_META_SETTEMP(list("meta.settemp", "settempmeta"), Type.GROUP), - GROUP_META_UNSETTEMP(list("meta.unsettemp", "unsettempmeta"), Type.GROUP), - GROUP_META_ADDPREFIX(list("meta.addprefix", "addprefix"), Type.GROUP), - GROUP_META_ADDSUFFIX(list("meta.addsuffix", "addsuffix"), Type.GROUP), - GROUP_META_REMOVEPREFIX(list("meta.removeprefix", "removeprefix"), Type.GROUP), - GROUP_META_REMOVESUFFIX(list("meta.removesuffix", "removesuffix"), Type.GROUP), - GROUP_META_ADDTEMP_PREFIX(list("meta.addtempprefix", "addtempprefix"), Type.GROUP), - GROUP_META_ADDTEMP_SUFFIX(list("meta.addtempsuffix", "addtempsuffix"), Type.GROUP), - GROUP_META_REMOVETEMP_PREFIX(list("meta.removetempprefix", "removetempprefix"), Type.GROUP), - GROUP_META_REMOVETEMP_SUFFIX(list("meta.removetempsuffix", "removetempsuffix"), Type.GROUP), - GROUP_META_CLEAR(list("meta.clear", "clearmeta"), Type.GROUP), - GROUP_EDITOR(list("editor"), Type.GROUP), - GROUP_LISTMEMBERS(list("listmembers"), Type.GROUP), - GROUP_SHOWTRACKS(list("showtracks"), Type.GROUP), - GROUP_SETWEIGHT(list("setweight"), Type.GROUP), - GROUP_CLEAR(list("clear"), Type.GROUP), - GROUP_RENAME(list("rename"), Type.GROUP), - GROUP_CLONE(list("clone"), Type.GROUP), - - TRACK_INFO(list("info"), Type.TRACK), - TRACK_APPEND(list("append"), Type.TRACK), - TRACK_INSERT(list("insert"), Type.TRACK), - TRACK_REMOVE(list("remove"), Type.TRACK), - TRACK_CLEAR(list("clear"), Type.TRACK), - TRACK_RENAME(list("rename"), Type.TRACK), - TRACK_CLONE(list("clone"), Type.TRACK), - - LOG_RECENT(list("recent"), Type.LOG), - LOG_USER_HISTORY(list("userhistory"), Type.LOG), - LOG_GROUP_HISTORY(list("grouphistory"), Type.LOG), - LOG_TRACK_HISTORY(list("trackhistory"), Type.LOG), - LOG_SEARCH(list("search"), Type.LOG), - LOG_NOTIFY(list("notify"), Type.LOG), - - SPONGE_PERMISSION_INFO(list("permission.info"), Type.SPONGE), - SPONGE_PERMISSION_SET(list("permission.set"), Type.SPONGE), - SPONGE_PERMISSION_CLEAR(list("permission.clear"), Type.SPONGE), - SPONGE_PARENT_INFO(list("parent.info"), Type.SPONGE), - SPONGE_PARENT_ADD(list("parent.add"), Type.SPONGE), - SPONGE_PARENT_REMOVE(list("parent.remove"), Type.SPONGE), - SPONGE_PARENT_CLEAR(list("parent.clear"), Type.SPONGE), - SPONGE_OPTION_INFO(list("option.info"), Type.SPONGE), - SPONGE_OPTION_SET(list("option.set"), Type.SPONGE), - SPONGE_OPTION_UNSET(list("option.unset"), Type.SPONGE), - SPONGE_OPTION_CLEAR(list("option.clear"), Type.SPONGE); - - public static final String ROOT = "luckperms."; - - private static List list(String... args) { - return Arrays.asList(args); - } - - private List nodes; - private Type type; - - Permission(List tags, Type type) { - this.type = type; - Preconditions.checkArgument(tags != null && !tags.isEmpty()); - - if (type == Type.NONE) { - this.nodes = tags.stream().map(t -> ROOT + t).collect(ImmutableCollectors.toImmutableList()); - } else { - this.nodes = tags.stream().map(t -> ROOT + type.getTag() + "." + t).collect(ImmutableCollectors.toImmutableList()); - } - } - - public String getPrimaryPermission() { - return nodes.get(0); - } - - public boolean isAuthorized(Sender sender) { - return sender.hasPermission(this); - } - - @Getter - @AllArgsConstructor - public enum Type { - - NONE(null), - USER("user"), - GROUP("group"), - TRACK("track"), - LOG("log"), - SPONGE("sponge"); - - private final String tag; - - } - -} diff --git a/common/src/main/java/me/lucko/luckperms/common/core/ContextSetComparator.java b/common/src/main/java/me/lucko/luckperms/common/contexts/ContextSetComparator.java similarity index 99% rename from common/src/main/java/me/lucko/luckperms/common/core/ContextSetComparator.java rename to common/src/main/java/me/lucko/luckperms/common/contexts/ContextSetComparator.java index 7c4f43df..1432c77f 100644 --- a/common/src/main/java/me/lucko/luckperms/common/core/ContextSetComparator.java +++ b/common/src/main/java/me/lucko/luckperms/common/contexts/ContextSetComparator.java @@ -23,7 +23,7 @@ * SOFTWARE. */ -package me.lucko.luckperms.common.core; +package me.lucko.luckperms.common.contexts; import me.lucko.luckperms.api.context.ImmutableContextSet; diff --git a/common/src/main/java/me/lucko/luckperms/common/utils/ExtractedContexts.java b/common/src/main/java/me/lucko/luckperms/common/contexts/ExtractedContexts.java similarity index 98% rename from common/src/main/java/me/lucko/luckperms/common/utils/ExtractedContexts.java rename to common/src/main/java/me/lucko/luckperms/common/contexts/ExtractedContexts.java index 102e6b34..0abfd490 100644 --- a/common/src/main/java/me/lucko/luckperms/common/utils/ExtractedContexts.java +++ b/common/src/main/java/me/lucko/luckperms/common/contexts/ExtractedContexts.java @@ -23,7 +23,7 @@ * SOFTWARE. */ -package me.lucko.luckperms.common.utils; +package me.lucko.luckperms.common.contexts; import lombok.EqualsAndHashCode; import lombok.Getter; diff --git a/common/src/main/java/me/lucko/luckperms/common/contexts/StaticCalculator.java b/common/src/main/java/me/lucko/luckperms/common/contexts/LuckPermsCalculator.java similarity index 96% rename from common/src/main/java/me/lucko/luckperms/common/contexts/StaticCalculator.java rename to common/src/main/java/me/lucko/luckperms/common/contexts/LuckPermsCalculator.java index 9e89f9dc..5bfc975e 100644 --- a/common/src/main/java/me/lucko/luckperms/common/contexts/StaticCalculator.java +++ b/common/src/main/java/me/lucko/luckperms/common/contexts/LuckPermsCalculator.java @@ -33,7 +33,7 @@ import me.lucko.luckperms.common.config.ConfigKeys; import me.lucko.luckperms.common.config.LuckPermsConfiguration; @AllArgsConstructor -public class StaticCalculator implements ContextCalculator { +public class LuckPermsCalculator implements ContextCalculator { private final LuckPermsConfiguration config; @Override diff --git a/common/src/main/java/me/lucko/luckperms/common/data/Exporter.java b/common/src/main/java/me/lucko/luckperms/common/data/Exporter.java index 577744c6..077b09a7 100644 --- a/common/src/main/java/me/lucko/luckperms/common/data/Exporter.java +++ b/common/src/main/java/me/lucko/luckperms/common/data/Exporter.java @@ -28,13 +28,13 @@ package me.lucko.luckperms.common.data; import me.lucko.luckperms.api.Node; import me.lucko.luckperms.common.commands.sender.Sender; import me.lucko.luckperms.common.commands.utils.Util; -import me.lucko.luckperms.common.core.NodeFactory; -import me.lucko.luckperms.common.core.model.Track; -import me.lucko.luckperms.common.core.model.User; import me.lucko.luckperms.common.locale.Message; +import me.lucko.luckperms.common.logging.ProgressLogger; +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.storage.Storage; -import me.lucko.luckperms.common.utils.ProgressLogger; import java.io.BufferedWriter; import java.io.IOException; diff --git a/common/src/main/java/me/lucko/luckperms/common/data/LogEntry.java b/common/src/main/java/me/lucko/luckperms/common/data/LogEntry.java index 599440c1..e0f68907 100644 --- a/common/src/main/java/me/lucko/luckperms/common/data/LogEntry.java +++ b/common/src/main/java/me/lucko/luckperms/common/data/LogEntry.java @@ -27,12 +27,12 @@ package me.lucko.luckperms.common.data; import me.lucko.luckperms.common.commands.sender.Sender; import me.lucko.luckperms.common.config.ConfigKeys; -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.core.model.User; +import me.lucko.luckperms.common.constants.CommandPermission; 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.model.User; import me.lucko.luckperms.common.plugin.LuckPermsPlugin; import me.lucko.luckperms.common.utils.DateUtil; @@ -67,12 +67,12 @@ public class LogEntry extends me.lucko.luckperms.api.LogEntry { if (sender == null) { senders.stream() - .filter(Permission.LOG_NOTIFY::isAuthorized) + .filter(CommandPermission.LOG_NOTIFY::isAuthorized) .filter(s -> !plugin.getIgnoringLogs().contains(s.getUuid())) .forEach(s -> Message.LOG.send(s, msg)); } else { senders.stream() - .filter(Permission.LOG_NOTIFY::isAuthorized) + .filter(CommandPermission.LOG_NOTIFY::isAuthorized) .filter(s -> !plugin.getIgnoringLogs().contains(s.getUuid())) .filter(s -> !s.getUuid().equals(sender.getUuid())) .forEach(s -> Message.LOG.send(s, msg)); diff --git a/common/src/main/java/me/lucko/luckperms/common/defaults/LogicParser.java b/common/src/main/java/me/lucko/luckperms/common/defaults/LogicParser.java index 83a53ace..4a8df38d 100644 --- a/common/src/main/java/me/lucko/luckperms/common/defaults/LogicParser.java +++ b/common/src/main/java/me/lucko/luckperms/common/defaults/LogicParser.java @@ -26,8 +26,8 @@ package me.lucko.luckperms.common.defaults; import me.lucko.luckperms.api.Tristate; -import me.lucko.luckperms.common.core.NodeFactory; -import me.lucko.luckperms.common.core.model.PermissionHolder; +import me.lucko.luckperms.common.model.PermissionHolder; +import me.lucko.luckperms.common.node.NodeFactory; import me.lucko.luckperms.common.utils.Scripting; import java.util.function.Function; diff --git a/common/src/main/java/me/lucko/luckperms/common/defaults/Rule.java b/common/src/main/java/me/lucko/luckperms/common/defaults/Rule.java index 809ab9e7..e2f9ec21 100644 --- a/common/src/main/java/me/lucko/luckperms/common/defaults/Rule.java +++ b/common/src/main/java/me/lucko/luckperms/common/defaults/Rule.java @@ -30,8 +30,8 @@ import lombok.Getter; import lombok.ToString; import me.lucko.luckperms.api.Tristate; -import me.lucko.luckperms.common.core.NodeFactory; -import me.lucko.luckperms.common.core.model.User; +import me.lucko.luckperms.common.model.User; +import me.lucko.luckperms.common.node.NodeFactory; import java.util.List; diff --git a/common/src/main/java/me/lucko/luckperms/common/event/EventFactory.java b/common/src/main/java/me/lucko/luckperms/common/event/EventFactory.java index 3819e0c0..8bd3a6de 100644 --- a/common/src/main/java/me/lucko/luckperms/common/event/EventFactory.java +++ b/common/src/main/java/me/lucko/luckperms/common/event/EventFactory.java @@ -36,10 +36,6 @@ import me.lucko.luckperms.api.caching.UserData; import me.lucko.luckperms.api.event.LuckPermsEvent; import me.lucko.luckperms.api.event.cause.CreationCause; import me.lucko.luckperms.api.event.cause.DeletionCause; -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.event.impl.EventConfigReload; import me.lucko.luckperms.common.event.impl.EventGroupCreate; import me.lucko.luckperms.common.event.impl.EventGroupDelete; @@ -66,6 +62,10 @@ import me.lucko.luckperms.common.event.impl.EventUserDemote; import me.lucko.luckperms.common.event.impl.EventUserFirstLogin; import me.lucko.luckperms.common.event.impl.EventUserLoad; import me.lucko.luckperms.common.event.impl.EventUserPromote; +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 java.util.List; import java.util.Set; diff --git a/common/src/main/java/me/lucko/luckperms/common/utils/ProgressLogger.java b/common/src/main/java/me/lucko/luckperms/common/logging/ProgressLogger.java similarity index 98% rename from common/src/main/java/me/lucko/luckperms/common/utils/ProgressLogger.java rename to common/src/main/java/me/lucko/luckperms/common/logging/ProgressLogger.java index 3ec28f0b..13535d72 100644 --- a/common/src/main/java/me/lucko/luckperms/common/utils/ProgressLogger.java +++ b/common/src/main/java/me/lucko/luckperms/common/logging/ProgressLogger.java @@ -23,7 +23,7 @@ * SOFTWARE. */ -package me.lucko.luckperms.common.utils; +package me.lucko.luckperms.common.logging; import lombok.Getter; import lombok.RequiredArgsConstructor; diff --git a/common/src/main/java/me/lucko/luckperms/common/utils/SenderLogger.java b/common/src/main/java/me/lucko/luckperms/common/logging/SenderLogger.java similarity index 98% rename from common/src/main/java/me/lucko/luckperms/common/utils/SenderLogger.java rename to common/src/main/java/me/lucko/luckperms/common/logging/SenderLogger.java index c571cb46..61a629aa 100644 --- a/common/src/main/java/me/lucko/luckperms/common/utils/SenderLogger.java +++ b/common/src/main/java/me/lucko/luckperms/common/logging/SenderLogger.java @@ -23,7 +23,7 @@ * SOFTWARE. */ -package me.lucko.luckperms.common.utils; +package me.lucko.luckperms.common.logging; import lombok.AllArgsConstructor; import lombok.NonNull; diff --git a/common/src/main/java/me/lucko/luckperms/common/managers/AbstractManager.java b/common/src/main/java/me/lucko/luckperms/common/managers/AbstractManager.java index cba41991..a01ec045 100644 --- a/common/src/main/java/me/lucko/luckperms/common/managers/AbstractManager.java +++ b/common/src/main/java/me/lucko/luckperms/common/managers/AbstractManager.java @@ -30,7 +30,7 @@ import com.github.benmanes.caffeine.cache.Caffeine; import com.github.benmanes.caffeine.cache.LoadingCache; import com.google.common.collect.ImmutableMap; -import me.lucko.luckperms.common.utils.Identifiable; +import me.lucko.luckperms.common.references.Identifiable; import java.util.Map; diff --git a/common/src/main/java/me/lucko/luckperms/common/managers/impl/GenericGroupManager.java b/common/src/main/java/me/lucko/luckperms/common/managers/GenericGroupManager.java similarity index 88% rename from common/src/main/java/me/lucko/luckperms/common/managers/impl/GenericGroupManager.java rename to common/src/main/java/me/lucko/luckperms/common/managers/GenericGroupManager.java index 4a486eb2..e30fd077 100644 --- a/common/src/main/java/me/lucko/luckperms/common/managers/impl/GenericGroupManager.java +++ b/common/src/main/java/me/lucko/luckperms/common/managers/GenericGroupManager.java @@ -23,13 +23,11 @@ * SOFTWARE. */ -package me.lucko.luckperms.common.managers.impl; +package me.lucko.luckperms.common.managers; import lombok.RequiredArgsConstructor; -import me.lucko.luckperms.common.core.model.Group; -import me.lucko.luckperms.common.managers.AbstractManager; -import me.lucko.luckperms.common.managers.GroupManager; +import me.lucko.luckperms.common.model.Group; import me.lucko.luckperms.common.plugin.LuckPermsPlugin; @RequiredArgsConstructor diff --git a/common/src/main/java/me/lucko/luckperms/common/managers/impl/GenericTrackManager.java b/common/src/main/java/me/lucko/luckperms/common/managers/GenericTrackManager.java similarity index 88% rename from common/src/main/java/me/lucko/luckperms/common/managers/impl/GenericTrackManager.java rename to common/src/main/java/me/lucko/luckperms/common/managers/GenericTrackManager.java index 54079bf2..11bebf13 100644 --- a/common/src/main/java/me/lucko/luckperms/common/managers/impl/GenericTrackManager.java +++ b/common/src/main/java/me/lucko/luckperms/common/managers/GenericTrackManager.java @@ -23,13 +23,11 @@ * SOFTWARE. */ -package me.lucko.luckperms.common.managers.impl; +package me.lucko.luckperms.common.managers; import lombok.AllArgsConstructor; -import me.lucko.luckperms.common.core.model.Track; -import me.lucko.luckperms.common.managers.AbstractManager; -import me.lucko.luckperms.common.managers.TrackManager; +import me.lucko.luckperms.common.model.Track; import me.lucko.luckperms.common.plugin.LuckPermsPlugin; @AllArgsConstructor diff --git a/common/src/main/java/me/lucko/luckperms/common/managers/impl/GenericUserManager.java b/common/src/main/java/me/lucko/luckperms/common/managers/GenericUserManager.java similarity index 94% rename from common/src/main/java/me/lucko/luckperms/common/managers/impl/GenericUserManager.java rename to common/src/main/java/me/lucko/luckperms/common/managers/GenericUserManager.java index 2197b2b7..ec27b6d9 100644 --- a/common/src/main/java/me/lucko/luckperms/common/managers/impl/GenericUserManager.java +++ b/common/src/main/java/me/lucko/luckperms/common/managers/GenericUserManager.java @@ -23,17 +23,15 @@ * SOFTWARE. */ -package me.lucko.luckperms.common.managers.impl; +package me.lucko.luckperms.common.managers; import lombok.RequiredArgsConstructor; import me.lucko.luckperms.api.Node; -import me.lucko.luckperms.common.core.NodeFactory; -import me.lucko.luckperms.common.core.UserIdentifier; -import me.lucko.luckperms.common.core.model.User; -import me.lucko.luckperms.common.managers.AbstractManager; -import me.lucko.luckperms.common.managers.UserManager; +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.references.UserIdentifier; import java.util.Optional; import java.util.Set; diff --git a/common/src/main/java/me/lucko/luckperms/common/managers/GroupManager.java b/common/src/main/java/me/lucko/luckperms/common/managers/GroupManager.java index 5afd9213..3a945cbb 100644 --- a/common/src/main/java/me/lucko/luckperms/common/managers/GroupManager.java +++ b/common/src/main/java/me/lucko/luckperms/common/managers/GroupManager.java @@ -25,7 +25,7 @@ package me.lucko.luckperms.common.managers; -import me.lucko.luckperms.common.core.model.Group; +import me.lucko.luckperms.common.model.Group; public interface GroupManager extends Manager { diff --git a/common/src/main/java/me/lucko/luckperms/common/managers/Manager.java b/common/src/main/java/me/lucko/luckperms/common/managers/Manager.java index 0fb23dd1..35dd44af 100644 --- a/common/src/main/java/me/lucko/luckperms/common/managers/Manager.java +++ b/common/src/main/java/me/lucko/luckperms/common/managers/Manager.java @@ -25,7 +25,7 @@ package me.lucko.luckperms.common.managers; -import me.lucko.luckperms.common.utils.Identifiable; +import me.lucko.luckperms.common.references.Identifiable; import java.util.Map; import java.util.function.Function; diff --git a/common/src/main/java/me/lucko/luckperms/common/managers/TrackManager.java b/common/src/main/java/me/lucko/luckperms/common/managers/TrackManager.java index db8efa3d..22f6488b 100644 --- a/common/src/main/java/me/lucko/luckperms/common/managers/TrackManager.java +++ b/common/src/main/java/me/lucko/luckperms/common/managers/TrackManager.java @@ -25,7 +25,7 @@ package me.lucko.luckperms.common.managers; -import me.lucko.luckperms.common.core.model.Track; +import me.lucko.luckperms.common.model.Track; public interface TrackManager extends Manager { diff --git a/common/src/main/java/me/lucko/luckperms/common/managers/UserManager.java b/common/src/main/java/me/lucko/luckperms/common/managers/UserManager.java index 2af38772..99f7756d 100644 --- a/common/src/main/java/me/lucko/luckperms/common/managers/UserManager.java +++ b/common/src/main/java/me/lucko/luckperms/common/managers/UserManager.java @@ -25,9 +25,9 @@ package me.lucko.luckperms.common.managers; -import me.lucko.luckperms.common.core.UserIdentifier; -import me.lucko.luckperms.common.core.model.User; -import me.lucko.luckperms.common.utils.Identifiable; +import me.lucko.luckperms.common.model.User; +import me.lucko.luckperms.common.references.Identifiable; +import me.lucko.luckperms.common.references.UserIdentifier; import java.util.UUID; diff --git a/common/src/main/java/me/lucko/luckperms/common/messaging/AbstractMessagingService.java b/common/src/main/java/me/lucko/luckperms/common/messaging/AbstractMessagingService.java index a466f3b2..606a721c 100644 --- a/common/src/main/java/me/lucko/luckperms/common/messaging/AbstractMessagingService.java +++ b/common/src/main/java/me/lucko/luckperms/common/messaging/AbstractMessagingService.java @@ -28,8 +28,8 @@ package me.lucko.luckperms.common.messaging; import lombok.Getter; import lombok.RequiredArgsConstructor; +import me.lucko.luckperms.common.buffers.BufferedRequest; import me.lucko.luckperms.common.plugin.LuckPermsPlugin; -import me.lucko.luckperms.common.utils.BufferedRequest; import java.util.Collections; import java.util.HashSet; diff --git a/common/src/main/java/me/lucko/luckperms/common/messaging/InternalMessagingService.java b/common/src/main/java/me/lucko/luckperms/common/messaging/InternalMessagingService.java index 9884a0cd..01e2e5bc 100644 --- a/common/src/main/java/me/lucko/luckperms/common/messaging/InternalMessagingService.java +++ b/common/src/main/java/me/lucko/luckperms/common/messaging/InternalMessagingService.java @@ -26,7 +26,7 @@ package me.lucko.luckperms.common.messaging; import me.lucko.luckperms.api.MessagingService; -import me.lucko.luckperms.common.utils.BufferedRequest; +import me.lucko.luckperms.common.buffers.BufferedRequest; public interface InternalMessagingService extends MessagingService { diff --git a/common/src/main/java/me/lucko/luckperms/common/messaging/NoopMessagingService.java b/common/src/main/java/me/lucko/luckperms/common/messaging/NoopMessagingService.java index 650f332c..bd34fd09 100644 --- a/common/src/main/java/me/lucko/luckperms/common/messaging/NoopMessagingService.java +++ b/common/src/main/java/me/lucko/luckperms/common/messaging/NoopMessagingService.java @@ -25,7 +25,7 @@ package me.lucko.luckperms.common.messaging; -import me.lucko.luckperms.common.utils.BufferedRequest; +import me.lucko.luckperms.common.buffers.BufferedRequest; public class NoopMessagingService implements InternalMessagingService { diff --git a/common/src/main/java/me/lucko/luckperms/common/metastacking/definition/StandardStackElements.java b/common/src/main/java/me/lucko/luckperms/common/metastacking/definition/StandardStackElements.java index 11e939a6..4db7a0e4 100644 --- a/common/src/main/java/me/lucko/luckperms/common/metastacking/definition/StandardStackElements.java +++ b/common/src/main/java/me/lucko/luckperms/common/metastacking/definition/StandardStackElements.java @@ -33,7 +33,7 @@ import lombok.experimental.UtilityClass; import me.lucko.luckperms.api.ChatMetaType; import me.lucko.luckperms.api.LocalizedNode; import me.lucko.luckperms.api.metastacking.MetaStackElement; -import me.lucko.luckperms.common.core.model.Track; +import me.lucko.luckperms.common.model.Track; import me.lucko.luckperms.common.plugin.LuckPermsPlugin; import me.lucko.luckperms.common.utils.ImmutableCollectors; diff --git a/common/src/main/java/me/lucko/luckperms/common/core/model/Group.java b/common/src/main/java/me/lucko/luckperms/common/model/Group.java similarity index 89% rename from common/src/main/java/me/lucko/luckperms/common/core/model/Group.java rename to common/src/main/java/me/lucko/luckperms/common/model/Group.java index 670c0068..c8014eeb 100644 --- a/common/src/main/java/me/lucko/luckperms/common/core/model/Group.java +++ b/common/src/main/java/me/lucko/luckperms/common/model/Group.java @@ -23,18 +23,17 @@ * SOFTWARE. */ -package me.lucko.luckperms.common.core.model; +package me.lucko.luckperms.common.model; import lombok.EqualsAndHashCode; import lombok.Getter; import lombok.ToString; import me.lucko.luckperms.common.api.delegates.GroupDelegate; -import me.lucko.luckperms.common.caching.handlers.GroupReference; -import me.lucko.luckperms.common.caching.handlers.HolderReference; import me.lucko.luckperms.common.config.ConfigKeys; import me.lucko.luckperms.common.plugin.LuckPermsPlugin; -import me.lucko.luckperms.common.utils.Identifiable; +import me.lucko.luckperms.common.references.GroupReference; +import me.lucko.luckperms.common.references.Identifiable; @ToString(of = {"name"}) @EqualsAndHashCode(of = {"name"}, callSuper = false) @@ -74,7 +73,7 @@ public class Group extends PermissionHolder implements Identifiable { } @Override - public HolderReference toReference() { + public GroupReference toReference() { return GroupReference.of(getId()); } } diff --git a/common/src/main/java/me/lucko/luckperms/common/core/model/PermissionHolder.java b/common/src/main/java/me/lucko/luckperms/common/model/PermissionHolder.java similarity index 97% rename from common/src/main/java/me/lucko/luckperms/common/core/model/PermissionHolder.java rename to common/src/main/java/me/lucko/luckperms/common/model/PermissionHolder.java index 2ff910aa..10b0723d 100644 --- a/common/src/main/java/me/lucko/luckperms/common/core/model/PermissionHolder.java +++ b/common/src/main/java/me/lucko/luckperms/common/model/PermissionHolder.java @@ -23,7 +23,7 @@ * SOFTWARE. */ -package me.lucko.luckperms.common.core.model; +package me.lucko.luckperms.common.model; import lombok.AccessLevel; import lombok.Getter; @@ -46,19 +46,18 @@ import me.lucko.luckperms.api.context.ContextSet; import me.lucko.luckperms.api.context.ImmutableContextSet; import me.lucko.luckperms.common.api.delegates.PermissionHolderDelegate; import me.lucko.luckperms.common.caching.MetaAccumulator; -import me.lucko.luckperms.common.caching.handlers.GroupReference; -import me.lucko.luckperms.common.caching.handlers.HolderReference; import me.lucko.luckperms.common.config.ConfigKeys; -import me.lucko.luckperms.common.core.ContextSetComparator; -import me.lucko.luckperms.common.core.InheritanceInfo; -import me.lucko.luckperms.common.core.NodeComparator; -import me.lucko.luckperms.common.core.NodeFactory; -import me.lucko.luckperms.common.core.PriorityComparator; -import me.lucko.luckperms.common.core.TemporaryModifier; +import me.lucko.luckperms.common.contexts.ContextSetComparator; +import me.lucko.luckperms.common.contexts.ExtractedContexts; +import me.lucko.luckperms.common.node.ImmutableLocalizedNode; +import me.lucko.luckperms.common.node.InheritanceInfo; +import me.lucko.luckperms.common.node.NodeComparator; +import me.lucko.luckperms.common.node.NodeFactory; +import me.lucko.luckperms.common.node.NodePriorityComparator; +import me.lucko.luckperms.common.node.NodeTools; import me.lucko.luckperms.common.plugin.LuckPermsPlugin; -import me.lucko.luckperms.common.utils.ExtractedContexts; -import me.lucko.luckperms.common.utils.ImmutableLocalizedNode; -import me.lucko.luckperms.common.utils.NodeTools; +import me.lucko.luckperms.common.references.GroupReference; +import me.lucko.luckperms.common.references.HolderReference; import java.util.ArrayList; import java.util.Collection; @@ -193,7 +192,7 @@ public abstract class PermissionHolder { * * @return this holders reference */ - public abstract HolderReference toReference(); + public abstract HolderReference toReference(); /** * Gets the API delegate for this instance @@ -301,7 +300,7 @@ public abstract class PermissionHolder { } public SortedSet mergePermissionsToSortedSet() { - SortedSet ret = new TreeSet<>(PriorityComparator.reverse()); + SortedSet ret = new TreeSet<>(NodePriorityComparator.reverse()); ret.addAll(mergePermissions().stream().map(n -> ImmutableLocalizedNode.of(n, getObjectName())).collect(Collectors.toSet())); return ret; } @@ -519,7 +518,7 @@ public abstract class PermissionHolder { public SortedSet resolveInheritancesAlmostEqual(ExtractedContexts contexts) { List nodes = resolveInheritances(null, null, contexts); NodeTools.removeAlmostEqual(nodes.iterator()); - SortedSet ret = new TreeSet<>(PriorityComparator.reverse()); + SortedSet ret = new TreeSet<>(NodePriorityComparator.reverse()); ret.addAll(nodes); return ret; } @@ -527,7 +526,7 @@ public abstract class PermissionHolder { public SortedSet resolveInheritancesMergeTemp(ExtractedContexts contexts) { List nodes = resolveInheritances(null, null, contexts); NodeTools.removeIgnoreValueOrTemp(nodes.iterator()); - SortedSet ret = new TreeSet<>(PriorityComparator.reverse()); + SortedSet ret = new TreeSet<>(NodePriorityComparator.reverse()); ret.addAll(nodes); return ret; } @@ -591,7 +590,7 @@ public abstract class PermissionHolder { public SortedSet resolveInheritancesAlmostEqual() { List nodes = resolveInheritances(null, null); NodeTools.removeAlmostEqual(nodes.iterator()); - SortedSet ret = new TreeSet<>(PriorityComparator.reverse()); + SortedSet ret = new TreeSet<>(NodePriorityComparator.reverse()); ret.addAll(nodes); return ret; } @@ -599,7 +598,7 @@ public abstract class PermissionHolder { public SortedSet resolveInheritancesMergeTemp() { List nodes = resolveInheritances(null, null); NodeTools.removeIgnoreValueOrTemp(nodes.iterator()); - SortedSet ret = new TreeSet<>(PriorityComparator.reverse()); + SortedSet ret = new TreeSet<>(NodePriorityComparator.reverse()); ret.addAll(nodes); return ret; } @@ -622,7 +621,7 @@ public abstract class PermissionHolder { } NodeTools.removeSamePermission(entries.iterator()); - SortedSet ret = new TreeSet<>(PriorityComparator.reverse()); + SortedSet ret = new TreeSet<>(NodePriorityComparator.reverse()); ret.addAll(entries); return ret; } diff --git a/common/src/main/java/me/lucko/luckperms/common/core/TemporaryModifier.java b/common/src/main/java/me/lucko/luckperms/common/model/TemporaryModifier.java similarity index 97% rename from common/src/main/java/me/lucko/luckperms/common/core/TemporaryModifier.java rename to common/src/main/java/me/lucko/luckperms/common/model/TemporaryModifier.java index 6657e515..7caaa278 100644 --- a/common/src/main/java/me/lucko/luckperms/common/core/TemporaryModifier.java +++ b/common/src/main/java/me/lucko/luckperms/common/model/TemporaryModifier.java @@ -23,7 +23,7 @@ * SOFTWARE. */ -package me.lucko.luckperms.common.core; +package me.lucko.luckperms.common.model; /** * Controls how temporary permissions/parents/meta should be set diff --git a/common/src/main/java/me/lucko/luckperms/common/core/model/Track.java b/common/src/main/java/me/lucko/luckperms/common/model/Track.java similarity index 98% rename from common/src/main/java/me/lucko/luckperms/common/core/model/Track.java rename to common/src/main/java/me/lucko/luckperms/common/model/Track.java index 94bd9eb5..fa65a624 100644 --- a/common/src/main/java/me/lucko/luckperms/common/core/model/Track.java +++ b/common/src/main/java/me/lucko/luckperms/common/model/Track.java @@ -23,7 +23,7 @@ * SOFTWARE. */ -package me.lucko.luckperms.common.core.model; +package me.lucko.luckperms.common.model; import lombok.EqualsAndHashCode; import lombok.Getter; @@ -34,7 +34,7 @@ import com.google.common.collect.ImmutableList; import me.lucko.luckperms.common.api.delegates.TrackDelegate; import me.lucko.luckperms.common.plugin.LuckPermsPlugin; -import me.lucko.luckperms.common.utils.Identifiable; +import me.lucko.luckperms.common.references.Identifiable; import me.lucko.luckperms.exceptions.ObjectAlreadyHasException; import me.lucko.luckperms.exceptions.ObjectLacksException; diff --git a/common/src/main/java/me/lucko/luckperms/common/core/model/User.java b/common/src/main/java/me/lucko/luckperms/common/model/User.java similarity index 94% rename from common/src/main/java/me/lucko/luckperms/common/core/model/User.java rename to common/src/main/java/me/lucko/luckperms/common/model/User.java index c53a195f..94c074bb 100644 --- a/common/src/main/java/me/lucko/luckperms/common/core/model/User.java +++ b/common/src/main/java/me/lucko/luckperms/common/model/User.java @@ -23,22 +23,21 @@ * SOFTWARE. */ -package me.lucko.luckperms.common.core.model; +package me.lucko.luckperms.common.model; import lombok.EqualsAndHashCode; import lombok.Getter; import lombok.ToString; import me.lucko.luckperms.common.api.delegates.UserDelegate; +import me.lucko.luckperms.common.buffers.BufferedRequest; import me.lucko.luckperms.common.caching.UserCache; -import me.lucko.luckperms.common.caching.handlers.HolderReference; -import me.lucko.luckperms.common.caching.handlers.UserReference; import me.lucko.luckperms.common.config.ConfigKeys; -import me.lucko.luckperms.common.core.UserIdentifier; import me.lucko.luckperms.common.plugin.LuckPermsPlugin; import me.lucko.luckperms.common.primarygroup.PrimaryGroupHolder; -import me.lucko.luckperms.common.utils.BufferedRequest; -import me.lucko.luckperms.common.utils.Identifiable; +import me.lucko.luckperms.common.references.Identifiable; +import me.lucko.luckperms.common.references.UserIdentifier; +import me.lucko.luckperms.common.references.UserReference; import java.util.Optional; import java.util.UUID; @@ -160,7 +159,7 @@ public class User extends PermissionHolder implements Identifiable toReference() { + public UserReference toReference() { return UserReference.of(getId()); } diff --git a/common/src/main/java/me/lucko/luckperms/common/utils/ImmutableLocalizedNode.java b/common/src/main/java/me/lucko/luckperms/common/node/ImmutableLocalizedNode.java similarity index 98% rename from common/src/main/java/me/lucko/luckperms/common/utils/ImmutableLocalizedNode.java rename to common/src/main/java/me/lucko/luckperms/common/node/ImmutableLocalizedNode.java index 5ba4dd0b..6d2ec4cb 100644 --- a/common/src/main/java/me/lucko/luckperms/common/utils/ImmutableLocalizedNode.java +++ b/common/src/main/java/me/lucko/luckperms/common/node/ImmutableLocalizedNode.java @@ -23,7 +23,7 @@ * SOFTWARE. */ -package me.lucko.luckperms.common.utils; +package me.lucko.luckperms.common.node; import lombok.AccessLevel; import lombok.AllArgsConstructor; diff --git a/common/src/main/java/me/lucko/luckperms/common/core/model/ImmutableNode.java b/common/src/main/java/me/lucko/luckperms/common/node/ImmutableNode.java similarity index 99% rename from common/src/main/java/me/lucko/luckperms/common/core/model/ImmutableNode.java rename to common/src/main/java/me/lucko/luckperms/common/node/ImmutableNode.java index 7c464571..b3ac255f 100644 --- a/common/src/main/java/me/lucko/luckperms/common/core/model/ImmutableNode.java +++ b/common/src/main/java/me/lucko/luckperms/common/node/ImmutableNode.java @@ -23,7 +23,7 @@ * SOFTWARE. */ -package me.lucko.luckperms.common.core.model; +package me.lucko.luckperms.common.node; import lombok.EqualsAndHashCode; import lombok.Getter; @@ -39,10 +39,8 @@ import me.lucko.luckperms.api.Node; import me.lucko.luckperms.api.context.ContextSet; import me.lucko.luckperms.api.context.ImmutableContextSet; import me.lucko.luckperms.api.context.MutableContextSet; -import me.lucko.luckperms.common.core.NodeFactory; import me.lucko.luckperms.common.utils.DateUtil; import me.lucko.luckperms.common.utils.PatternCache; -import me.lucko.luckperms.common.utils.ShorthandParser; import java.util.Collections; import java.util.Date; diff --git a/common/src/main/java/me/lucko/luckperms/common/core/InheritanceInfo.java b/common/src/main/java/me/lucko/luckperms/common/node/InheritanceInfo.java similarity index 98% rename from common/src/main/java/me/lucko/luckperms/common/core/InheritanceInfo.java rename to common/src/main/java/me/lucko/luckperms/common/node/InheritanceInfo.java index 60304592..d7307b68 100644 --- a/common/src/main/java/me/lucko/luckperms/common/core/InheritanceInfo.java +++ b/common/src/main/java/me/lucko/luckperms/common/node/InheritanceInfo.java @@ -23,7 +23,7 @@ * SOFTWARE. */ -package me.lucko.luckperms.common.core; +package me.lucko.luckperms.common.node; import lombok.AccessLevel; import lombok.AllArgsConstructor; diff --git a/common/src/main/java/me/lucko/luckperms/common/core/NodeBuilder.java b/common/src/main/java/me/lucko/luckperms/common/node/NodeBuilder.java similarity index 98% rename from common/src/main/java/me/lucko/luckperms/common/core/NodeBuilder.java rename to common/src/main/java/me/lucko/luckperms/common/node/NodeBuilder.java index 1580f43b..683edf99 100644 --- a/common/src/main/java/me/lucko/luckperms/common/core/NodeBuilder.java +++ b/common/src/main/java/me/lucko/luckperms/common/node/NodeBuilder.java @@ -23,7 +23,7 @@ * SOFTWARE. */ -package me.lucko.luckperms.common.core; +package me.lucko.luckperms.common.node; import lombok.AccessLevel; import lombok.NonNull; @@ -34,7 +34,6 @@ import com.google.common.base.Splitter; import me.lucko.luckperms.api.Node; import me.lucko.luckperms.api.context.ContextSet; import me.lucko.luckperms.api.context.MutableContextSet; -import me.lucko.luckperms.common.core.model.ImmutableNode; import me.lucko.luckperms.common.utils.PatternCache; import java.util.List; diff --git a/common/src/main/java/me/lucko/luckperms/common/core/NodeComparator.java b/common/src/main/java/me/lucko/luckperms/common/node/NodeComparator.java similarity index 93% rename from common/src/main/java/me/lucko/luckperms/common/core/NodeComparator.java rename to common/src/main/java/me/lucko/luckperms/common/node/NodeComparator.java index b6d7807d..ee8681c6 100644 --- a/common/src/main/java/me/lucko/luckperms/common/core/NodeComparator.java +++ b/common/src/main/java/me/lucko/luckperms/common/node/NodeComparator.java @@ -23,7 +23,7 @@ * SOFTWARE. */ -package me.lucko.luckperms.common.core; +package me.lucko.luckperms.common.node; import me.lucko.luckperms.api.Node; @@ -61,7 +61,7 @@ public class NodeComparator implements Comparator { return o1.getWildcardLevel() > o2.getWildcardLevel() ? 1 : -1; } - return PriorityComparator.get().compareStrings(o1.getPermission(), o2.getPermission()) == 1 ? -1 : 1; + return NodePriorityComparator.get().compareStrings(o1.getPermission(), o2.getPermission()) == 1 ? -1 : 1; } } diff --git a/common/src/main/java/me/lucko/luckperms/common/core/NodeFactory.java b/common/src/main/java/me/lucko/luckperms/common/node/NodeFactory.java similarity index 99% rename from common/src/main/java/me/lucko/luckperms/common/core/NodeFactory.java rename to common/src/main/java/me/lucko/luckperms/common/node/NodeFactory.java index 985af04b..9059b931 100644 --- a/common/src/main/java/me/lucko/luckperms/common/core/NodeFactory.java +++ b/common/src/main/java/me/lucko/luckperms/common/node/NodeFactory.java @@ -23,7 +23,7 @@ * SOFTWARE. */ -package me.lucko.luckperms.common.core; +package me.lucko.luckperms.common.node; import lombok.experimental.UtilityClass; @@ -35,7 +35,7 @@ import me.lucko.luckperms.api.ChatMetaType; import me.lucko.luckperms.api.MetaUtils; import me.lucko.luckperms.api.Node; import me.lucko.luckperms.api.context.ContextSet; -import me.lucko.luckperms.common.core.model.Group; +import me.lucko.luckperms.common.model.Group; import me.lucko.luckperms.common.utils.PatternCache; import java.util.List; diff --git a/common/src/main/java/me/lucko/luckperms/common/storage/holder/NodeHeldPermission.java b/common/src/main/java/me/lucko/luckperms/common/node/NodeHeldPermission.java similarity index 96% rename from common/src/main/java/me/lucko/luckperms/common/storage/holder/NodeHeldPermission.java rename to common/src/main/java/me/lucko/luckperms/common/node/NodeHeldPermission.java index 0b8ec5b6..09ad2831 100644 --- a/common/src/main/java/me/lucko/luckperms/common/storage/holder/NodeHeldPermission.java +++ b/common/src/main/java/me/lucko/luckperms/common/node/NodeHeldPermission.java @@ -23,7 +23,7 @@ * SOFTWARE. */ -package me.lucko.luckperms.common.storage.holder; +package me.lucko.luckperms.common.node; import lombok.AllArgsConstructor; import lombok.EqualsAndHashCode; @@ -33,7 +33,6 @@ import com.google.common.collect.Multimap; import me.lucko.luckperms.api.HeldPermission; import me.lucko.luckperms.api.Node; -import me.lucko.luckperms.common.core.NodeModel; import java.util.Optional; import java.util.OptionalLong; diff --git a/common/src/main/java/me/lucko/luckperms/common/core/NodeModel.java b/common/src/main/java/me/lucko/luckperms/common/node/NodeModel.java similarity index 99% rename from common/src/main/java/me/lucko/luckperms/common/core/NodeModel.java rename to common/src/main/java/me/lucko/luckperms/common/node/NodeModel.java index fb0f4d5d..19644f52 100644 --- a/common/src/main/java/me/lucko/luckperms/common/core/NodeModel.java +++ b/common/src/main/java/me/lucko/luckperms/common/node/NodeModel.java @@ -23,7 +23,7 @@ * SOFTWARE. */ -package me.lucko.luckperms.common.core; +package me.lucko.luckperms.common.node; import lombok.AllArgsConstructor; import lombok.EqualsAndHashCode; diff --git a/common/src/main/java/me/lucko/luckperms/common/core/PriorityComparator.java b/common/src/main/java/me/lucko/luckperms/common/node/NodePriorityComparator.java similarity index 92% rename from common/src/main/java/me/lucko/luckperms/common/core/PriorityComparator.java rename to common/src/main/java/me/lucko/luckperms/common/node/NodePriorityComparator.java index 15589d2c..c6f105f8 100644 --- a/common/src/main/java/me/lucko/luckperms/common/core/PriorityComparator.java +++ b/common/src/main/java/me/lucko/luckperms/common/node/NodePriorityComparator.java @@ -23,7 +23,7 @@ * SOFTWARE. */ -package me.lucko.luckperms.common.core; +package me.lucko.luckperms.common.node; import lombok.AccessLevel; import lombok.NoArgsConstructor; @@ -39,10 +39,14 @@ import java.text.Collator; import java.util.Comparator; import java.util.Locale; +/** + * Compares permission nodes based upon their supposed "priority". + */ @NoArgsConstructor(access = AccessLevel.PRIVATE) -public class PriorityComparator implements Comparator { - private static final PriorityComparator INSTANCE = new PriorityComparator(); - public static PriorityComparator get() { +public class NodePriorityComparator implements Comparator { + + private static final NodePriorityComparator INSTANCE = new NodePriorityComparator(); + public static NodePriorityComparator get() { return INSTANCE; } public static Comparator reverse() { diff --git a/common/src/main/java/me/lucko/luckperms/common/utils/NodeTools.java b/common/src/main/java/me/lucko/luckperms/common/node/NodeTools.java similarity index 98% rename from common/src/main/java/me/lucko/luckperms/common/utils/NodeTools.java rename to common/src/main/java/me/lucko/luckperms/common/node/NodeTools.java index 37f24c6b..3ed58506 100644 --- a/common/src/main/java/me/lucko/luckperms/common/utils/NodeTools.java +++ b/common/src/main/java/me/lucko/luckperms/common/node/NodeTools.java @@ -23,7 +23,7 @@ * SOFTWARE. */ -package me.lucko.luckperms.common.utils; +package me.lucko.luckperms.common.node; import lombok.experimental.UtilityClass; diff --git a/common/src/main/java/me/lucko/luckperms/common/utils/ShorthandParser.java b/common/src/main/java/me/lucko/luckperms/common/node/ShorthandParser.java similarity index 99% rename from common/src/main/java/me/lucko/luckperms/common/utils/ShorthandParser.java rename to common/src/main/java/me/lucko/luckperms/common/node/ShorthandParser.java index dc1ad328..c19dc692 100644 --- a/common/src/main/java/me/lucko/luckperms/common/utils/ShorthandParser.java +++ b/common/src/main/java/me/lucko/luckperms/common/node/ShorthandParser.java @@ -23,7 +23,7 @@ * SOFTWARE. */ -package me.lucko.luckperms.common.utils; +package me.lucko.luckperms.common.node; import lombok.experimental.UtilityClass; diff --git a/common/src/main/java/me/lucko/luckperms/common/plugin/LuckPermsPlugin.java b/common/src/main/java/me/lucko/luckperms/common/plugin/LuckPermsPlugin.java index 5e41cedd..bf11f31d 100644 --- a/common/src/main/java/me/lucko/luckperms/common/plugin/LuckPermsPlugin.java +++ b/common/src/main/java/me/lucko/luckperms/common/plugin/LuckPermsPlugin.java @@ -29,6 +29,7 @@ import me.lucko.luckperms.api.Contexts; import me.lucko.luckperms.api.Logger; import me.lucko.luckperms.api.PlatformType; 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.calculators.CalculatorFactory; import me.lucko.luckperms.common.commands.CommandManager; @@ -37,18 +38,17 @@ import me.lucko.luckperms.common.commands.sender.Sender; import me.lucko.luckperms.common.commands.utils.Util; import me.lucko.luckperms.common.config.LuckPermsConfiguration; import me.lucko.luckperms.common.contexts.ContextManager; -import me.lucko.luckperms.common.core.UuidCache; -import me.lucko.luckperms.common.core.model.User; import me.lucko.luckperms.common.locale.LocaleManager; import me.lucko.luckperms.common.locale.Message; import me.lucko.luckperms.common.managers.GroupManager; import me.lucko.luckperms.common.managers.TrackManager; import me.lucko.luckperms.common.managers.UserManager; import me.lucko.luckperms.common.messaging.InternalMessagingService; +import me.lucko.luckperms.common.model.User; import me.lucko.luckperms.common.storage.Storage; +import me.lucko.luckperms.common.storage.backing.file.FileWatcher; 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.UuidCache; import me.lucko.luckperms.common.verbose.VerboseHandler; import java.io.File; diff --git a/common/src/main/java/me/lucko/luckperms/common/primarygroup/AllParentsByWeightHolder.java b/common/src/main/java/me/lucko/luckperms/common/primarygroup/AllParentsByWeightHolder.java index 08034906..5096e1a9 100644 --- a/common/src/main/java/me/lucko/luckperms/common/primarygroup/AllParentsByWeightHolder.java +++ b/common/src/main/java/me/lucko/luckperms/common/primarygroup/AllParentsByWeightHolder.java @@ -30,9 +30,9 @@ import lombok.NonNull; import me.lucko.luckperms.api.Contexts; import me.lucko.luckperms.api.Node; import me.lucko.luckperms.common.config.ConfigKeys; -import me.lucko.luckperms.common.core.model.Group; -import me.lucko.luckperms.common.core.model.User; -import me.lucko.luckperms.common.utils.ExtractedContexts; +import me.lucko.luckperms.common.contexts.ExtractedContexts; +import me.lucko.luckperms.common.model.Group; +import me.lucko.luckperms.common.model.User; import java.util.Collections; import java.util.Comparator; diff --git a/common/src/main/java/me/lucko/luckperms/common/primarygroup/ParentsByWeightHolder.java b/common/src/main/java/me/lucko/luckperms/common/primarygroup/ParentsByWeightHolder.java index ec990dca..85ee01fb 100644 --- a/common/src/main/java/me/lucko/luckperms/common/primarygroup/ParentsByWeightHolder.java +++ b/common/src/main/java/me/lucko/luckperms/common/primarygroup/ParentsByWeightHolder.java @@ -30,8 +30,8 @@ import lombok.NonNull; import me.lucko.luckperms.api.Contexts; import me.lucko.luckperms.api.Node; import me.lucko.luckperms.api.context.ContextSet; -import me.lucko.luckperms.common.core.model.Group; -import me.lucko.luckperms.common.core.model.User; +import me.lucko.luckperms.common.model.Group; +import me.lucko.luckperms.common.model.User; import java.util.Collections; import java.util.Comparator; diff --git a/common/src/main/java/me/lucko/luckperms/common/primarygroup/StoredHolder.java b/common/src/main/java/me/lucko/luckperms/common/primarygroup/StoredHolder.java index 309a231b..8c75314e 100644 --- a/common/src/main/java/me/lucko/luckperms/common/primarygroup/StoredHolder.java +++ b/common/src/main/java/me/lucko/luckperms/common/primarygroup/StoredHolder.java @@ -29,7 +29,7 @@ import lombok.Getter; import lombok.RequiredArgsConstructor; import lombok.Setter; -import me.lucko.luckperms.common.core.model.User; +import me.lucko.luckperms.common.model.User; @RequiredArgsConstructor public class StoredHolder implements PrimaryGroupHolder { diff --git a/common/src/main/java/me/lucko/luckperms/common/calculators/processors/MapProcessor.java b/common/src/main/java/me/lucko/luckperms/common/processors/MapProcessor.java similarity index 93% rename from common/src/main/java/me/lucko/luckperms/common/calculators/processors/MapProcessor.java rename to common/src/main/java/me/lucko/luckperms/common/processors/MapProcessor.java index bf4bff42..81af0d7c 100644 --- a/common/src/main/java/me/lucko/luckperms/common/calculators/processors/MapProcessor.java +++ b/common/src/main/java/me/lucko/luckperms/common/processors/MapProcessor.java @@ -23,10 +23,9 @@ * SOFTWARE. */ -package me.lucko.luckperms.common.calculators.processors; +package me.lucko.luckperms.common.processors; import me.lucko.luckperms.api.Tristate; -import me.lucko.luckperms.common.calculators.PermissionProcessor; import java.util.Map; diff --git a/common/src/main/java/me/lucko/luckperms/common/calculators/PermissionProcessor.java b/common/src/main/java/me/lucko/luckperms/common/processors/PermissionProcessor.java similarity index 69% rename from common/src/main/java/me/lucko/luckperms/common/calculators/PermissionProcessor.java rename to common/src/main/java/me/lucko/luckperms/common/processors/PermissionProcessor.java index 4e0a9d85..b24182db 100644 --- a/common/src/main/java/me/lucko/luckperms/common/calculators/PermissionProcessor.java +++ b/common/src/main/java/me/lucko/luckperms/common/processors/PermissionProcessor.java @@ -23,16 +23,34 @@ * SOFTWARE. */ -package me.lucko.luckperms.common.calculators; +package me.lucko.luckperms.common.processors; import me.lucko.luckperms.api.Tristate; import java.util.Map; +/** + * A processor within a {@link me.lucko.luckperms.common.calculators.PermissionCalculator}. + */ public interface PermissionProcessor { + /** + * Returns the permission value determined by this calculator. + * + * @param permission the permission + * @return a tristate + */ Tristate hasPermission(String permission); + /** + * Called each time the permission calculators backing is updated. + * + *

Note that the same map instance is passed to this method on each update, + * so, if no processing is needed on the backing map, this can be cached on + * the first invocation.

+ * + * @param map the map + */ void updateBacking(Map map); } diff --git a/common/src/main/java/me/lucko/luckperms/common/calculators/processors/RegexProcessor.java b/common/src/main/java/me/lucko/luckperms/common/processors/RegexProcessor.java similarity index 95% rename from common/src/main/java/me/lucko/luckperms/common/calculators/processors/RegexProcessor.java rename to common/src/main/java/me/lucko/luckperms/common/processors/RegexProcessor.java index cef13411..d8c2e116 100644 --- a/common/src/main/java/me/lucko/luckperms/common/calculators/processors/RegexProcessor.java +++ b/common/src/main/java/me/lucko/luckperms/common/processors/RegexProcessor.java @@ -23,10 +23,9 @@ * SOFTWARE. */ -package me.lucko.luckperms.common.calculators.processors; +package me.lucko.luckperms.common.processors; import me.lucko.luckperms.api.Tristate; -import me.lucko.luckperms.common.calculators.PermissionProcessor; import me.lucko.luckperms.common.utils.PatternCache; import java.util.Map; diff --git a/common/src/main/java/me/lucko/luckperms/common/calculators/processors/WildcardProcessor.java b/common/src/main/java/me/lucko/luckperms/common/processors/WildcardProcessor.java similarity index 94% rename from common/src/main/java/me/lucko/luckperms/common/calculators/processors/WildcardProcessor.java rename to common/src/main/java/me/lucko/luckperms/common/processors/WildcardProcessor.java index e82cca06..20c91968 100644 --- a/common/src/main/java/me/lucko/luckperms/common/calculators/processors/WildcardProcessor.java +++ b/common/src/main/java/me/lucko/luckperms/common/processors/WildcardProcessor.java @@ -23,10 +23,9 @@ * SOFTWARE. */ -package me.lucko.luckperms.common.calculators.processors; +package me.lucko.luckperms.common.processors; import me.lucko.luckperms.api.Tristate; -import me.lucko.luckperms.common.calculators.PermissionProcessor; import java.util.Map; diff --git a/common/src/main/java/me/lucko/luckperms/common/caching/handlers/GroupReference.java b/common/src/main/java/me/lucko/luckperms/common/references/GroupReference.java similarity index 85% rename from common/src/main/java/me/lucko/luckperms/common/caching/handlers/GroupReference.java rename to common/src/main/java/me/lucko/luckperms/common/references/GroupReference.java index 13ce71e3..d5f9eddf 100644 --- a/common/src/main/java/me/lucko/luckperms/common/caching/handlers/GroupReference.java +++ b/common/src/main/java/me/lucko/luckperms/common/references/GroupReference.java @@ -23,15 +23,14 @@ * SOFTWARE. */ -package me.lucko.luckperms.common.caching.handlers; +package me.lucko.luckperms.common.references; import lombok.AllArgsConstructor; import lombok.EqualsAndHashCode; import lombok.Getter; import lombok.ToString; -import me.lucko.luckperms.common.core.model.Group; -import me.lucko.luckperms.common.core.model.PermissionHolder; +import me.lucko.luckperms.common.model.Group; import me.lucko.luckperms.common.plugin.LuckPermsPlugin; import java.util.function.Consumer; @@ -40,7 +39,7 @@ import java.util.function.Consumer; @ToString @EqualsAndHashCode @AllArgsConstructor(staticName = "of") -public class GroupReference implements HolderReference { +public class GroupReference implements HolderReference { private final String id; @@ -50,7 +49,7 @@ public class GroupReference implements HolderReference { } @Override - public void apply(LuckPermsPlugin plugin, Consumer consumer) { + public void apply(LuckPermsPlugin plugin, Consumer consumer) { Group group = plugin.getGroupManager().getIfLoaded(id); if (group == null) return; diff --git a/common/src/main/java/me/lucko/luckperms/common/caching/handlers/HolderReference.java b/common/src/main/java/me/lucko/luckperms/common/references/HolderReference.java similarity index 69% rename from common/src/main/java/me/lucko/luckperms/common/caching/handlers/HolderReference.java rename to common/src/main/java/me/lucko/luckperms/common/references/HolderReference.java index 468d4951..9f397211 100644 --- a/common/src/main/java/me/lucko/luckperms/common/caching/handlers/HolderReference.java +++ b/common/src/main/java/me/lucko/luckperms/common/references/HolderReference.java @@ -23,17 +23,34 @@ * SOFTWARE. */ -package me.lucko.luckperms.common.caching.handlers; +package me.lucko.luckperms.common.references; -import me.lucko.luckperms.common.core.model.PermissionHolder; +import me.lucko.luckperms.common.model.PermissionHolder; import me.lucko.luckperms.common.plugin.LuckPermsPlugin; -import me.lucko.luckperms.common.utils.Identifiable; import java.util.function.Consumer; -public interface HolderReference extends Identifiable { +/** + * A reference to a specific {@link PermissionHolder}. + * + * @param the holder type + * @param the holder identifier type + */ +public interface HolderReference extends Identifiable { + /** + * Gets the holder type + * + * @return the holder type + */ HolderType getType(); - void apply(LuckPermsPlugin plugin, Consumer consumer); + + /** + * Applies an action to this reference, if it is present and exists. + * + * @param plugin the plugin + * @param consumer the action + */ + void apply(LuckPermsPlugin plugin, Consumer consumer); } diff --git a/common/src/main/java/me/lucko/luckperms/common/caching/handlers/HolderType.java b/common/src/main/java/me/lucko/luckperms/common/references/HolderType.java similarity index 94% rename from common/src/main/java/me/lucko/luckperms/common/caching/handlers/HolderType.java rename to common/src/main/java/me/lucko/luckperms/common/references/HolderType.java index 03f47e97..d8561f7b 100644 --- a/common/src/main/java/me/lucko/luckperms/common/caching/handlers/HolderType.java +++ b/common/src/main/java/me/lucko/luckperms/common/references/HolderType.java @@ -23,8 +23,11 @@ * SOFTWARE. */ -package me.lucko.luckperms.common.caching.handlers; +package me.lucko.luckperms.common.references; public enum HolderType { - USER, GROUP + + USER, + GROUP + } diff --git a/common/src/main/java/me/lucko/luckperms/common/utils/Identifiable.java b/common/src/main/java/me/lucko/luckperms/common/references/Identifiable.java similarity index 97% rename from common/src/main/java/me/lucko/luckperms/common/utils/Identifiable.java rename to common/src/main/java/me/lucko/luckperms/common/references/Identifiable.java index 0322ce59..af4f4d6b 100644 --- a/common/src/main/java/me/lucko/luckperms/common/utils/Identifiable.java +++ b/common/src/main/java/me/lucko/luckperms/common/references/Identifiable.java @@ -23,7 +23,7 @@ * SOFTWARE. */ -package me.lucko.luckperms.common.utils; +package me.lucko.luckperms.common.references; /** * Interface to represent an identifiable object diff --git a/common/src/main/java/me/lucko/luckperms/common/core/UserIdentifier.java b/common/src/main/java/me/lucko/luckperms/common/references/UserIdentifier.java similarity index 93% rename from common/src/main/java/me/lucko/luckperms/common/core/UserIdentifier.java rename to common/src/main/java/me/lucko/luckperms/common/references/UserIdentifier.java index 2991091c..9a7044a6 100644 --- a/common/src/main/java/me/lucko/luckperms/common/core/UserIdentifier.java +++ b/common/src/main/java/me/lucko/luckperms/common/references/UserIdentifier.java @@ -23,7 +23,7 @@ * SOFTWARE. */ -package me.lucko.luckperms.common.core; +package me.lucko.luckperms.common.references; import lombok.AccessLevel; import lombok.AllArgsConstructor; @@ -31,11 +31,14 @@ import lombok.EqualsAndHashCode; import lombok.Getter; import lombok.ToString; -import me.lucko.luckperms.common.utils.Identifiable; +import me.lucko.luckperms.common.model.User; import java.util.Optional; import java.util.UUID; +/** + * Used to identify a specific {@link User}. + */ @ToString @EqualsAndHashCode(of = "uuid") @AllArgsConstructor(access = AccessLevel.PRIVATE) @@ -52,12 +55,12 @@ public final class UserIdentifier implements Identifiable { private final UUID uuid; private final String username; - public Optional getUsername() { - return Optional.ofNullable(username); - } - @Override public UUID getId() { return getUuid(); } + + public Optional getUsername() { + return Optional.ofNullable(username); + } } diff --git a/common/src/main/java/me/lucko/luckperms/common/caching/handlers/UserReference.java b/common/src/main/java/me/lucko/luckperms/common/references/UserReference.java similarity index 85% rename from common/src/main/java/me/lucko/luckperms/common/caching/handlers/UserReference.java rename to common/src/main/java/me/lucko/luckperms/common/references/UserReference.java index d8b58c8d..54d6ee6f 100644 --- a/common/src/main/java/me/lucko/luckperms/common/caching/handlers/UserReference.java +++ b/common/src/main/java/me/lucko/luckperms/common/references/UserReference.java @@ -23,16 +23,14 @@ * SOFTWARE. */ -package me.lucko.luckperms.common.caching.handlers; +package me.lucko.luckperms.common.references; import lombok.AllArgsConstructor; import lombok.EqualsAndHashCode; import lombok.Getter; import lombok.ToString; -import me.lucko.luckperms.common.core.UserIdentifier; -import me.lucko.luckperms.common.core.model.PermissionHolder; -import me.lucko.luckperms.common.core.model.User; +import me.lucko.luckperms.common.model.User; import me.lucko.luckperms.common.plugin.LuckPermsPlugin; import java.util.function.Consumer; @@ -41,7 +39,7 @@ import java.util.function.Consumer; @ToString @EqualsAndHashCode @AllArgsConstructor(staticName = "of") -public final class UserReference implements HolderReference { +public final class UserReference implements HolderReference { private final UserIdentifier id; @Override @@ -50,7 +48,7 @@ public final class UserReference implements HolderReference { } @Override - public void apply(LuckPermsPlugin plugin, Consumer consumer) { + public void apply(LuckPermsPlugin plugin, Consumer consumer) { User user = plugin.getUserManager().getIfLoaded(id); if (user == null) return; diff --git a/common/src/main/java/me/lucko/luckperms/common/storage/AbstractStorage.java b/common/src/main/java/me/lucko/luckperms/common/storage/AbstractStorage.java index 5ed9fb24..286c3387 100644 --- a/common/src/main/java/me/lucko/luckperms/common/storage/AbstractStorage.java +++ b/common/src/main/java/me/lucko/luckperms/common/storage/AbstractStorage.java @@ -36,10 +36,10 @@ import me.lucko.luckperms.api.event.cause.CreationCause; import me.lucko.luckperms.api.event.cause.DeletionCause; import me.lucko.luckperms.common.api.delegates.StorageDelegate; import me.lucko.luckperms.common.bulkupdate.BulkUpdate; -import me.lucko.luckperms.common.core.model.Group; -import me.lucko.luckperms.common.core.model.Track; -import me.lucko.luckperms.common.core.model.User; import me.lucko.luckperms.common.data.Log; +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.storage.backing.AbstractBacking; import me.lucko.luckperms.common.storage.wrappings.BufferedOutputStorage; diff --git a/common/src/main/java/me/lucko/luckperms/common/storage/SplitBacking.java b/common/src/main/java/me/lucko/luckperms/common/storage/SplitBacking.java index dda5d580..500dea62 100644 --- a/common/src/main/java/me/lucko/luckperms/common/storage/SplitBacking.java +++ b/common/src/main/java/me/lucko/luckperms/common/storage/SplitBacking.java @@ -30,10 +30,10 @@ import com.google.common.collect.ImmutableMap; import me.lucko.luckperms.api.HeldPermission; import me.lucko.luckperms.api.LogEntry; import me.lucko.luckperms.common.bulkupdate.BulkUpdate; -import me.lucko.luckperms.common.core.model.Group; -import me.lucko.luckperms.common.core.model.Track; -import me.lucko.luckperms.common.core.model.User; import me.lucko.luckperms.common.data.Log; +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.storage.backing.AbstractBacking; diff --git a/common/src/main/java/me/lucko/luckperms/common/storage/Storage.java b/common/src/main/java/me/lucko/luckperms/common/storage/Storage.java index 0b0e48a5..ebc31796 100644 --- a/common/src/main/java/me/lucko/luckperms/common/storage/Storage.java +++ b/common/src/main/java/me/lucko/luckperms/common/storage/Storage.java @@ -31,10 +31,10 @@ import me.lucko.luckperms.api.event.cause.CreationCause; import me.lucko.luckperms.api.event.cause.DeletionCause; import me.lucko.luckperms.common.api.delegates.StorageDelegate; import me.lucko.luckperms.common.bulkupdate.BulkUpdate; -import me.lucko.luckperms.common.core.model.Group; -import me.lucko.luckperms.common.core.model.Track; -import me.lucko.luckperms.common.core.model.User; import me.lucko.luckperms.common.data.Log; +import me.lucko.luckperms.common.model.Group; +import me.lucko.luckperms.common.model.Track; +import me.lucko.luckperms.common.model.User; import java.util.List; import java.util.Map; diff --git a/common/src/main/java/me/lucko/luckperms/common/storage/StorageFactory.java b/common/src/main/java/me/lucko/luckperms/common/storage/StorageFactory.java index 6bbbc978..b0c47a19 100644 --- a/common/src/main/java/me/lucko/luckperms/common/storage/StorageFactory.java +++ b/common/src/main/java/me/lucko/luckperms/common/storage/StorageFactory.java @@ -32,14 +32,14 @@ import com.google.common.collect.ImmutableSet; import me.lucko.luckperms.common.config.ConfigKeys; import me.lucko.luckperms.common.plugin.LuckPermsPlugin; import me.lucko.luckperms.common.storage.backing.AbstractBacking; -import me.lucko.luckperms.common.storage.backing.JSONBacking; -import me.lucko.luckperms.common.storage.backing.MongoDBBacking; -import me.lucko.luckperms.common.storage.backing.SQLBacking; -import me.lucko.luckperms.common.storage.backing.YAMLBacking; -import me.lucko.luckperms.common.storage.backing.sqlprovider.H2Provider; -import me.lucko.luckperms.common.storage.backing.sqlprovider.MySQLProvider; -import me.lucko.luckperms.common.storage.backing.sqlprovider.PostgreSQLProvider; -import me.lucko.luckperms.common.storage.backing.sqlprovider.SQLiteProvider; +import me.lucko.luckperms.common.storage.backing.file.JSONBacking; +import me.lucko.luckperms.common.storage.backing.file.YAMLBacking; +import me.lucko.luckperms.common.storage.backing.mongodb.MongoDBBacking; +import me.lucko.luckperms.common.storage.backing.sql.SQLBacking; +import me.lucko.luckperms.common.storage.backing.sql.provider.H2Provider; +import me.lucko.luckperms.common.storage.backing.sql.provider.MySQLProvider; +import me.lucko.luckperms.common.storage.backing.sql.provider.PostgreSQLProvider; +import me.lucko.luckperms.common.storage.backing.sql.provider.SQLiteProvider; import me.lucko.luckperms.common.utils.ImmutableCollectors; import java.io.File; diff --git a/common/src/main/java/me/lucko/luckperms/common/storage/backing/AbstractBacking.java b/common/src/main/java/me/lucko/luckperms/common/storage/backing/AbstractBacking.java index a2cb83b1..f23f5d38 100644 --- a/common/src/main/java/me/lucko/luckperms/common/storage/backing/AbstractBacking.java +++ b/common/src/main/java/me/lucko/luckperms/common/storage/backing/AbstractBacking.java @@ -33,10 +33,10 @@ import lombok.Setter; import me.lucko.luckperms.api.HeldPermission; import me.lucko.luckperms.api.LogEntry; import me.lucko.luckperms.common.bulkupdate.BulkUpdate; -import me.lucko.luckperms.common.core.model.Group; -import me.lucko.luckperms.common.core.model.Track; -import me.lucko.luckperms.common.core.model.User; import me.lucko.luckperms.common.data.Log; +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 java.util.Collections; diff --git a/common/src/main/java/me/lucko/luckperms/common/storage/backing/utils/FileUuidCache.java b/common/src/main/java/me/lucko/luckperms/common/storage/backing/file/FileUuidCache.java similarity index 98% rename from common/src/main/java/me/lucko/luckperms/common/storage/backing/utils/FileUuidCache.java rename to common/src/main/java/me/lucko/luckperms/common/storage/backing/file/FileUuidCache.java index a4126cea..441ea4df 100644 --- a/common/src/main/java/me/lucko/luckperms/common/storage/backing/utils/FileUuidCache.java +++ b/common/src/main/java/me/lucko/luckperms/common/storage/backing/file/FileUuidCache.java @@ -1,4 +1,4 @@ -package me.lucko.luckperms.common.storage.backing.utils; +package me.lucko.luckperms.common.storage.backing.file; import com.google.common.base.Splitter; import com.google.common.collect.Maps; diff --git a/common/src/main/java/me/lucko/luckperms/common/utils/FileWatcher.java b/common/src/main/java/me/lucko/luckperms/common/storage/backing/file/FileWatcher.java similarity index 98% rename from common/src/main/java/me/lucko/luckperms/common/utils/FileWatcher.java rename to common/src/main/java/me/lucko/luckperms/common/storage/backing/file/FileWatcher.java index 63b7f485..2e985b54 100644 --- a/common/src/main/java/me/lucko/luckperms/common/utils/FileWatcher.java +++ b/common/src/main/java/me/lucko/luckperms/common/storage/backing/file/FileWatcher.java @@ -23,7 +23,7 @@ * SOFTWARE. */ -package me.lucko.luckperms.common.utils; +package me.lucko.luckperms.common.storage.backing.file; import lombok.Getter; import lombok.RequiredArgsConstructor; diff --git a/common/src/main/java/me/lucko/luckperms/common/storage/backing/FlatfileBacking.java b/common/src/main/java/me/lucko/luckperms/common/storage/backing/file/FlatfileBacking.java similarity index 96% rename from common/src/main/java/me/lucko/luckperms/common/storage/backing/FlatfileBacking.java rename to common/src/main/java/me/lucko/luckperms/common/storage/backing/file/FlatfileBacking.java index be755ced..0562f507 100644 --- a/common/src/main/java/me/lucko/luckperms/common/storage/backing/FlatfileBacking.java +++ b/common/src/main/java/me/lucko/luckperms/common/storage/backing/file/FlatfileBacking.java @@ -23,23 +23,23 @@ * SOFTWARE. */ -package me.lucko.luckperms.common.storage.backing; +package me.lucko.luckperms.common.storage.backing.file; import lombok.Getter; import me.lucko.luckperms.api.LogEntry; import me.lucko.luckperms.common.commands.utils.Util; import me.lucko.luckperms.common.constants.Constants; -import me.lucko.luckperms.common.core.model.Group; -import me.lucko.luckperms.common.core.model.Track; -import me.lucko.luckperms.common.core.model.User; import me.lucko.luckperms.common.data.Log; import me.lucko.luckperms.common.managers.GroupManager; import me.lucko.luckperms.common.managers.TrackManager; +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.storage.backing.utils.FileUuidCache; -import me.lucko.luckperms.common.storage.backing.utils.LegacyJSONSchemaMigration; -import me.lucko.luckperms.common.storage.backing.utils.LegacyYAMLSchemaMigration; +import me.lucko.luckperms.common.storage.backing.AbstractBacking; +import me.lucko.luckperms.common.storage.backing.legacy.LegacyJSONSchemaMigration; +import me.lucko.luckperms.common.storage.backing.legacy.LegacyYAMLSchemaMigration; import java.io.File; import java.io.IOException; diff --git a/common/src/main/java/me/lucko/luckperms/common/storage/backing/JSONBacking.java b/common/src/main/java/me/lucko/luckperms/common/storage/backing/file/JSONBacking.java similarity index 98% rename from common/src/main/java/me/lucko/luckperms/common/storage/backing/JSONBacking.java rename to common/src/main/java/me/lucko/luckperms/common/storage/backing/file/JSONBacking.java index 3f72ce95..78aec200 100644 --- a/common/src/main/java/me/lucko/luckperms/common/storage/backing/JSONBacking.java +++ b/common/src/main/java/me/lucko/luckperms/common/storage/backing/file/JSONBacking.java @@ -23,7 +23,7 @@ * SOFTWARE. */ -package me.lucko.luckperms.common.storage.backing; +package me.lucko.luckperms.common.storage.backing.file; import com.google.common.collect.ImmutableList; import com.google.common.collect.Iterables; @@ -38,14 +38,14 @@ import me.lucko.luckperms.api.HeldPermission; import me.lucko.luckperms.api.Node; import me.lucko.luckperms.api.context.ImmutableContextSet; import me.lucko.luckperms.common.bulkupdate.BulkUpdate; -import me.lucko.luckperms.common.core.NodeModel; -import me.lucko.luckperms.common.core.UserIdentifier; -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.managers.impl.GenericUserManager; +import me.lucko.luckperms.common.managers.GenericUserManager; +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.node.NodeHeldPermission; +import me.lucko.luckperms.common.node.NodeModel; import me.lucko.luckperms.common.plugin.LuckPermsPlugin; -import me.lucko.luckperms.common.storage.holder.NodeHeldPermission; +import me.lucko.luckperms.common.references.UserIdentifier; import java.io.BufferedReader; import java.io.BufferedWriter; diff --git a/common/src/main/java/me/lucko/luckperms/common/storage/backing/YAMLBacking.java b/common/src/main/java/me/lucko/luckperms/common/storage/backing/file/YAMLBacking.java similarity index 98% rename from common/src/main/java/me/lucko/luckperms/common/storage/backing/YAMLBacking.java rename to common/src/main/java/me/lucko/luckperms/common/storage/backing/file/YAMLBacking.java index 7377a328..0c1cfda9 100644 --- a/common/src/main/java/me/lucko/luckperms/common/storage/backing/YAMLBacking.java +++ b/common/src/main/java/me/lucko/luckperms/common/storage/backing/file/YAMLBacking.java @@ -23,7 +23,7 @@ * SOFTWARE. */ -package me.lucko.luckperms.common.storage.backing; +package me.lucko.luckperms.common.storage.backing.file; import com.google.common.collect.ImmutableList; import com.google.common.collect.ImmutableSetMultimap; @@ -33,14 +33,14 @@ import me.lucko.luckperms.api.HeldPermission; import me.lucko.luckperms.api.Node; import me.lucko.luckperms.api.context.ImmutableContextSet; import me.lucko.luckperms.common.bulkupdate.BulkUpdate; -import me.lucko.luckperms.common.core.NodeModel; -import me.lucko.luckperms.common.core.UserIdentifier; -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.managers.impl.GenericUserManager; +import me.lucko.luckperms.common.managers.GenericUserManager; +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.node.NodeHeldPermission; +import me.lucko.luckperms.common.node.NodeModel; import me.lucko.luckperms.common.plugin.LuckPermsPlugin; -import me.lucko.luckperms.common.storage.holder.NodeHeldPermission; +import me.lucko.luckperms.common.references.UserIdentifier; import org.yaml.snakeyaml.DumperOptions; import org.yaml.snakeyaml.Yaml; diff --git a/common/src/main/java/me/lucko/luckperms/common/storage/backing/utils/LegacyJSONSchemaMigration.java b/common/src/main/java/me/lucko/luckperms/common/storage/backing/legacy/LegacyJSONSchemaMigration.java similarity index 97% rename from common/src/main/java/me/lucko/luckperms/common/storage/backing/utils/LegacyJSONSchemaMigration.java rename to common/src/main/java/me/lucko/luckperms/common/storage/backing/legacy/LegacyJSONSchemaMigration.java index 49de71e3..3e624f51 100644 --- a/common/src/main/java/me/lucko/luckperms/common/storage/backing/utils/LegacyJSONSchemaMigration.java +++ b/common/src/main/java/me/lucko/luckperms/common/storage/backing/legacy/LegacyJSONSchemaMigration.java @@ -23,17 +23,17 @@ * SOFTWARE. */ -package me.lucko.luckperms.common.storage.backing.utils; +package me.lucko.luckperms.common.storage.backing.legacy; import lombok.RequiredArgsConstructor; import com.google.gson.JsonElement; import com.google.gson.JsonObject; -import me.lucko.luckperms.common.core.NodeFactory; -import me.lucko.luckperms.common.core.NodeModel; +import me.lucko.luckperms.common.node.NodeFactory; +import me.lucko.luckperms.common.node.NodeModel; import me.lucko.luckperms.common.plugin.LuckPermsPlugin; -import me.lucko.luckperms.common.storage.backing.JSONBacking; +import me.lucko.luckperms.common.storage.backing.file.JSONBacking; import java.io.File; import java.io.IOException; diff --git a/common/src/main/java/me/lucko/luckperms/common/storage/backing/utils/LegacySQLSchemaMigration.java b/common/src/main/java/me/lucko/luckperms/common/storage/backing/legacy/LegacySQLSchemaMigration.java similarity index 98% rename from common/src/main/java/me/lucko/luckperms/common/storage/backing/utils/LegacySQLSchemaMigration.java rename to common/src/main/java/me/lucko/luckperms/common/storage/backing/legacy/LegacySQLSchemaMigration.java index 4cf0efa3..7603170e 100644 --- a/common/src/main/java/me/lucko/luckperms/common/storage/backing/utils/LegacySQLSchemaMigration.java +++ b/common/src/main/java/me/lucko/luckperms/common/storage/backing/legacy/LegacySQLSchemaMigration.java @@ -23,16 +23,16 @@ * SOFTWARE. */ -package me.lucko.luckperms.common.storage.backing.utils; +package me.lucko.luckperms.common.storage.backing.legacy; import lombok.RequiredArgsConstructor; import com.google.common.collect.Lists; import com.google.gson.reflect.TypeToken; -import me.lucko.luckperms.common.core.NodeFactory; -import me.lucko.luckperms.common.core.NodeModel; -import me.lucko.luckperms.common.storage.backing.SQLBacking; +import me.lucko.luckperms.common.node.NodeFactory; +import me.lucko.luckperms.common.node.NodeModel; +import me.lucko.luckperms.common.storage.backing.sql.SQLBacking; import java.lang.reflect.Type; import java.sql.Connection; diff --git a/common/src/main/java/me/lucko/luckperms/common/storage/backing/utils/LegacyYAMLSchemaMigration.java b/common/src/main/java/me/lucko/luckperms/common/storage/backing/legacy/LegacyYAMLSchemaMigration.java similarity index 96% rename from common/src/main/java/me/lucko/luckperms/common/storage/backing/utils/LegacyYAMLSchemaMigration.java rename to common/src/main/java/me/lucko/luckperms/common/storage/backing/legacy/LegacyYAMLSchemaMigration.java index 8491b378..e240ccf6 100644 --- a/common/src/main/java/me/lucko/luckperms/common/storage/backing/utils/LegacyYAMLSchemaMigration.java +++ b/common/src/main/java/me/lucko/luckperms/common/storage/backing/legacy/LegacyYAMLSchemaMigration.java @@ -23,14 +23,14 @@ * SOFTWARE. */ -package me.lucko.luckperms.common.storage.backing.utils; +package me.lucko.luckperms.common.storage.backing.legacy; import lombok.RequiredArgsConstructor; -import me.lucko.luckperms.common.core.NodeFactory; -import me.lucko.luckperms.common.core.NodeModel; +import me.lucko.luckperms.common.node.NodeFactory; +import me.lucko.luckperms.common.node.NodeModel; import me.lucko.luckperms.common.plugin.LuckPermsPlugin; -import me.lucko.luckperms.common.storage.backing.YAMLBacking; +import me.lucko.luckperms.common.storage.backing.file.YAMLBacking; import java.io.File; import java.io.IOException; diff --git a/common/src/main/java/me/lucko/luckperms/common/storage/backing/MongoDBBacking.java b/common/src/main/java/me/lucko/luckperms/common/storage/backing/mongodb/MongoDBBacking.java similarity index 98% rename from common/src/main/java/me/lucko/luckperms/common/storage/backing/MongoDBBacking.java rename to common/src/main/java/me/lucko/luckperms/common/storage/backing/mongodb/MongoDBBacking.java index 3ef880f0..9b849bb3 100644 --- a/common/src/main/java/me/lucko/luckperms/common/storage/backing/MongoDBBacking.java +++ b/common/src/main/java/me/lucko/luckperms/common/storage/backing/mongodb/MongoDBBacking.java @@ -23,7 +23,7 @@ * SOFTWARE. */ -package me.lucko.luckperms.common.storage.backing; +package me.lucko.luckperms.common.storage.backing.mongodb; import lombok.Getter; @@ -40,19 +40,20 @@ import me.lucko.luckperms.api.HeldPermission; import me.lucko.luckperms.api.LogEntry; import me.lucko.luckperms.api.Node; import me.lucko.luckperms.common.bulkupdate.BulkUpdate; -import me.lucko.luckperms.common.core.NodeFactory; -import me.lucko.luckperms.common.core.NodeModel; -import me.lucko.luckperms.common.core.UserIdentifier; -import me.lucko.luckperms.common.core.model.Group; -import me.lucko.luckperms.common.core.model.Track; -import me.lucko.luckperms.common.core.model.User; import me.lucko.luckperms.common.data.Log; +import me.lucko.luckperms.common.managers.GenericUserManager; import me.lucko.luckperms.common.managers.GroupManager; import me.lucko.luckperms.common.managers.TrackManager; -import me.lucko.luckperms.common.managers.impl.GenericUserManager; +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.node.NodeFactory; +import me.lucko.luckperms.common.node.NodeHeldPermission; +import me.lucko.luckperms.common.node.NodeModel; import me.lucko.luckperms.common.plugin.LuckPermsPlugin; +import me.lucko.luckperms.common.references.UserIdentifier; import me.lucko.luckperms.common.storage.DatastoreConfiguration; -import me.lucko.luckperms.common.storage.holder.NodeHeldPermission; +import me.lucko.luckperms.common.storage.backing.AbstractBacking; import org.bson.Document; diff --git a/common/src/main/java/me/lucko/luckperms/common/storage/backing/SQLBacking.java b/common/src/main/java/me/lucko/luckperms/common/storage/backing/sql/SQLBacking.java similarity index 98% rename from common/src/main/java/me/lucko/luckperms/common/storage/backing/SQLBacking.java rename to common/src/main/java/me/lucko/luckperms/common/storage/backing/sql/SQLBacking.java index 2f6dde88..6281f53f 100644 --- a/common/src/main/java/me/lucko/luckperms/common/storage/backing/SQLBacking.java +++ b/common/src/main/java/me/lucko/luckperms/common/storage/backing/sql/SQLBacking.java @@ -23,7 +23,7 @@ * SOFTWARE. */ -package me.lucko.luckperms.common.storage.backing; +package me.lucko.luckperms.common.storage.backing.sql; import lombok.Getter; @@ -36,19 +36,20 @@ import me.lucko.luckperms.api.HeldPermission; import me.lucko.luckperms.api.LogEntry; import me.lucko.luckperms.api.Node; import me.lucko.luckperms.common.bulkupdate.BulkUpdate; -import me.lucko.luckperms.common.core.NodeModel; -import me.lucko.luckperms.common.core.UserIdentifier; -import me.lucko.luckperms.common.core.model.Group; -import me.lucko.luckperms.common.core.model.Track; -import me.lucko.luckperms.common.core.model.User; import me.lucko.luckperms.common.data.Log; +import me.lucko.luckperms.common.managers.GenericUserManager; import me.lucko.luckperms.common.managers.GroupManager; import me.lucko.luckperms.common.managers.TrackManager; -import me.lucko.luckperms.common.managers.impl.GenericUserManager; +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.node.NodeHeldPermission; +import me.lucko.luckperms.common.node.NodeModel; import me.lucko.luckperms.common.plugin.LuckPermsPlugin; -import me.lucko.luckperms.common.storage.backing.sqlprovider.SQLProvider; -import me.lucko.luckperms.common.storage.backing.utils.LegacySQLSchemaMigration; -import me.lucko.luckperms.common.storage.holder.NodeHeldPermission; +import me.lucko.luckperms.common.references.UserIdentifier; +import me.lucko.luckperms.common.storage.backing.AbstractBacking; +import me.lucko.luckperms.common.storage.backing.legacy.LegacySQLSchemaMigration; +import me.lucko.luckperms.common.storage.backing.sql.provider.SQLProvider; import java.io.BufferedReader; import java.io.InputStream; diff --git a/common/src/main/java/me/lucko/luckperms/common/storage/backing/sqlprovider/WrappedConnection.java b/common/src/main/java/me/lucko/luckperms/common/storage/backing/sql/WrappedConnection.java similarity index 96% rename from common/src/main/java/me/lucko/luckperms/common/storage/backing/sqlprovider/WrappedConnection.java rename to common/src/main/java/me/lucko/luckperms/common/storage/backing/sql/WrappedConnection.java index 86693bd2..7171825a 100644 --- a/common/src/main/java/me/lucko/luckperms/common/storage/backing/sqlprovider/WrappedConnection.java +++ b/common/src/main/java/me/lucko/luckperms/common/storage/backing/sql/WrappedConnection.java @@ -23,7 +23,7 @@ * SOFTWARE. */ -package me.lucko.luckperms.common.storage.backing.sqlprovider; +package me.lucko.luckperms.common.storage.backing.sql; import lombok.AllArgsConstructor; import lombok.experimental.Delegate; diff --git a/common/src/main/java/me/lucko/luckperms/common/storage/backing/sqlprovider/FlatfileProvider.java b/common/src/main/java/me/lucko/luckperms/common/storage/backing/sql/provider/FlatfileProvider.java similarity index 95% rename from common/src/main/java/me/lucko/luckperms/common/storage/backing/sqlprovider/FlatfileProvider.java rename to common/src/main/java/me/lucko/luckperms/common/storage/backing/sql/provider/FlatfileProvider.java index b42c4fcd..b9e019b5 100644 --- a/common/src/main/java/me/lucko/luckperms/common/storage/backing/sqlprovider/FlatfileProvider.java +++ b/common/src/main/java/me/lucko/luckperms/common/storage/backing/sql/provider/FlatfileProvider.java @@ -23,7 +23,9 @@ * SOFTWARE. */ -package me.lucko.luckperms.common.storage.backing.sqlprovider; +package me.lucko.luckperms.common.storage.backing.sql.provider; + +import me.lucko.luckperms.common.storage.backing.sql.WrappedConnection; import java.io.File; import java.sql.Connection; diff --git a/common/src/main/java/me/lucko/luckperms/common/storage/backing/sqlprovider/H2Provider.java b/common/src/main/java/me/lucko/luckperms/common/storage/backing/sql/provider/H2Provider.java similarity index 97% rename from common/src/main/java/me/lucko/luckperms/common/storage/backing/sqlprovider/H2Provider.java rename to common/src/main/java/me/lucko/luckperms/common/storage/backing/sql/provider/H2Provider.java index 0e2ccc62..1b3cbfa1 100644 --- a/common/src/main/java/me/lucko/luckperms/common/storage/backing/sqlprovider/H2Provider.java +++ b/common/src/main/java/me/lucko/luckperms/common/storage/backing/sql/provider/H2Provider.java @@ -23,7 +23,7 @@ * SOFTWARE. */ -package me.lucko.luckperms.common.storage.backing.sqlprovider; +package me.lucko.luckperms.common.storage.backing.sql.provider; import java.io.File; import java.util.LinkedHashMap; diff --git a/common/src/main/java/me/lucko/luckperms/common/storage/backing/sqlprovider/MySQLProvider.java b/common/src/main/java/me/lucko/luckperms/common/storage/backing/sql/provider/MySQLProvider.java similarity index 97% rename from common/src/main/java/me/lucko/luckperms/common/storage/backing/sqlprovider/MySQLProvider.java rename to common/src/main/java/me/lucko/luckperms/common/storage/backing/sql/provider/MySQLProvider.java index a0d1e516..96d64260 100644 --- a/common/src/main/java/me/lucko/luckperms/common/storage/backing/sqlprovider/MySQLProvider.java +++ b/common/src/main/java/me/lucko/luckperms/common/storage/backing/sql/provider/MySQLProvider.java @@ -23,12 +23,13 @@ * SOFTWARE. */ -package me.lucko.luckperms.common.storage.backing.sqlprovider; +package me.lucko.luckperms.common.storage.backing.sql.provider; import com.zaxxer.hikari.HikariConfig; import com.zaxxer.hikari.HikariDataSource; import me.lucko.luckperms.common.storage.DatastoreConfiguration; +import me.lucko.luckperms.common.storage.backing.sql.WrappedConnection; import java.sql.Connection; import java.sql.SQLException; diff --git a/common/src/main/java/me/lucko/luckperms/common/storage/backing/sqlprovider/PostgreSQLProvider.java b/common/src/main/java/me/lucko/luckperms/common/storage/backing/sql/provider/PostgreSQLProvider.java similarity index 97% rename from common/src/main/java/me/lucko/luckperms/common/storage/backing/sqlprovider/PostgreSQLProvider.java rename to common/src/main/java/me/lucko/luckperms/common/storage/backing/sql/provider/PostgreSQLProvider.java index 58b5cb64..923942fc 100644 --- a/common/src/main/java/me/lucko/luckperms/common/storage/backing/sqlprovider/PostgreSQLProvider.java +++ b/common/src/main/java/me/lucko/luckperms/common/storage/backing/sql/provider/PostgreSQLProvider.java @@ -23,12 +23,13 @@ * SOFTWARE. */ -package me.lucko.luckperms.common.storage.backing.sqlprovider; +package me.lucko.luckperms.common.storage.backing.sql.provider; import com.zaxxer.hikari.HikariConfig; import com.zaxxer.hikari.HikariDataSource; import me.lucko.luckperms.common.storage.DatastoreConfiguration; +import me.lucko.luckperms.common.storage.backing.sql.WrappedConnection; import java.sql.Connection; import java.sql.SQLException; diff --git a/common/src/main/java/me/lucko/luckperms/common/storage/backing/sqlprovider/SQLProvider.java b/common/src/main/java/me/lucko/luckperms/common/storage/backing/sql/provider/SQLProvider.java similarity index 92% rename from common/src/main/java/me/lucko/luckperms/common/storage/backing/sqlprovider/SQLProvider.java rename to common/src/main/java/me/lucko/luckperms/common/storage/backing/sql/provider/SQLProvider.java index 3b6b3198..cb549a84 100644 --- a/common/src/main/java/me/lucko/luckperms/common/storage/backing/sqlprovider/SQLProvider.java +++ b/common/src/main/java/me/lucko/luckperms/common/storage/backing/sql/provider/SQLProvider.java @@ -23,11 +23,13 @@ * SOFTWARE. */ -package me.lucko.luckperms.common.storage.backing.sqlprovider; +package me.lucko.luckperms.common.storage.backing.sql.provider; import lombok.Getter; import lombok.RequiredArgsConstructor; +import me.lucko.luckperms.common.storage.backing.sql.WrappedConnection; + import java.sql.SQLException; import java.util.Collections; import java.util.Map; diff --git a/common/src/main/java/me/lucko/luckperms/common/storage/backing/sqlprovider/SQLiteProvider.java b/common/src/main/java/me/lucko/luckperms/common/storage/backing/sql/provider/SQLiteProvider.java similarity index 97% rename from common/src/main/java/me/lucko/luckperms/common/storage/backing/sqlprovider/SQLiteProvider.java rename to common/src/main/java/me/lucko/luckperms/common/storage/backing/sql/provider/SQLiteProvider.java index 837834be..48c852d2 100644 --- a/common/src/main/java/me/lucko/luckperms/common/storage/backing/sqlprovider/SQLiteProvider.java +++ b/common/src/main/java/me/lucko/luckperms/common/storage/backing/sql/provider/SQLiteProvider.java @@ -23,7 +23,7 @@ * SOFTWARE. */ -package me.lucko.luckperms.common.storage.backing.sqlprovider; +package me.lucko.luckperms.common.storage.backing.sql.provider; import java.io.File; import java.util.LinkedHashMap; diff --git a/common/src/main/java/me/lucko/luckperms/common/storage/wrappings/BufferedOutputStorage.java b/common/src/main/java/me/lucko/luckperms/common/storage/wrappings/BufferedOutputStorage.java index 73c9770c..c5249af8 100644 --- a/common/src/main/java/me/lucko/luckperms/common/storage/wrappings/BufferedOutputStorage.java +++ b/common/src/main/java/me/lucko/luckperms/common/storage/wrappings/BufferedOutputStorage.java @@ -30,12 +30,12 @@ import lombok.Getter; import lombok.RequiredArgsConstructor; import lombok.experimental.Delegate; -import me.lucko.luckperms.common.core.UserIdentifier; -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.buffers.Buffer; +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.references.UserIdentifier; import me.lucko.luckperms.common.storage.Storage; -import me.lucko.luckperms.common.utils.Buffer; import java.util.UUID; import java.util.concurrent.CompletableFuture; diff --git a/common/src/main/java/me/lucko/luckperms/common/storage/wrappings/PhasedStorage.java b/common/src/main/java/me/lucko/luckperms/common/storage/wrappings/PhasedStorage.java index a99cf688..6a33eb20 100644 --- a/common/src/main/java/me/lucko/luckperms/common/storage/wrappings/PhasedStorage.java +++ b/common/src/main/java/me/lucko/luckperms/common/storage/wrappings/PhasedStorage.java @@ -35,10 +35,10 @@ import me.lucko.luckperms.api.event.cause.CreationCause; import me.lucko.luckperms.api.event.cause.DeletionCause; import me.lucko.luckperms.common.api.delegates.StorageDelegate; import me.lucko.luckperms.common.bulkupdate.BulkUpdate; -import me.lucko.luckperms.common.core.model.Group; -import me.lucko.luckperms.common.core.model.Track; -import me.lucko.luckperms.common.core.model.User; import me.lucko.luckperms.common.data.Log; +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.storage.Storage; import java.util.List; diff --git a/common/src/main/java/me/lucko/luckperms/common/tasks/CacheHousekeepingTask.java b/common/src/main/java/me/lucko/luckperms/common/tasks/CacheHousekeepingTask.java index 2765eeb2..a7221947 100644 --- a/common/src/main/java/me/lucko/luckperms/common/tasks/CacheHousekeepingTask.java +++ b/common/src/main/java/me/lucko/luckperms/common/tasks/CacheHousekeepingTask.java @@ -27,7 +27,7 @@ package me.lucko.luckperms.common.tasks; import lombok.RequiredArgsConstructor; -import me.lucko.luckperms.common.core.model.User; +import me.lucko.luckperms.common.model.User; import me.lucko.luckperms.common.plugin.LuckPermsPlugin; @RequiredArgsConstructor diff --git a/common/src/main/java/me/lucko/luckperms/common/tasks/ExpireTemporaryTask.java b/common/src/main/java/me/lucko/luckperms/common/tasks/ExpireTemporaryTask.java index 06e475f2..7a8e455d 100644 --- a/common/src/main/java/me/lucko/luckperms/common/tasks/ExpireTemporaryTask.java +++ b/common/src/main/java/me/lucko/luckperms/common/tasks/ExpireTemporaryTask.java @@ -27,8 +27,8 @@ package me.lucko.luckperms.common.tasks; import lombok.AllArgsConstructor; -import me.lucko.luckperms.common.core.model.Group; -import me.lucko.luckperms.common.core.model.User; +import me.lucko.luckperms.common.model.Group; +import me.lucko.luckperms.common.model.User; import me.lucko.luckperms.common.plugin.LuckPermsPlugin; @AllArgsConstructor diff --git a/common/src/main/java/me/lucko/luckperms/common/utils/FakeSender.java b/common/src/main/java/me/lucko/luckperms/common/utils/FakeSender.java index 2b21ed83..29229af5 100644 --- a/common/src/main/java/me/lucko/luckperms/common/utils/FakeSender.java +++ b/common/src/main/java/me/lucko/luckperms/common/utils/FakeSender.java @@ -29,8 +29,8 @@ import lombok.AllArgsConstructor; import me.lucko.luckperms.api.Tristate; import me.lucko.luckperms.common.commands.sender.Sender; +import me.lucko.luckperms.common.constants.CommandPermission; import me.lucko.luckperms.common.constants.Constants; -import me.lucko.luckperms.common.constants.Permission; import me.lucko.luckperms.common.plugin.LuckPermsPlugin; import net.kyori.text.Component; @@ -80,7 +80,7 @@ public class FakeSender implements Sender { } @Override - public boolean hasPermission(Permission permission) { + public boolean hasPermission(CommandPermission permission) { return true; } diff --git a/common/src/main/java/me/lucko/luckperms/common/utils/LoginHelper.java b/common/src/main/java/me/lucko/luckperms/common/utils/LoginHelper.java index 359fca59..b2cc7b08 100644 --- a/common/src/main/java/me/lucko/luckperms/common/utils/LoginHelper.java +++ b/common/src/main/java/me/lucko/luckperms/common/utils/LoginHelper.java @@ -28,9 +28,8 @@ package me.lucko.luckperms.common.utils; import lombok.experimental.UtilityClass; import me.lucko.luckperms.common.config.ConfigKeys; -import me.lucko.luckperms.common.core.UuidCache; -import me.lucko.luckperms.common.core.model.User; import me.lucko.luckperms.common.defaults.Rule; +import me.lucko.luckperms.common.model.User; import me.lucko.luckperms.common.plugin.LuckPermsPlugin; import java.util.UUID; diff --git a/common/src/main/java/me/lucko/luckperms/common/core/UuidCache.java b/common/src/main/java/me/lucko/luckperms/common/utils/UuidCache.java similarity index 98% rename from common/src/main/java/me/lucko/luckperms/common/core/UuidCache.java rename to common/src/main/java/me/lucko/luckperms/common/utils/UuidCache.java index 520fdd58..2341f8e5 100644 --- a/common/src/main/java/me/lucko/luckperms/common/core/UuidCache.java +++ b/common/src/main/java/me/lucko/luckperms/common/utils/UuidCache.java @@ -23,7 +23,7 @@ * SOFTWARE. */ -package me.lucko.luckperms.common.core; +package me.lucko.luckperms.common.utils; import lombok.Getter; import lombok.RequiredArgsConstructor; diff --git a/sponge/src/main/java/me/lucko/luckperms/sponge/LPSpongePlugin.java b/sponge/src/main/java/me/lucko/luckperms/sponge/LPSpongePlugin.java index 139a895d..72436c42 100644 --- a/sponge/src/main/java/me/lucko/luckperms/sponge/LPSpongePlugin.java +++ b/sponge/src/main/java/me/lucko/luckperms/sponge/LPSpongePlugin.java @@ -35,50 +35,51 @@ import me.lucko.luckperms.api.PlatformType; import me.lucko.luckperms.api.context.ImmutableContextSet; import me.lucko.luckperms.common.api.ApiHandler; 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.calculators.CalculatorFactory; import me.lucko.luckperms.common.commands.abstraction.Command; import me.lucko.luckperms.common.commands.sender.Sender; import me.lucko.luckperms.common.config.ConfigKeys; 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.StaticCalculator; -import me.lucko.luckperms.common.core.UuidCache; -import me.lucko.luckperms.common.core.model.User; +import me.lucko.luckperms.common.contexts.LuckPermsCalculator; import me.lucko.luckperms.common.dependencies.DependencyManager; import me.lucko.luckperms.common.locale.LocaleManager; import me.lucko.luckperms.common.locale.NoopLocaleManager; import me.lucko.luckperms.common.locale.SimpleLocaleManager; +import me.lucko.luckperms.common.logging.SenderLogger; +import me.lucko.luckperms.common.managers.GenericTrackManager; import me.lucko.luckperms.common.managers.TrackManager; -import me.lucko.luckperms.common.managers.impl.GenericTrackManager; import me.lucko.luckperms.common.messaging.InternalMessagingService; import me.lucko.luckperms.common.messaging.NoopMessagingService; 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.LuckPermsScheduler; import me.lucko.luckperms.common.storage.Storage; import me.lucko.luckperms.common.storage.StorageFactory; 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.ExpireTemporaryTask; import me.lucko.luckperms.common.tasks.UpdateTask; import me.lucko.luckperms.common.treeview.PermissionVault; -import me.lucko.luckperms.common.utils.BufferedRequest; import me.lucko.luckperms.common.utils.FakeSender; -import me.lucko.luckperms.common.utils.FileWatcher; -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.sponge.calculators.SpongeCalculatorFactory; import me.lucko.luckperms.sponge.commands.SpongeMainCommand; import me.lucko.luckperms.sponge.contexts.WorldCalculator; import me.lucko.luckperms.sponge.managers.SpongeGroupManager; import me.lucko.luckperms.sponge.managers.SpongeUserManager; import me.lucko.luckperms.sponge.messaging.BungeeMessagingService; import me.lucko.luckperms.sponge.service.LuckPermsService; -import me.lucko.luckperms.sponge.service.ServiceCacheHousekeepingTask; import me.lucko.luckperms.sponge.service.model.LPPermissionService; import me.lucko.luckperms.sponge.service.model.LPSubjectCollection; import me.lucko.luckperms.sponge.service.persisted.PersistedCollection; +import me.lucko.luckperms.sponge.tasks.ServiceCacheHousekeepingTask; import me.lucko.luckperms.sponge.timings.LPTimings; import me.lucko.luckperms.sponge.utils.VersionData; @@ -273,7 +274,7 @@ public class LPSpongePlugin implements LuckPermsPlugin { groupManager = new SpongeGroupManager(this); trackManager = new GenericTrackManager(this); calculatorFactory = new SpongeCalculatorFactory(this); - cachedStateManager = new CachedStateManager(this); + cachedStateManager = new CachedStateManager(); contextManager = new ContextManager() { @Override @@ -292,7 +293,7 @@ public class LPSpongePlugin implements LuckPermsPlugin { contextManager.registerCalculator(new WorldCalculator(this)); - StaticCalculator staticCalculator = new StaticCalculator<>(getConfiguration()); + LuckPermsCalculator staticCalculator = new LuckPermsCalculator<>(getConfiguration()); contextManager.registerCalculator(staticCalculator, true); // register the PermissionService with Sponge @@ -373,10 +374,8 @@ public class LPSpongePlugin implements LuckPermsPlugin { return; } - for (Permission perm : Permission.values()) { - for (String node : perm.getNodes()) { - registerPermission(service, node); - } + for (CommandPermission perm : CommandPermission.values()) { + registerPermission(service, perm.getPermission()); } } diff --git a/sponge/src/main/java/me/lucko/luckperms/sponge/SpongeListener.java b/sponge/src/main/java/me/lucko/luckperms/sponge/SpongeListener.java index 15e3cbe5..33fbe7df 100644 --- a/sponge/src/main/java/me/lucko/luckperms/sponge/SpongeListener.java +++ b/sponge/src/main/java/me/lucko/luckperms/sponge/SpongeListener.java @@ -29,10 +29,10 @@ import lombok.RequiredArgsConstructor; import me.lucko.luckperms.api.caching.UserData; import me.lucko.luckperms.api.context.MutableContextSet; -import me.lucko.luckperms.common.core.UuidCache; -import me.lucko.luckperms.common.core.model.User; 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.UuidCache; import me.lucko.luckperms.sponge.timings.LPTiming; import org.spongepowered.api.command.CommandSource; diff --git a/sponge/src/main/java/me/lucko/luckperms/sponge/SpongeCalculatorFactory.java b/sponge/src/main/java/me/lucko/luckperms/sponge/calculators/SpongeCalculatorFactory.java similarity index 86% rename from sponge/src/main/java/me/lucko/luckperms/sponge/SpongeCalculatorFactory.java rename to sponge/src/main/java/me/lucko/luckperms/sponge/calculators/SpongeCalculatorFactory.java index 3220d9f1..5a113e54 100644 --- a/sponge/src/main/java/me/lucko/luckperms/sponge/SpongeCalculatorFactory.java +++ b/sponge/src/main/java/me/lucko/luckperms/sponge/calculators/SpongeCalculatorFactory.java @@ -23,7 +23,7 @@ * SOFTWARE. */ -package me.lucko.luckperms.sponge; +package me.lucko.luckperms.sponge.calculators; import lombok.AllArgsConstructor; @@ -32,14 +32,15 @@ import com.google.common.collect.ImmutableList; import me.lucko.luckperms.api.Contexts; import me.lucko.luckperms.common.calculators.AbstractCalculatorFactory; 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.core.model.User; -import me.lucko.luckperms.sponge.calculators.DefaultsProcessor; -import me.lucko.luckperms.sponge.calculators.SpongeWildcardProcessor; +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 me.lucko.luckperms.sponge.LPSpongePlugin; +import me.lucko.luckperms.sponge.processors.DefaultsProcessor; +import me.lucko.luckperms.sponge.processors.SpongeWildcardProcessor; import java.util.List; diff --git a/sponge/src/main/java/me/lucko/luckperms/sponge/commands/OptionClear.java b/sponge/src/main/java/me/lucko/luckperms/sponge/commands/OptionClear.java index 49ab8da0..86fe7053 100644 --- a/sponge/src/main/java/me/lucko/luckperms/sponge/commands/OptionClear.java +++ b/sponge/src/main/java/me/lucko/luckperms/sponge/commands/OptionClear.java @@ -32,7 +32,7 @@ import me.lucko.luckperms.common.commands.abstraction.SubCommand; import me.lucko.luckperms.common.commands.sender.Sender; import me.lucko.luckperms.common.commands.utils.ArgumentUtils; 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.CommandSpec; import me.lucko.luckperms.common.locale.LocaleManager; import me.lucko.luckperms.common.plugin.LuckPermsPlugin; @@ -43,7 +43,7 @@ import java.util.List; public class OptionClear extends SubCommand { public OptionClear(LocaleManager locale) { - super(CommandSpec.SPONGE_OPTION_CLEAR.spec(locale), "clear", Permission.SPONGE_OPTION_CLEAR, Predicates.alwaysFalse()); + super(CommandSpec.SPONGE_OPTION_CLEAR.spec(locale), "clear", CommandPermission.SPONGE_OPTION_CLEAR, Predicates.alwaysFalse()); } @Override diff --git a/sponge/src/main/java/me/lucko/luckperms/sponge/commands/OptionInfo.java b/sponge/src/main/java/me/lucko/luckperms/sponge/commands/OptionInfo.java index 8c2a3607..9d0c718c 100644 --- a/sponge/src/main/java/me/lucko/luckperms/sponge/commands/OptionInfo.java +++ b/sponge/src/main/java/me/lucko/luckperms/sponge/commands/OptionInfo.java @@ -34,7 +34,7 @@ import me.lucko.luckperms.common.commands.abstraction.SubCommand; import me.lucko.luckperms.common.commands.sender.Sender; import me.lucko.luckperms.common.commands.utils.ArgumentUtils; 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.CommandSpec; import me.lucko.luckperms.common.locale.LocaleManager; import me.lucko.luckperms.common.plugin.LuckPermsPlugin; @@ -46,7 +46,7 @@ import java.util.Map; public class OptionInfo extends SubCommand { public OptionInfo(LocaleManager locale) { - super(CommandSpec.SPONGE_OPTION_INFO.spec(locale), "info", Permission.SPONGE_OPTION_INFO, Predicates.alwaysFalse()); + super(CommandSpec.SPONGE_OPTION_INFO.spec(locale), "info", CommandPermission.SPONGE_OPTION_INFO, Predicates.alwaysFalse()); } @Override diff --git a/sponge/src/main/java/me/lucko/luckperms/sponge/commands/OptionSet.java b/sponge/src/main/java/me/lucko/luckperms/sponge/commands/OptionSet.java index b54b64c2..975cf688 100644 --- a/sponge/src/main/java/me/lucko/luckperms/sponge/commands/OptionSet.java +++ b/sponge/src/main/java/me/lucko/luckperms/sponge/commands/OptionSet.java @@ -32,7 +32,7 @@ import me.lucko.luckperms.common.commands.abstraction.SubCommand; import me.lucko.luckperms.common.commands.sender.Sender; import me.lucko.luckperms.common.commands.utils.ArgumentUtils; 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.CommandSpec; import me.lucko.luckperms.common.locale.LocaleManager; import me.lucko.luckperms.common.plugin.LuckPermsPlugin; @@ -43,7 +43,7 @@ import java.util.List; public class OptionSet extends SubCommand { public OptionSet(LocaleManager locale) { - super(CommandSpec.SPONGE_OPTION_SET.spec(locale), "set", Permission.SPONGE_OPTION_SET, Predicates.inRange(0, 1)); + super(CommandSpec.SPONGE_OPTION_SET.spec(locale), "set", CommandPermission.SPONGE_OPTION_SET, Predicates.inRange(0, 1)); } @Override diff --git a/sponge/src/main/java/me/lucko/luckperms/sponge/commands/OptionUnset.java b/sponge/src/main/java/me/lucko/luckperms/sponge/commands/OptionUnset.java index 1fa0caa1..c1bf844f 100644 --- a/sponge/src/main/java/me/lucko/luckperms/sponge/commands/OptionUnset.java +++ b/sponge/src/main/java/me/lucko/luckperms/sponge/commands/OptionUnset.java @@ -32,7 +32,7 @@ import me.lucko.luckperms.common.commands.abstraction.SubCommand; import me.lucko.luckperms.common.commands.sender.Sender; import me.lucko.luckperms.common.commands.utils.ArgumentUtils; 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.CommandSpec; import me.lucko.luckperms.common.locale.LocaleManager; import me.lucko.luckperms.common.plugin.LuckPermsPlugin; @@ -43,7 +43,7 @@ import java.util.List; public class OptionUnset extends SubCommand { public OptionUnset(LocaleManager locale) { - super(CommandSpec.SPONGE_OPTION_UNSET.spec(locale), "unset", Permission.SPONGE_OPTION_UNSET, Predicates.is(0)); + super(CommandSpec.SPONGE_OPTION_UNSET.spec(locale), "unset", CommandPermission.SPONGE_OPTION_UNSET, Predicates.is(0)); } @Override diff --git a/sponge/src/main/java/me/lucko/luckperms/sponge/commands/ParentAdd.java b/sponge/src/main/java/me/lucko/luckperms/sponge/commands/ParentAdd.java index bb8ce854..738e3f7e 100644 --- a/sponge/src/main/java/me/lucko/luckperms/sponge/commands/ParentAdd.java +++ b/sponge/src/main/java/me/lucko/luckperms/sponge/commands/ParentAdd.java @@ -32,7 +32,7 @@ import me.lucko.luckperms.common.commands.abstraction.SubCommand; import me.lucko.luckperms.common.commands.sender.Sender; import me.lucko.luckperms.common.commands.utils.ArgumentUtils; 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.CommandSpec; import me.lucko.luckperms.common.locale.LocaleManager; import me.lucko.luckperms.common.plugin.LuckPermsPlugin; @@ -48,7 +48,7 @@ import java.util.List; public class ParentAdd extends SubCommand { public ParentAdd(LocaleManager locale) { - super(CommandSpec.SPONGE_PARENT_ADD.spec(locale), "add", Permission.SPONGE_PARENT_ADD, Predicates.inRange(0, 1)); + super(CommandSpec.SPONGE_PARENT_ADD.spec(locale), "add", CommandPermission.SPONGE_PARENT_ADD, Predicates.inRange(0, 1)); } @Override diff --git a/sponge/src/main/java/me/lucko/luckperms/sponge/commands/ParentClear.java b/sponge/src/main/java/me/lucko/luckperms/sponge/commands/ParentClear.java index 78b0923a..bed81987 100644 --- a/sponge/src/main/java/me/lucko/luckperms/sponge/commands/ParentClear.java +++ b/sponge/src/main/java/me/lucko/luckperms/sponge/commands/ParentClear.java @@ -32,7 +32,7 @@ import me.lucko.luckperms.common.commands.abstraction.SubCommand; import me.lucko.luckperms.common.commands.sender.Sender; import me.lucko.luckperms.common.commands.utils.ArgumentUtils; 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.CommandSpec; import me.lucko.luckperms.common.locale.LocaleManager; import me.lucko.luckperms.common.plugin.LuckPermsPlugin; @@ -43,7 +43,7 @@ import java.util.List; public class ParentClear extends SubCommand { public ParentClear(LocaleManager locale) { - super(CommandSpec.SPONGE_PARENT_CLEAR.spec(locale), "clear", Permission.SPONGE_PARENT_CLEAR, Predicates.alwaysFalse()); + super(CommandSpec.SPONGE_PARENT_CLEAR.spec(locale), "clear", CommandPermission.SPONGE_PARENT_CLEAR, Predicates.alwaysFalse()); } @Override diff --git a/sponge/src/main/java/me/lucko/luckperms/sponge/commands/ParentInfo.java b/sponge/src/main/java/me/lucko/luckperms/sponge/commands/ParentInfo.java index 10dbdb26..fc724850 100644 --- a/sponge/src/main/java/me/lucko/luckperms/sponge/commands/ParentInfo.java +++ b/sponge/src/main/java/me/lucko/luckperms/sponge/commands/ParentInfo.java @@ -34,7 +34,7 @@ import me.lucko.luckperms.common.commands.abstraction.SubCommand; import me.lucko.luckperms.common.commands.sender.Sender; import me.lucko.luckperms.common.commands.utils.ArgumentUtils; 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.CommandSpec; import me.lucko.luckperms.common.locale.LocaleManager; import me.lucko.luckperms.common.plugin.LuckPermsPlugin; @@ -47,7 +47,7 @@ import java.util.Map; public class ParentInfo extends SubCommand { public ParentInfo(LocaleManager locale) { - super(CommandSpec.SPONGE_PARENT_INFO.spec(locale), "info", Permission.SPONGE_PARENT_INFO, Predicates.alwaysFalse()); + super(CommandSpec.SPONGE_PARENT_INFO.spec(locale), "info", CommandPermission.SPONGE_PARENT_INFO, Predicates.alwaysFalse()); } @Override diff --git a/sponge/src/main/java/me/lucko/luckperms/sponge/commands/ParentRemove.java b/sponge/src/main/java/me/lucko/luckperms/sponge/commands/ParentRemove.java index 2ad2423a..db9e8ed4 100644 --- a/sponge/src/main/java/me/lucko/luckperms/sponge/commands/ParentRemove.java +++ b/sponge/src/main/java/me/lucko/luckperms/sponge/commands/ParentRemove.java @@ -32,7 +32,7 @@ import me.lucko.luckperms.common.commands.abstraction.SubCommand; import me.lucko.luckperms.common.commands.sender.Sender; import me.lucko.luckperms.common.commands.utils.ArgumentUtils; 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.CommandSpec; import me.lucko.luckperms.common.locale.LocaleManager; import me.lucko.luckperms.common.plugin.LuckPermsPlugin; @@ -48,7 +48,7 @@ import java.util.List; public class ParentRemove extends SubCommand { public ParentRemove(LocaleManager locale) { - super(CommandSpec.SPONGE_PARENT_REMOVE.spec(locale), "remove", Permission.SPONGE_PARENT_REMOVE, Predicates.inRange(0, 1)); + super(CommandSpec.SPONGE_PARENT_REMOVE.spec(locale), "remove", CommandPermission.SPONGE_PARENT_REMOVE, Predicates.inRange(0, 1)); } @Override diff --git a/sponge/src/main/java/me/lucko/luckperms/sponge/commands/PermissionClear.java b/sponge/src/main/java/me/lucko/luckperms/sponge/commands/PermissionClear.java index e244695b..c569e688 100644 --- a/sponge/src/main/java/me/lucko/luckperms/sponge/commands/PermissionClear.java +++ b/sponge/src/main/java/me/lucko/luckperms/sponge/commands/PermissionClear.java @@ -32,7 +32,7 @@ import me.lucko.luckperms.common.commands.abstraction.SubCommand; import me.lucko.luckperms.common.commands.sender.Sender; import me.lucko.luckperms.common.commands.utils.ArgumentUtils; 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.CommandSpec; import me.lucko.luckperms.common.locale.LocaleManager; import me.lucko.luckperms.common.plugin.LuckPermsPlugin; @@ -43,7 +43,7 @@ import java.util.List; public class PermissionClear extends SubCommand { public PermissionClear(LocaleManager locale) { - super(CommandSpec.SPONGE_PERMISSION_CLEAR.spec(locale), "clear", Permission.SPONGE_PERMISSION_CLEAR, Predicates.alwaysFalse()); + super(CommandSpec.SPONGE_PERMISSION_CLEAR.spec(locale), "clear", CommandPermission.SPONGE_PERMISSION_CLEAR, Predicates.alwaysFalse()); } @Override diff --git a/sponge/src/main/java/me/lucko/luckperms/sponge/commands/PermissionInfo.java b/sponge/src/main/java/me/lucko/luckperms/sponge/commands/PermissionInfo.java index c1276b87..75bfb955 100644 --- a/sponge/src/main/java/me/lucko/luckperms/sponge/commands/PermissionInfo.java +++ b/sponge/src/main/java/me/lucko/luckperms/sponge/commands/PermissionInfo.java @@ -34,7 +34,7 @@ import me.lucko.luckperms.common.commands.abstraction.SubCommand; import me.lucko.luckperms.common.commands.sender.Sender; import me.lucko.luckperms.common.commands.utils.ArgumentUtils; 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.CommandSpec; import me.lucko.luckperms.common.locale.LocaleManager; import me.lucko.luckperms.common.plugin.LuckPermsPlugin; @@ -46,7 +46,7 @@ import java.util.Map; public class PermissionInfo extends SubCommand { public PermissionInfo(LocaleManager locale) { - super(CommandSpec.SPONGE_PERMISSION_INFO.spec(locale), "info", Permission.SPONGE_PERMISSION_INFO, Predicates.alwaysFalse()); + super(CommandSpec.SPONGE_PERMISSION_INFO.spec(locale), "info", CommandPermission.SPONGE_PERMISSION_INFO, Predicates.alwaysFalse()); } @Override diff --git a/sponge/src/main/java/me/lucko/luckperms/sponge/commands/PermissionSet.java b/sponge/src/main/java/me/lucko/luckperms/sponge/commands/PermissionSet.java index 6b4c0fb3..9e0252fc 100644 --- a/sponge/src/main/java/me/lucko/luckperms/sponge/commands/PermissionSet.java +++ b/sponge/src/main/java/me/lucko/luckperms/sponge/commands/PermissionSet.java @@ -33,7 +33,7 @@ import me.lucko.luckperms.common.commands.abstraction.SubCommand; import me.lucko.luckperms.common.commands.sender.Sender; import me.lucko.luckperms.common.commands.utils.ArgumentUtils; 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.CommandSpec; import me.lucko.luckperms.common.locale.LocaleManager; import me.lucko.luckperms.common.plugin.LuckPermsPlugin; @@ -44,7 +44,7 @@ import java.util.List; public class PermissionSet extends SubCommand { public PermissionSet(LocaleManager locale) { - super(CommandSpec.SPONGE_PERMISSION_SET.spec(locale), "set", Permission.SPONGE_PERMISSION_SET, Predicates.inRange(0, 1)); + super(CommandSpec.SPONGE_PERMISSION_SET.spec(locale), "set", CommandPermission.SPONGE_PERMISSION_SET, Predicates.inRange(0, 1)); } @Override diff --git a/sponge/src/main/java/me/lucko/luckperms/sponge/managers/SpongeGroupManager.java b/sponge/src/main/java/me/lucko/luckperms/sponge/managers/SpongeGroupManager.java index abe4c9fe..64d1fe76 100644 --- a/sponge/src/main/java/me/lucko/luckperms/sponge/managers/SpongeGroupManager.java +++ b/sponge/src/main/java/me/lucko/luckperms/sponge/managers/SpongeGroupManager.java @@ -41,8 +41,8 @@ import me.lucko.luckperms.api.Tristate; import me.lucko.luckperms.api.context.ImmutableContextSet; import me.lucko.luckperms.api.event.cause.CreationCause; import me.lucko.luckperms.common.constants.DataConstraints; -import me.lucko.luckperms.common.core.model.Group; import me.lucko.luckperms.common.managers.GroupManager; +import me.lucko.luckperms.common.model.Group; import me.lucko.luckperms.common.utils.ImmutableCollectors; import me.lucko.luckperms.sponge.LPSpongePlugin; import me.lucko.luckperms.sponge.model.SpongeGroup; diff --git a/sponge/src/main/java/me/lucko/luckperms/sponge/managers/SpongeUserManager.java b/sponge/src/main/java/me/lucko/luckperms/sponge/managers/SpongeUserManager.java index 04093642..0ef0088a 100644 --- a/sponge/src/main/java/me/lucko/luckperms/sponge/managers/SpongeUserManager.java +++ b/sponge/src/main/java/me/lucko/luckperms/sponge/managers/SpongeUserManager.java @@ -39,10 +39,10 @@ import com.google.common.collect.Maps; import me.lucko.luckperms.api.HeldPermission; import me.lucko.luckperms.api.Tristate; import me.lucko.luckperms.api.context.ImmutableContextSet; -import me.lucko.luckperms.common.core.UserIdentifier; -import me.lucko.luckperms.common.core.model.User; +import me.lucko.luckperms.common.managers.GenericUserManager; import me.lucko.luckperms.common.managers.UserManager; -import me.lucko.luckperms.common.managers.impl.GenericUserManager; +import me.lucko.luckperms.common.model.User; +import me.lucko.luckperms.common.references.UserIdentifier; import me.lucko.luckperms.common.utils.ImmutableCollectors; import me.lucko.luckperms.sponge.LPSpongePlugin; import me.lucko.luckperms.sponge.model.SpongeUser; diff --git a/sponge/src/main/java/me/lucko/luckperms/sponge/migration/MigrationPermissionManager.java b/sponge/src/main/java/me/lucko/luckperms/sponge/migration/MigrationPermissionManager.java index eadc6d70..23c237bd 100644 --- a/sponge/src/main/java/me/lucko/luckperms/sponge/migration/MigrationPermissionManager.java +++ b/sponge/src/main/java/me/lucko/luckperms/sponge/migration/MigrationPermissionManager.java @@ -32,14 +32,14 @@ import me.lucko.luckperms.common.commands.abstraction.SubCommand; import me.lucko.luckperms.common.commands.impl.migration.MigrationUtils; import me.lucko.luckperms.common.commands.sender.Sender; import me.lucko.luckperms.common.commands.utils.Util; -import me.lucko.luckperms.common.constants.Permission; -import me.lucko.luckperms.common.core.model.Group; -import me.lucko.luckperms.common.core.model.User; +import me.lucko.luckperms.common.constants.CommandPermission; import me.lucko.luckperms.common.locale.CommandSpec; 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.User; import me.lucko.luckperms.common.plugin.LuckPermsPlugin; import me.lucko.luckperms.common.utils.Predicates; -import me.lucko.luckperms.common.utils.ProgressLogger; import me.lucko.luckperms.sponge.LPSpongePlugin; import me.lucko.luckperms.sponge.service.LuckPermsService; @@ -60,7 +60,7 @@ import static me.lucko.luckperms.sponge.migration.SpongeMigrationUtils.migrateSu public class MigrationPermissionManager extends SubCommand { public MigrationPermissionManager(LocaleManager locale) { - super(CommandSpec.MIGRATION_COMMAND.spec(locale), "permissionmanager", Permission.MIGRATION, Predicates.alwaysFalse()); + super(CommandSpec.MIGRATION_COMMAND.spec(locale), "permissionmanager", CommandPermission.MIGRATION, Predicates.alwaysFalse()); } @Override diff --git a/sponge/src/main/java/me/lucko/luckperms/sponge/migration/MigrationPermissionsEx.java b/sponge/src/main/java/me/lucko/luckperms/sponge/migration/MigrationPermissionsEx.java index f0eb41e9..dcd4af70 100644 --- a/sponge/src/main/java/me/lucko/luckperms/sponge/migration/MigrationPermissionsEx.java +++ b/sponge/src/main/java/me/lucko/luckperms/sponge/migration/MigrationPermissionsEx.java @@ -32,15 +32,15 @@ import me.lucko.luckperms.common.commands.abstraction.SubCommand; import me.lucko.luckperms.common.commands.impl.migration.MigrationUtils; import me.lucko.luckperms.common.commands.sender.Sender; import me.lucko.luckperms.common.commands.utils.Util; -import me.lucko.luckperms.common.constants.Permission; -import me.lucko.luckperms.common.core.model.Group; -import me.lucko.luckperms.common.core.model.Track; -import me.lucko.luckperms.common.core.model.User; +import me.lucko.luckperms.common.constants.CommandPermission; import me.lucko.luckperms.common.locale.CommandSpec; 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.Track; +import me.lucko.luckperms.common.model.User; import me.lucko.luckperms.common.plugin.LuckPermsPlugin; import me.lucko.luckperms.common.utils.Predicates; -import me.lucko.luckperms.common.utils.ProgressLogger; import me.lucko.luckperms.exceptions.ObjectAlreadyHasException; import me.lucko.luckperms.sponge.LPSpongePlugin; import me.lucko.luckperms.sponge.service.LuckPermsService; @@ -66,7 +66,7 @@ import static me.lucko.luckperms.sponge.migration.SpongeMigrationUtils.migrateSu public class MigrationPermissionsEx extends SubCommand { 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()); } @Override diff --git a/sponge/src/main/java/me/lucko/luckperms/sponge/migration/SpongeMigrationUtils.java b/sponge/src/main/java/me/lucko/luckperms/sponge/migration/SpongeMigrationUtils.java index f11a1024..3d0b65b3 100644 --- a/sponge/src/main/java/me/lucko/luckperms/sponge/migration/SpongeMigrationUtils.java +++ b/sponge/src/main/java/me/lucko/luckperms/sponge/migration/SpongeMigrationUtils.java @@ -29,9 +29,9 @@ import lombok.experimental.UtilityClass; import me.lucko.luckperms.api.context.ContextSet; import me.lucko.luckperms.common.commands.impl.migration.MigrationUtils; -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.model.Group; +import me.lucko.luckperms.common.model.PermissionHolder; +import me.lucko.luckperms.common.node.NodeFactory; import me.lucko.luckperms.sponge.service.model.CompatibilityUtil; import org.spongepowered.api.service.context.Context; diff --git a/sponge/src/main/java/me/lucko/luckperms/sponge/model/SpongeGroup.java b/sponge/src/main/java/me/lucko/luckperms/sponge/model/SpongeGroup.java index 9a5e1b7d..38c77022 100644 --- a/sponge/src/main/java/me/lucko/luckperms/sponge/model/SpongeGroup.java +++ b/sponge/src/main/java/me/lucko/luckperms/sponge/model/SpongeGroup.java @@ -38,8 +38,8 @@ import me.lucko.luckperms.api.Node; import me.lucko.luckperms.api.Tristate; import me.lucko.luckperms.api.context.ImmutableContextSet; import me.lucko.luckperms.common.caching.MetaAccumulator; -import me.lucko.luckperms.common.core.model.Group; -import me.lucko.luckperms.common.utils.ExtractedContexts; +import me.lucko.luckperms.common.contexts.ExtractedContexts; +import me.lucko.luckperms.common.model.Group; import me.lucko.luckperms.sponge.LPSpongePlugin; import me.lucko.luckperms.sponge.service.LuckPermsService; import me.lucko.luckperms.sponge.service.LuckPermsSubjectData; diff --git a/sponge/src/main/java/me/lucko/luckperms/sponge/model/SpongeUser.java b/sponge/src/main/java/me/lucko/luckperms/sponge/model/SpongeUser.java index a6ed78f8..bb6144d7 100644 --- a/sponge/src/main/java/me/lucko/luckperms/sponge/model/SpongeUser.java +++ b/sponge/src/main/java/me/lucko/luckperms/sponge/model/SpongeUser.java @@ -33,7 +33,7 @@ import com.google.common.collect.ImmutableSet; import me.lucko.luckperms.api.Tristate; import me.lucko.luckperms.api.caching.MetaData; import me.lucko.luckperms.api.context.ImmutableContextSet; -import me.lucko.luckperms.common.core.model.User; +import me.lucko.luckperms.common.model.User; import me.lucko.luckperms.sponge.LPSpongePlugin; import me.lucko.luckperms.sponge.service.LuckPermsService; import me.lucko.luckperms.sponge.service.LuckPermsSubjectData; diff --git a/sponge/src/main/java/me/lucko/luckperms/sponge/calculators/DefaultsProcessor.java b/sponge/src/main/java/me/lucko/luckperms/sponge/processors/DefaultsProcessor.java similarity index 95% rename from sponge/src/main/java/me/lucko/luckperms/sponge/calculators/DefaultsProcessor.java rename to sponge/src/main/java/me/lucko/luckperms/sponge/processors/DefaultsProcessor.java index 83200584..a56895b4 100644 --- a/sponge/src/main/java/me/lucko/luckperms/sponge/calculators/DefaultsProcessor.java +++ b/sponge/src/main/java/me/lucko/luckperms/sponge/processors/DefaultsProcessor.java @@ -23,13 +23,13 @@ * SOFTWARE. */ -package me.lucko.luckperms.sponge.calculators; +package me.lucko.luckperms.sponge.processors; import lombok.AllArgsConstructor; import me.lucko.luckperms.api.Tristate; import me.lucko.luckperms.api.context.ImmutableContextSet; -import me.lucko.luckperms.common.calculators.PermissionProcessor; +import me.lucko.luckperms.common.processors.PermissionProcessor; import me.lucko.luckperms.sponge.service.LuckPermsService; import java.util.Map; diff --git a/sponge/src/main/java/me/lucko/luckperms/sponge/calculators/SpongeWildcardProcessor.java b/sponge/src/main/java/me/lucko/luckperms/sponge/processors/SpongeWildcardProcessor.java similarity index 94% rename from sponge/src/main/java/me/lucko/luckperms/sponge/calculators/SpongeWildcardProcessor.java rename to sponge/src/main/java/me/lucko/luckperms/sponge/processors/SpongeWildcardProcessor.java index 523b971d..7a9f2a3d 100644 --- a/sponge/src/main/java/me/lucko/luckperms/sponge/calculators/SpongeWildcardProcessor.java +++ b/sponge/src/main/java/me/lucko/luckperms/sponge/processors/SpongeWildcardProcessor.java @@ -23,10 +23,10 @@ * SOFTWARE. */ -package me.lucko.luckperms.sponge.calculators; +package me.lucko.luckperms.sponge.processors; import me.lucko.luckperms.api.Tristate; -import me.lucko.luckperms.common.calculators.PermissionProcessor; +import me.lucko.luckperms.common.processors.PermissionProcessor; import java.util.Map; diff --git a/sponge/src/main/java/me/lucko/luckperms/sponge/service/SimpleDescription.java b/sponge/src/main/java/me/lucko/luckperms/sponge/service/LuckPermsPermissionDescription.java similarity index 97% rename from sponge/src/main/java/me/lucko/luckperms/sponge/service/SimpleDescription.java rename to sponge/src/main/java/me/lucko/luckperms/sponge/service/LuckPermsPermissionDescription.java index d876b4c1..2af9413e 100644 --- a/sponge/src/main/java/me/lucko/luckperms/sponge/service/SimpleDescription.java +++ b/sponge/src/main/java/me/lucko/luckperms/sponge/service/LuckPermsPermissionDescription.java @@ -47,7 +47,7 @@ import java.util.concurrent.CompletableFuture; @RequiredArgsConstructor @EqualsAndHashCode(of = {"id", "description", "owner"}) @ToString(of = {"id", "description", "owner"}) -public final class SimpleDescription implements LPPermissionDescription { +public final class LuckPermsPermissionDescription implements LPPermissionDescription { @Getter private final LPPermissionService service; diff --git a/sponge/src/main/java/me/lucko/luckperms/sponge/service/LuckPermsService.java b/sponge/src/main/java/me/lucko/luckperms/sponge/service/LuckPermsService.java index 78b63ca9..30bd1a3f 100644 --- a/sponge/src/main/java/me/lucko/luckperms/sponge/service/LuckPermsService.java +++ b/sponge/src/main/java/me/lucko/luckperms/sponge/service/LuckPermsService.java @@ -41,8 +41,8 @@ import me.lucko.luckperms.api.Contexts; import me.lucko.luckperms.api.Tristate; import me.lucko.luckperms.api.context.ImmutableContextSet; import me.lucko.luckperms.common.caching.UserCache; -import me.lucko.luckperms.common.core.model.Group; -import me.lucko.luckperms.common.core.model.User; +import me.lucko.luckperms.common.model.Group; +import me.lucko.luckperms.common.model.User; import me.lucko.luckperms.common.utils.Predicates; import me.lucko.luckperms.sponge.LPSpongePlugin; import me.lucko.luckperms.sponge.contexts.SpongeCalculatorLink; @@ -52,7 +52,7 @@ import me.lucko.luckperms.sponge.model.SpongeGroup; import me.lucko.luckperms.sponge.service.calculated.CalculatedSubjectData; import me.lucko.luckperms.sponge.service.calculated.OptionLookup; import me.lucko.luckperms.sponge.service.calculated.PermissionLookup; -import me.lucko.luckperms.sponge.service.legacystorage.LegacyDataMigrator; +import me.lucko.luckperms.sponge.service.legacy.LegacyDataMigrator; import me.lucko.luckperms.sponge.service.model.LPPermissionDescription; import me.lucko.luckperms.sponge.service.model.LPPermissionService; import me.lucko.luckperms.sponge.service.model.LPSubject; @@ -184,7 +184,7 @@ public class LuckPermsService implements LPPermissionService { @Override public LPPermissionDescription registerPermissionDescription(String id, Text description, PluginContainer owner) { - SimpleDescription desc = new SimpleDescription(this, id, description, owner); + LuckPermsPermissionDescription desc = new LuckPermsPermissionDescription(this, id, description, owner); descriptionSet.add(desc); return desc; } diff --git a/sponge/src/main/java/me/lucko/luckperms/sponge/service/LuckPermsSubjectData.java b/sponge/src/main/java/me/lucko/luckperms/sponge/service/LuckPermsSubjectData.java index cc2f41e5..bf03ac97 100644 --- a/sponge/src/main/java/me/lucko/luckperms/sponge/service/LuckPermsSubjectData.java +++ b/sponge/src/main/java/me/lucko/luckperms/sponge/service/LuckPermsSubjectData.java @@ -38,11 +38,11 @@ import me.lucko.luckperms.api.Node; import me.lucko.luckperms.api.Tristate; import me.lucko.luckperms.api.context.ImmutableContextSet; import me.lucko.luckperms.common.caching.MetaAccumulator; -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.utils.ExtractedContexts; +import me.lucko.luckperms.common.contexts.ExtractedContexts; +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.sponge.service.model.LPSubject; import me.lucko.luckperms.sponge.service.model.LPSubjectData; import me.lucko.luckperms.sponge.service.model.SubjectReference; diff --git a/sponge/src/main/java/me/lucko/luckperms/sponge/service/calculated/CalculatedSubjectData.java b/sponge/src/main/java/me/lucko/luckperms/sponge/service/calculated/CalculatedSubjectData.java index 133f76b7..4ab02667 100644 --- a/sponge/src/main/java/me/lucko/luckperms/sponge/service/calculated/CalculatedSubjectData.java +++ b/sponge/src/main/java/me/lucko/luckperms/sponge/service/calculated/CalculatedSubjectData.java @@ -39,9 +39,9 @@ import me.lucko.luckperms.api.Tristate; import me.lucko.luckperms.api.context.ContextSet; import me.lucko.luckperms.api.context.ImmutableContextSet; 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.sponge.calculators.SpongeWildcardProcessor; +import me.lucko.luckperms.common.processors.MapProcessor; +import me.lucko.luckperms.common.processors.PermissionProcessor; +import me.lucko.luckperms.sponge.processors.SpongeWildcardProcessor; import me.lucko.luckperms.sponge.service.model.LPPermissionService; import me.lucko.luckperms.sponge.service.model.LPSubject; import me.lucko.luckperms.sponge.service.model.LPSubjectData; diff --git a/sponge/src/main/java/me/lucko/luckperms/sponge/service/legacystorage/LegacyDataMigrator.java b/sponge/src/main/java/me/lucko/luckperms/sponge/service/legacy/LegacyDataMigrator.java similarity index 98% rename from sponge/src/main/java/me/lucko/luckperms/sponge/service/legacystorage/LegacyDataMigrator.java rename to sponge/src/main/java/me/lucko/luckperms/sponge/service/legacy/LegacyDataMigrator.java index 40b01c6f..e231331d 100644 --- a/sponge/src/main/java/me/lucko/luckperms/sponge/service/legacystorage/LegacyDataMigrator.java +++ b/sponge/src/main/java/me/lucko/luckperms/sponge/service/legacy/LegacyDataMigrator.java @@ -23,7 +23,7 @@ * SOFTWARE. */ -package me.lucko.luckperms.sponge.service.legacystorage; +package me.lucko.luckperms.sponge.service.legacy; import lombok.RequiredArgsConstructor; diff --git a/sponge/src/main/java/me/lucko/luckperms/sponge/service/legacystorage/SubjectDataHolder.java b/sponge/src/main/java/me/lucko/luckperms/sponge/service/legacy/SubjectDataHolder.java similarity index 98% rename from sponge/src/main/java/me/lucko/luckperms/sponge/service/legacystorage/SubjectDataHolder.java rename to sponge/src/main/java/me/lucko/luckperms/sponge/service/legacy/SubjectDataHolder.java index 8b8cfa87..cfd14639 100644 --- a/sponge/src/main/java/me/lucko/luckperms/sponge/service/legacystorage/SubjectDataHolder.java +++ b/sponge/src/main/java/me/lucko/luckperms/sponge/service/legacy/SubjectDataHolder.java @@ -23,7 +23,7 @@ * SOFTWARE. */ -package me.lucko.luckperms.sponge.service.legacystorage; +package me.lucko.luckperms.sponge.service.legacy; import lombok.ToString; diff --git a/sponge/src/main/java/me/lucko/luckperms/sponge/service/persisted/PersistedSubject.java b/sponge/src/main/java/me/lucko/luckperms/sponge/service/persisted/PersistedSubject.java index 0aa93b45..342e00ad 100644 --- a/sponge/src/main/java/me/lucko/luckperms/sponge/service/persisted/PersistedSubject.java +++ b/sponge/src/main/java/me/lucko/luckperms/sponge/service/persisted/PersistedSubject.java @@ -34,7 +34,7 @@ import com.google.common.collect.ImmutableList; import me.lucko.luckperms.api.Tristate; import me.lucko.luckperms.api.context.ImmutableContextSet; -import me.lucko.luckperms.common.utils.BufferedRequest; +import me.lucko.luckperms.common.buffers.BufferedRequest; import me.lucko.luckperms.sponge.service.LuckPermsService; import me.lucko.luckperms.sponge.service.ProxyFactory; import me.lucko.luckperms.sponge.service.calculated.CalculatedSubjectData; diff --git a/sponge/src/main/java/me/lucko/luckperms/sponge/service/storage/SubjectStorageModel.java b/sponge/src/main/java/me/lucko/luckperms/sponge/service/storage/SubjectStorageModel.java index 680b61fe..3eaab3ae 100644 --- a/sponge/src/main/java/me/lucko/luckperms/sponge/service/storage/SubjectStorageModel.java +++ b/sponge/src/main/java/me/lucko/luckperms/sponge/service/storage/SubjectStorageModel.java @@ -35,9 +35,9 @@ import com.google.gson.JsonElement; import com.google.gson.JsonObject; import me.lucko.luckperms.api.context.ImmutableContextSet; -import me.lucko.luckperms.common.core.ContextSetComparator; -import me.lucko.luckperms.common.core.NodeModel; -import me.lucko.luckperms.common.core.PriorityComparator; +import me.lucko.luckperms.common.contexts.ContextSetComparator; +import me.lucko.luckperms.common.node.NodeModel; +import me.lucko.luckperms.common.node.NodePriorityComparator; import me.lucko.luckperms.sponge.service.calculated.CalculatedSubjectData; import me.lucko.luckperms.sponge.service.model.LPPermissionService; import me.lucko.luckperms.sponge.service.model.SubjectReference; @@ -194,7 +194,7 @@ public class SubjectStorageModel { // sort alphabetically. List> perms = new ArrayList<>(e.getValue().entrySet()); - perms.sort((o1, o2) -> PriorityComparator.get().compareStrings(o1.getKey(), o2.getKey())); + perms.sort((o1, o2) -> NodePriorityComparator.get().compareStrings(o1.getKey(), o2.getKey())); for (Map.Entry ent : perms) { data.addProperty(ent.getKey(), ent.getValue()); @@ -218,7 +218,7 @@ public class SubjectStorageModel { // sort alphabetically. List> opts = new ArrayList<>(e.getValue().entrySet()); - opts.sort((o1, o2) -> PriorityComparator.get().compareStrings(o1.getKey(), o2.getKey())); + opts.sort((o1, o2) -> NodePriorityComparator.get().compareStrings(o1.getKey(), o2.getKey())); for (Map.Entry ent : opts) { data.addProperty(ent.getKey(), ent.getValue()); diff --git a/sponge/src/main/java/me/lucko/luckperms/sponge/service/ServiceCacheHousekeepingTask.java b/sponge/src/main/java/me/lucko/luckperms/sponge/tasks/ServiceCacheHousekeepingTask.java similarity index 94% rename from sponge/src/main/java/me/lucko/luckperms/sponge/service/ServiceCacheHousekeepingTask.java rename to sponge/src/main/java/me/lucko/luckperms/sponge/tasks/ServiceCacheHousekeepingTask.java index afc174fe..ac32bdc6 100644 --- a/sponge/src/main/java/me/lucko/luckperms/sponge/service/ServiceCacheHousekeepingTask.java +++ b/sponge/src/main/java/me/lucko/luckperms/sponge/tasks/ServiceCacheHousekeepingTask.java @@ -23,10 +23,11 @@ * SOFTWARE. */ -package me.lucko.luckperms.sponge.service; +package me.lucko.luckperms.sponge.tasks; import lombok.RequiredArgsConstructor; +import me.lucko.luckperms.sponge.service.LuckPermsService; import me.lucko.luckperms.sponge.service.model.LPSubject; import me.lucko.luckperms.sponge.service.model.LPSubjectCollection;