mirror of
https://github.com/LuckPerms/LuckPerms.git
synced 2024-11-28 05:35:26 +01:00
Don't call NodeAddEvent when adding the default group (#1177)
This commit is contained in:
parent
066189b486
commit
c59f2ab37a
@ -124,7 +124,7 @@ public abstract class AbstractUserManager<T extends User> extends AbstractManage
|
||||
|
||||
if (!hasGroup) {
|
||||
user.getPrimaryGroup().setStoredValue(NodeFactory.DEFAULT_GROUP_NAME);
|
||||
user.setPermission(NodeFactory.buildGroupNode(NodeFactory.DEFAULT_GROUP_NAME).build());
|
||||
user.setPermission(NodeFactory.buildGroupNode(NodeFactory.DEFAULT_GROUP_NAME).build(), false);
|
||||
work = true;
|
||||
}
|
||||
|
||||
|
@ -536,6 +536,10 @@ public abstract class PermissionHolder {
|
||||
* @param node the node to set
|
||||
*/
|
||||
public DataMutateResult setPermission(Node node) {
|
||||
return setPermission(node, true);
|
||||
}
|
||||
|
||||
public DataMutateResult setPermission(Node node, boolean callEvent) {
|
||||
if (hasPermission(NodeMapType.ENDURING, node, StandardNodeEquality.IGNORE_EXPIRY_TIME_AND_VALUE) != Tristate.UNDEFINED) {
|
||||
return DataMutateResult.ALREADY_HAS;
|
||||
}
|
||||
@ -545,7 +549,9 @@ public abstract class PermissionHolder {
|
||||
invalidateCache();
|
||||
ImmutableCollection<? extends Node> after = enduringData().immutable().values();
|
||||
|
||||
if (callEvent) {
|
||||
this.plugin.getEventFactory().handleNodeAdd(node, this, before, after);
|
||||
}
|
||||
return DataMutateResult.SUCCESS;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user