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:
Dylan K. Taylor
2020-11-27 18:06:59 +00:00
parent 5142281cfa
commit 5e44d5f75e
3 changed files with 8 additions and 10 deletions

View File

@@ -99,12 +99,12 @@ class WhitelistCommand extends VanillaCommand{
}
switch(strtolower($args[0])){
case "add":
$sender->getServer()->getOfflinePlayer($args[1])->setWhitelisted(true);
$sender->getServer()->addWhitelist($args[1]);
Command::broadcastCommandMessage($sender, new TranslationContainer("commands.whitelist.add.success", [$args[1]]));
return true;
case "remove":
$sender->getServer()->getOfflinePlayer($args[1])->setWhitelisted(false);
$sender->getServer()->removeWhitelist($args[1]);
Command::broadcastCommandMessage($sender, new TranslationContainer("commands.whitelist.remove.success", [$args[1]]));
return true;