mirror of
https://github.com/LuckPerms/LuckPerms.git
synced 2024-12-28 20:17:55 +01:00
Process 'give default if needed' when saving instead of after each change made in the API (#2775)
This commit is contained in:
parent
8ef871f6db
commit
c28b1949a9
@ -222,7 +222,7 @@ public class ApiPermissionHolder implements net.luckperms.api.model.PermissionHo
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void clear() {
|
public void clear() {
|
||||||
if (ApiPermissionHolder.this.handle.clearNodes(this.dataType, null, true)) {
|
if (ApiPermissionHolder.this.handle.clearNodes(this.dataType, null, false)) {
|
||||||
onNodeChange();
|
onNodeChange();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -230,7 +230,7 @@ public class ApiPermissionHolder implements net.luckperms.api.model.PermissionHo
|
|||||||
@Override
|
@Override
|
||||||
public void clear(@NonNull Predicate<? super Node> test) {
|
public void clear(@NonNull Predicate<? super Node> test) {
|
||||||
Objects.requireNonNull(test, "test");
|
Objects.requireNonNull(test, "test");
|
||||||
if (ApiPermissionHolder.this.handle.removeIf(this.dataType, null, test, true)) {
|
if (ApiPermissionHolder.this.handle.removeIf(this.dataType, null, test, false)) {
|
||||||
onNodeChange();
|
onNodeChange();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -239,7 +239,7 @@ public class ApiPermissionHolder implements net.luckperms.api.model.PermissionHo
|
|||||||
@Override
|
@Override
|
||||||
public void clear(@NonNull ContextSet contextSet) {
|
public void clear(@NonNull ContextSet contextSet) {
|
||||||
Objects.requireNonNull(contextSet, "contextSet");
|
Objects.requireNonNull(contextSet, "contextSet");
|
||||||
if (ApiPermissionHolder.this.handle.clearNodes(this.dataType, contextSet, true)) {
|
if (ApiPermissionHolder.this.handle.clearNodes(this.dataType, contextSet, false)) {
|
||||||
onNodeChange();
|
onNodeChange();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -248,7 +248,7 @@ public class ApiPermissionHolder implements net.luckperms.api.model.PermissionHo
|
|||||||
public void clear(@NonNull ContextSet contextSet, @NonNull Predicate<? super Node> test) {
|
public void clear(@NonNull ContextSet contextSet, @NonNull Predicate<? super Node> test) {
|
||||||
Objects.requireNonNull(contextSet, "contextSet");
|
Objects.requireNonNull(contextSet, "contextSet");
|
||||||
Objects.requireNonNull(test, "test");
|
Objects.requireNonNull(test, "test");
|
||||||
if (ApiPermissionHolder.this.handle.removeIf(this.dataType, contextSet, test, true)) {
|
if (ApiPermissionHolder.this.handle.removeIf(this.dataType, contextSet, test, false)) {
|
||||||
onNodeChange();
|
onNodeChange();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -90,8 +90,9 @@ public class ApiUserManager extends ApiAbstractManager<User, net.luckperms.api.m
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public @NonNull CompletableFuture<Void> saveUser(net.luckperms.api.model.user.@NonNull User user) {
|
public @NonNull CompletableFuture<Void> saveUser(net.luckperms.api.model.user.@NonNull User user) {
|
||||||
Objects.requireNonNull(user, "user");
|
User internal = ApiUser.cast(Objects.requireNonNull(user, "user"));
|
||||||
return this.plugin.getStorage().saveUser(ApiUser.cast(user));
|
this.plugin.getUserManager().giveDefaultIfNeeded(internal);
|
||||||
|
return this.plugin.getStorage().saveUser(internal);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
Loading…
Reference in New Issue
Block a user