mirror of
https://github.com/LuckPerms/LuckPerms.git
synced 2026-11-24 08:14:25 +00:00
Fix various runtime errors
This commit is contained in:
34 files changed
+266
-61
No files matched your search
+3
-2
@@ -34,6 +34,7 @@ import com.google.common.collect.Maps;
|
||||
|
||||
import me.lucko.luckperms.common.bulkupdate.comparison.Constraint;
|
||||
import me.lucko.luckperms.common.bulkupdate.comparison.StandardComparison;
|
||||
import me.lucko.luckperms.common.context.contextset.ImmutableContextSetImpl;
|
||||
import me.lucko.luckperms.common.model.manager.group.AbstractGroupManager;
|
||||
import me.lucko.luckperms.common.storage.misc.DataConstraints;
|
||||
import me.lucko.luckperms.common.util.ImmutableCollectors;
|
||||
@@ -194,7 +195,7 @@ public class SpongeGroupManager extends AbstractGroupManager<SpongeGroup> implem
|
||||
|
||||
List<HeldNode<String>> lookup = this.plugin.getStorage().getGroupsWithPermission(Constraint.of(StandardComparison.EQUAL, permission)).join();
|
||||
for (HeldNode<String> holder : lookup) {
|
||||
if (holder.getNode().getContexts().equals(ImmutableContextSet.empty())) {
|
||||
if (holder.getNode().getContexts().equals(ImmutableContextSetImpl.EMPTY)) {
|
||||
ret.put(getService().getReferenceFactory().obtain(getIdentifier(), holder.getHolder()), holder.getNode().getValue());
|
||||
}
|
||||
}
|
||||
@@ -223,7 +224,7 @@ public class SpongeGroupManager extends AbstractGroupManager<SpongeGroup> implem
|
||||
public ImmutableMap<LPSubject, Boolean> getLoadedWithPermission(String permission) {
|
||||
return getAll().values().stream()
|
||||
.map(SpongeGroup::sponge)
|
||||
.map(sub -> Maps.immutableEntry(sub, sub.getPermissionValue(ImmutableContextSet.empty(), permission)))
|
||||
.map(sub -> Maps.immutableEntry(sub, sub.getPermissionValue(ImmutableContextSetImpl.EMPTY, permission)))
|
||||
.filter(pair -> pair.getValue() != Tristate.UNDEFINED)
|
||||
.collect(ImmutableCollectors.toMap(Map.Entry::getKey, sub -> sub.getValue().asBoolean()));
|
||||
}
|
||||
|
||||
@@ -34,6 +34,7 @@ import com.google.common.collect.Maps;
|
||||
|
||||
import me.lucko.luckperms.common.bulkupdate.comparison.Constraint;
|
||||
import me.lucko.luckperms.common.bulkupdate.comparison.StandardComparison;
|
||||
import me.lucko.luckperms.common.context.contextset.ImmutableContextSetImpl;
|
||||
import me.lucko.luckperms.common.model.UserIdentifier;
|
||||
import me.lucko.luckperms.common.model.manager.user.AbstractUserManager;
|
||||
import me.lucko.luckperms.common.model.manager.user.UserHousekeeper;
|
||||
@@ -216,7 +217,7 @@ public class SpongeUserManager extends AbstractUserManager<SpongeUser> implement
|
||||
|
||||
List<HeldNode<UUID>> lookup = this.plugin.getStorage().getUsersWithPermission(Constraint.of(StandardComparison.EQUAL, permission)).join();
|
||||
for (HeldNode<UUID> holder : lookup) {
|
||||
if (holder.getNode().getContexts().equals(ImmutableContextSet.empty())) {
|
||||
if (holder.getNode().getContexts().equals(ImmutableContextSetImpl.EMPTY)) {
|
||||
ret.put(getService().getReferenceFactory().obtain(getIdentifier(), holder.getHolder().toString()), holder.getNode().getValue());
|
||||
}
|
||||
}
|
||||
@@ -245,7 +246,7 @@ public class SpongeUserManager extends AbstractUserManager<SpongeUser> implement
|
||||
public ImmutableMap<LPSubject, Boolean> getLoadedWithPermission(String permission) {
|
||||
return getAll().values().stream()
|
||||
.map(SpongeUser::sponge)
|
||||
.map(sub -> Maps.immutableEntry(sub, sub.getPermissionValue(ImmutableContextSet.empty(), permission)))
|
||||
.map(sub -> Maps.immutableEntry(sub, sub.getPermissionValue(ImmutableContextSetImpl.EMPTY, permission)))
|
||||
.filter(pair -> pair.getValue() != Tristate.UNDEFINED)
|
||||
.collect(ImmutableCollectors.toMap(Map.Entry::getKey, sub -> sub.getValue().asBoolean()));
|
||||
}
|
||||
|
||||
+2
-1
@@ -31,6 +31,7 @@ import com.google.common.collect.ImmutableMap;
|
||||
import com.google.common.collect.ImmutableSet;
|
||||
|
||||
import me.lucko.luckperms.common.cache.LoadingMap;
|
||||
import me.lucko.luckperms.common.context.contextset.ImmutableContextSetImpl;
|
||||
import me.lucko.luckperms.common.util.ImmutableCollectors;
|
||||
import me.lucko.luckperms.common.util.Predicates;
|
||||
import me.lucko.luckperms.sponge.service.LuckPermsService;
|
||||
@@ -175,7 +176,7 @@ public class PersistedCollection implements LPSubjectCollection {
|
||||
public ImmutableMap<LPSubject, Boolean> getLoadedWithPermission(String permission) {
|
||||
ImmutableMap.Builder<LPSubject, Boolean> m = ImmutableMap.builder();
|
||||
for (LPSubject subject : this.subjects.values()) {
|
||||
Tristate ts = subject.getPermissionValue(ImmutableContextSet.empty(), permission);
|
||||
Tristate ts = subject.getPermissionValue(ImmutableContextSetImpl.EMPTY, permission);
|
||||
if (ts != Tristate.UNDEFINED) {
|
||||
m.put(subject, ts.asBoolean());
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user