mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-09-07 10:22:56 +00:00
and more typehints
This commit is contained in:
@ -48,7 +48,7 @@ class OfflinePlayer implements IPlayer, Metadatable{
|
||||
}
|
||||
}
|
||||
|
||||
public function isOnline(){
|
||||
public function isOnline() : bool{
|
||||
return $this->getPlayer() !== null;
|
||||
}
|
||||
|
||||
@ -60,11 +60,11 @@ class OfflinePlayer implements IPlayer, Metadatable{
|
||||
return $this->server;
|
||||
}
|
||||
|
||||
public function isOp(){
|
||||
public function isOp() : bool{
|
||||
return $this->server->isOp(strtolower($this->getName()));
|
||||
}
|
||||
|
||||
public function setOp($value){
|
||||
public function setOp(bool $value){
|
||||
if($value === $this->isOp()){
|
||||
return;
|
||||
}
|
||||
@ -76,11 +76,11 @@ class OfflinePlayer implements IPlayer, Metadatable{
|
||||
}
|
||||
}
|
||||
|
||||
public function isBanned(){
|
||||
public function isBanned() : bool{
|
||||
return $this->server->getNameBans()->isBanned(strtolower($this->getName()));
|
||||
}
|
||||
|
||||
public function setBanned($value){
|
||||
public function setBanned(bool $value){
|
||||
if($value === true){
|
||||
$this->server->getNameBans()->addBan($this->getName(), null, null, null);
|
||||
}else{
|
||||
@ -88,11 +88,11 @@ class OfflinePlayer implements IPlayer, Metadatable{
|
||||
}
|
||||
}
|
||||
|
||||
public function isWhitelisted(){
|
||||
public function isWhitelisted() : bool{
|
||||
return $this->server->isWhitelisted(strtolower($this->getName()));
|
||||
}
|
||||
|
||||
public function setWhitelisted($value){
|
||||
public function setWhitelisted(bool $value){
|
||||
if($value === true){
|
||||
$this->server->addWhitelist(strtolower($this->getName()));
|
||||
}else{
|
||||
@ -112,7 +112,7 @@ class OfflinePlayer implements IPlayer, Metadatable{
|
||||
return $this->namedtag instanceof CompoundTag ? $this->namedtag["lastPlayed"] : null;
|
||||
}
|
||||
|
||||
public function hasPlayedBefore(){
|
||||
public function hasPlayedBefore() : bool{
|
||||
return $this->namedtag instanceof CompoundTag;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user