diff --git a/src/pocketmine/OfflinePlayer.php b/src/pocketmine/OfflinePlayer.php index fe11144a6..60e197593 100644 --- a/src/pocketmine/OfflinePlayer.php +++ b/src/pocketmine/OfflinePlayer.php @@ -44,7 +44,7 @@ class OfflinePlayer implements IPlayer, Metadatable{ public function __construct(Server $server, string $name){ $this->server = $server; $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); }else{ $this->namedtag = null; @@ -64,7 +64,7 @@ class OfflinePlayer implements IPlayer, Metadatable{ } public function isOp() : bool{ - return $this->server->isOp(strtolower($this->getName())); + return $this->server->isOp($this->name); } public function setOp(bool $value){ @@ -73,38 +73,38 @@ class OfflinePlayer implements IPlayer, Metadatable{ } if($value){ - $this->server->addOp(strtolower($this->getName())); + $this->server->addOp($this->name); }else{ - $this->server->removeOp(strtolower($this->getName())); + $this->server->removeOp($this->name); } } public function isBanned() : bool{ - return $this->server->getNameBans()->isBanned(strtolower($this->getName())); + return $this->server->getNameBans()->isBanned($this->name); } public function setBanned(bool $value){ if($value){ - $this->server->getNameBans()->addBan($this->getName(), null, null, null); + $this->server->getNameBans()->addBan($this->name, null, null, null); }else{ - $this->server->getNameBans()->remove($this->getName()); + $this->server->getNameBans()->remove($this->name); } } public function isWhitelisted() : bool{ - return $this->server->isWhitelisted(strtolower($this->getName())); + return $this->server->isWhitelisted($this->name); } public function setWhitelisted(bool $value){ if($value){ - $this->server->addWhitelist(strtolower($this->getName())); + $this->server->addWhitelist($this->name); }else{ - $this->server->removeWhitelist(strtolower($this->getName())); + $this->server->removeWhitelist($this->name); } } public function getPlayer(){ - return $this->server->getPlayerExact($this->getName()); + return $this->server->getPlayerExact($this->name); } public function getFirstPlayed(){