diff --git a/plugin.yml b/plugin.yml index 4f5bbdc..46f943f 100644 --- a/plugin.yml +++ b/plugin.yml @@ -1,6 +1,6 @@ name: DevTools main: DevTools\DevTools -version: 1.9.0 +version: 1.10.0 api: 1.3.1 load: STARTUP author: PocketMine Team diff --git a/src/DevTools/DevTools.php b/src/DevTools/DevTools.php index 043a342..48da72c 100644 --- a/src/DevTools/DevTools.php +++ b/src/DevTools/DevTools.php @@ -190,7 +190,12 @@ private function makePluginCommand(CommandSender $sender, Command $command, $lab $sender->sendMessage("[DevTools] Adding $path"); } - $phar->compressFiles(\Phar::GZ); + foreach($phar as $file => $finfo){ + /** @var \PharFileInfo $finfo */ + if($finfo->getSize() > (1024 * 512)){ + $finfo->compress(\Phar::GZ); + } + } $phar->stopBuffering(); $sender->sendMessage("Phar plugin ".$description->getName() ." v".$description->getVersion()." has been created on ".$pharPath); return true; @@ -226,6 +231,12 @@ private function makeServerCommand(CommandSender $sender, Command $command, $lab $phar->addFile($file, $path); $sender->sendMessage("[DevTools] Adding $path"); } + foreach($phar as $file => $finfo){ + /** @var \PharFileInfo $finfo */ + if($finfo->getSize() > (1024 * 512)){ + $finfo->compress(\Phar::GZ); + } + } $phar->stopBuffering(); $sender->sendMessage($server->getName() . " " . $server->getPocketMineVersion() . " Phar file has been created on ".$pharPath);