mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-05-15 10:19:39 +00:00
Permission: remove dead code
Bukkit CCC at its finest... what the fuck this was doing anyway I have no idea an addChild() method would have made far more sense, especially considering that addParent() doesn't actually mutate the child.
This commit is contained in:
parent
c454441646
commit
1de486733a
@ -116,27 +116,4 @@ class Permission{
|
||||
$p->recalculatePermissions();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string|Permission $name
|
||||
*
|
||||
* @return Permission|null Permission if $name is a string, null if it's a Permission
|
||||
*/
|
||||
public function addParent($name, bool $value) : ?Permission{
|
||||
if($name instanceof Permission){
|
||||
$name->getChildren()[$this->getName()] = $value;
|
||||
$name->recalculatePermissibles();
|
||||
return null;
|
||||
}else{
|
||||
$perm = PermissionManager::getInstance()->getPermission($name);
|
||||
if($perm === null){
|
||||
$perm = new Permission($name);
|
||||
PermissionManager::getInstance()->addPermission($perm);
|
||||
}
|
||||
|
||||
$this->addParent($perm, $value);
|
||||
|
||||
return $perm;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user