From 6817945e1204dad7532aba92c4d4a55930ac9a7a Mon Sep 17 00:00:00 2001 From: Luck Date: Tue, 9 May 2017 12:55:45 +0100 Subject: [PATCH] Bump sponge API version, cleanup --- api/pom.xml | 1 + bukkit-legacy/pom.xml | 1 + bukkit/src/main/resources/plugin.yml | 2 +- bungee/src/main/resources/plugin.yml | 2 +- pom.xml | 1 + sponge/pom.xml | 2 +- .../luckperms/sponge/managers/SpongeGroupManager.java | 11 ++++++++--- 7 files changed, 14 insertions(+), 6 deletions(-) diff --git a/api/pom.xml b/api/pom.xml index 7e70b5104..ad2cd2fee 100644 --- a/api/pom.xml +++ b/api/pom.xml @@ -10,6 +10,7 @@ 4.0.0 luckperms-api + LuckPerms-API-${release.version} diff --git a/bukkit-legacy/pom.xml b/bukkit-legacy/pom.xml index ddcd7615e..638249e97 100644 --- a/bukkit-legacy/pom.xml +++ b/bukkit-legacy/pom.xml @@ -10,6 +10,7 @@ 4.0.0 luckperms-bukkit-legacy + clean package LuckPerms-Bukkit-Legacy-${full.version} diff --git a/bukkit/src/main/resources/plugin.yml b/bukkit/src/main/resources/plugin.yml index 6254d0364..3d34d2f18 100644 --- a/bukkit/src/main/resources/plugin.yml +++ b/bukkit/src/main/resources/plugin.yml @@ -1,5 +1,5 @@ name: LuckPerms -version: ${release.version}.${patch.version} +version: ${full.version} description: A permissions plugin author: Luck website: https://github.com/lucko/LuckPerms diff --git a/bungee/src/main/resources/plugin.yml b/bungee/src/main/resources/plugin.yml index 2706b564c..aaa852aaa 100644 --- a/bungee/src/main/resources/plugin.yml +++ b/bungee/src/main/resources/plugin.yml @@ -1,5 +1,5 @@ name: LuckPerms -version: ${release.version}.${patch.version} +version: ${full.version} description: A permissions plugin author: Luck main: me.lucko.luckperms.bungee.LPBungeePlugin diff --git a/pom.xml b/pom.xml index e7e1b679d..726d6c47e 100644 --- a/pom.xml +++ b/pom.xml @@ -7,6 +7,7 @@ me.lucko.luckperms luckperms 3.1-SNAPSHOT + api common diff --git a/sponge/pom.xml b/sponge/pom.xml index 78c9bcf8a..0f5c0b6db 100644 --- a/sponge/pom.xml +++ b/sponge/pom.xml @@ -75,7 +75,7 @@ org.spongepowered spongeapi - 5.1.0 + 6.0.0 provided 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 2d6f39547..d2b438abf 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 @@ -40,10 +40,10 @@ import me.lucko.luckperms.api.HeldPermission; 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.utils.ImmutableCollectors; -import me.lucko.luckperms.common.utils.Predicates; import me.lucko.luckperms.sponge.LPSpongePlugin; import me.lucko.luckperms.sponge.model.SpongeGroup; import me.lucko.luckperms.sponge.service.LuckPermsService; @@ -184,12 +184,17 @@ public class SpongeGroupManager implements GroupManager, LPSubjectCollection { @Override public Predicate getIdentifierValidityPredicate() { - // TODO change this to use the actual limitations - return Predicates.alwaysTrue(); + return DataConstraints.GROUP_NAME_TEST; } @Override public CompletableFuture loadSubject(String identifier) { + if (!DataConstraints.GROUP_NAME_TEST.test(identifier)) { + CompletableFuture fut = new CompletableFuture<>(); + fut.completeExceptionally(new IllegalArgumentException("Illegal subject identifier")); + return fut; + } + LPSubject present = subjectLoadingCache.getIfPresent(identifier.toLowerCase()); if (present != null) { return CompletableFuture.completedFuture(present);