mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-05-14 01:39:52 +00:00
Merge branch 'release/3.2'
This commit is contained in:
commit
22c8077bdf
@ -44,7 +44,7 @@ class OfflinePlayer implements IPlayer, Metadatable{
|
|||||||
public function __construct(Server $server, string $name){
|
public function __construct(Server $server, string $name){
|
||||||
$this->server = $server;
|
$this->server = $server;
|
||||||
$this->name = $name;
|
$this->name = $name;
|
||||||
if(file_exists($this->server->getDataPath() . "players/" . strtolower($this->getName()) . ".dat")){
|
if(file_exists($this->server->getDataPath() . "players/" . strtolower($this->name) . ".dat")){
|
||||||
$this->namedtag = $this->server->getOfflinePlayerData($this->name);
|
$this->namedtag = $this->server->getOfflinePlayerData($this->name);
|
||||||
}else{
|
}else{
|
||||||
$this->namedtag = null;
|
$this->namedtag = null;
|
||||||
@ -64,7 +64,7 @@ class OfflinePlayer implements IPlayer, Metadatable{
|
|||||||
}
|
}
|
||||||
|
|
||||||
public function isOp() : bool{
|
public function isOp() : bool{
|
||||||
return $this->server->isOp(strtolower($this->getName()));
|
return $this->server->isOp($this->name);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function setOp(bool $value){
|
public function setOp(bool $value){
|
||||||
@ -73,38 +73,38 @@ class OfflinePlayer implements IPlayer, Metadatable{
|
|||||||
}
|
}
|
||||||
|
|
||||||
if($value){
|
if($value){
|
||||||
$this->server->addOp(strtolower($this->getName()));
|
$this->server->addOp($this->name);
|
||||||
}else{
|
}else{
|
||||||
$this->server->removeOp(strtolower($this->getName()));
|
$this->server->removeOp($this->name);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public function isBanned() : bool{
|
public function isBanned() : bool{
|
||||||
return $this->server->getNameBans()->isBanned(strtolower($this->getName()));
|
return $this->server->getNameBans()->isBanned($this->name);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function setBanned(bool $value){
|
public function setBanned(bool $value){
|
||||||
if($value){
|
if($value){
|
||||||
$this->server->getNameBans()->addBan($this->getName(), null, null, null);
|
$this->server->getNameBans()->addBan($this->name, null, null, null);
|
||||||
}else{
|
}else{
|
||||||
$this->server->getNameBans()->remove($this->getName());
|
$this->server->getNameBans()->remove($this->name);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public function isWhitelisted() : bool{
|
public function isWhitelisted() : bool{
|
||||||
return $this->server->isWhitelisted(strtolower($this->getName()));
|
return $this->server->isWhitelisted($this->name);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function setWhitelisted(bool $value){
|
public function setWhitelisted(bool $value){
|
||||||
if($value){
|
if($value){
|
||||||
$this->server->addWhitelist(strtolower($this->getName()));
|
$this->server->addWhitelist($this->name);
|
||||||
}else{
|
}else{
|
||||||
$this->server->removeWhitelist(strtolower($this->getName()));
|
$this->server->removeWhitelist($this->name);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getPlayer(){
|
public function getPlayer(){
|
||||||
return $this->server->getPlayerExact($this->getName());
|
return $this->server->getPlayerExact($this->name);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getFirstPlayed(){
|
public function getFirstPlayed(){
|
||||||
|
Loading…
x
Reference in New Issue
Block a user