mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-06-10 21:45:35 +00:00
OfflinePlayer: remove more useless junk
to obtain an OfflinePlayer instance you had to have a server instance to start with, which means getServer() is pointless, and also that isOp() and setOp() (which can be removed thanks to the fact that OfflinePlayer is not a Permissible) can be done by just asking the server.
This commit is contained in:
parent
3e9a37ca77
commit
c102477f91
@ -50,26 +50,6 @@ class OfflinePlayer implements IPlayer{
|
||||
return $this->name;
|
||||
}
|
||||
|
||||
public function getServer() : Server{
|
||||
return $this->server;
|
||||
}
|
||||
|
||||
public function isOp() : bool{
|
||||
return $this->server->isOp($this->name);
|
||||
}
|
||||
|
||||
public function setOp(bool $value) : void{
|
||||
if($value === $this->isOp()){
|
||||
return;
|
||||
}
|
||||
|
||||
if($value){
|
||||
$this->server->addOp($this->name);
|
||||
}else{
|
||||
$this->server->removeOp($this->name);
|
||||
}
|
||||
}
|
||||
|
||||
public function getPlayer() : ?Player{
|
||||
return $this->server->getPlayerExact($this->name);
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user