mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-04-22 00:33:59 +00:00
Added PermissionAttachment::setPermissions()
This allows bulk permission without recalculating the new permissions until all everything is set. Permission plugins that set a big amount of nodes may want to use this method.
This commit is contained in:
parent
4624dfb472
commit
0328b4c5f5
@ -88,6 +88,17 @@ class PermissionAttachment{
|
||||
return $this->permissions;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param bool[] $permissions
|
||||
*/
|
||||
public function setPermissions(array $permissions){
|
||||
$this->permissions = [];
|
||||
foreach($permissions as $key => $value){
|
||||
$this->permissions[$key] = (bool) $value;
|
||||
}
|
||||
$this->permissible->recalculatePermissions();
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string|Permission $name
|
||||
* @param bool $value
|
||||
|
Loading…
x
Reference in New Issue
Block a user