mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-06-12 14:35:35 +00:00
Merge branch 'release/3.1'
This commit is contained in:
commit
46ea0186e4
@ -30,7 +30,7 @@ use pocketmine\timings\Timings;
|
|||||||
|
|
||||||
class PermissibleBase implements Permissible{
|
class PermissibleBase implements Permissible{
|
||||||
/** @var ServerOperator */
|
/** @var ServerOperator */
|
||||||
private $opable = null;
|
private $opable;
|
||||||
|
|
||||||
/** @var Permissible */
|
/** @var Permissible */
|
||||||
private $parent = null;
|
private $parent = null;
|
||||||
@ -59,25 +59,15 @@ class PermissibleBase implements Permissible{
|
|||||||
* @return bool
|
* @return bool
|
||||||
*/
|
*/
|
||||||
public function isOp() : bool{
|
public function isOp() : bool{
|
||||||
if($this->opable === null){
|
|
||||||
return false;
|
|
||||||
}else{
|
|
||||||
return $this->opable->isOp();
|
return $this->opable->isOp();
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param bool $value
|
* @param bool $value
|
||||||
*
|
|
||||||
* @throws \Exception
|
|
||||||
*/
|
*/
|
||||||
public function setOp(bool $value){
|
public function setOp(bool $value){
|
||||||
if($this->opable === null){
|
|
||||||
throw new \LogicException("Cannot change op value as no ServerOperator is set");
|
|
||||||
}else{
|
|
||||||
$this->opable->setOp($value);
|
$this->opable->setOp($value);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param Permission|string $name
|
* @param Permission|string $name
|
||||||
|
@ -595,11 +595,7 @@ class PluginManager{
|
|||||||
* @return bool
|
* @return bool
|
||||||
*/
|
*/
|
||||||
public function isPluginEnabled(Plugin $plugin) : bool{
|
public function isPluginEnabled(Plugin $plugin) : bool{
|
||||||
if($plugin instanceof Plugin and isset($this->plugins[$plugin->getDescription()->getName()])){
|
return isset($this->plugins[$plugin->getDescription()->getName()]) and $plugin->isEnabled();
|
||||||
return $plugin->isEnabled();
|
|
||||||
}else{
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -668,7 +664,7 @@ class PluginManager{
|
|||||||
}elseif(is_string($data["permission"])){
|
}elseif(is_string($data["permission"])){
|
||||||
$newCmd->setPermission($data["permission"]);
|
$newCmd->setPermission($data["permission"]);
|
||||||
}else{
|
}else{
|
||||||
throw new \InvalidArgumentException("Permission must be a string or boolean, " . gettype($data["permission"] . " given"));
|
throw new \InvalidArgumentException("Permission must be a string or boolean, " . gettype($data["permission"]) . " given");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user