mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-09-08 10:53:05 +00:00
Do not load playerdata from disk just to op/deop/whitelist/dewhitelist
this is an impressively dumb idea. the playerdata is not used here in any capacity so it doesn't make sense to load it, especially considering that it takes a significant amount of time.
This commit is contained in:
@ -57,12 +57,11 @@ class DeopCommand extends VanillaCommand{
|
||||
throw new InvalidCommandSyntaxException();
|
||||
}
|
||||
|
||||
$player = $sender->getServer()->getOfflinePlayer($name);
|
||||
$player->setOp(false);
|
||||
if($player instanceof Player){
|
||||
$sender->getServer()->removeOp($name);
|
||||
if(($player = $sender->getServer()->getPlayerExact($name)) !== null){
|
||||
$player->sendMessage(TextFormat::GRAY . "You are no longer op!");
|
||||
}
|
||||
Command::broadcastCommandMessage($sender, new TranslationContainer("commands.deop.success", [$player->getName()]));
|
||||
Command::broadcastCommandMessage($sender, new TranslationContainer("commands.deop.success", [$name]));
|
||||
|
||||
return true;
|
||||
}
|
||||
|
Reference in New Issue
Block a user