mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-10-16 11:58:00 +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 OpCommand extends VanillaCommand{
|
||||
throw new InvalidCommandSyntaxException();
|
||||
}
|
||||
|
||||
$player = $sender->getServer()->getOfflinePlayer($name);
|
||||
Command::broadcastCommandMessage($sender, new TranslationContainer("commands.op.success", [$player->getName()]));
|
||||
if($player instanceof Player){
|
||||
$sender->getServer()->addOp($name);
|
||||
if(($player = $sender->getServer()->getPlayerExact($name)) !== null){
|
||||
$player->sendMessage(TextFormat::GRAY . "You are now op!");
|
||||
}
|
||||
$player->setOp(true);
|
||||
Command::broadcastCommandMessage($sender, new TranslationContainer("commands.op.success", [$name]));
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user