Remove deprecated APIs

This commit is contained in:
Dylan K. Taylor
2023-08-09 16:38:09 +01:00
parent 32d67080e5
commit 9fd6653f36
2 changed files with 0 additions and 49 deletions

View File

@ -30,7 +30,6 @@ use pocketmine\command\PluginCommand;
use pocketmine\lang\KnownTranslationFactory;
use pocketmine\scheduler\TaskScheduler;
use pocketmine\Server;
use pocketmine\utils\AssumptionFailedError;
use pocketmine\utils\Config;
use pocketmine\utils\Utils;
use Symfony\Component\Filesystem\Path;
@ -231,26 +230,6 @@ abstract class PluginBase implements Plugin, CommandExecutor{
return Path::join($this->getResourceFolder(), $filename);
}
/**
* @deprecated Prefer using standard PHP functions with {@link PluginBase::getResourcePath()}, like
* file_get_contents() or fopen().
*
* Gets an embedded resource on the plugin file.
* WARNING: You must close the resource given using fclose()
*
* @return null|resource Resource data, or null
*/
public function getResource(string $filename){
$filename = rtrim(str_replace(DIRECTORY_SEPARATOR, "/", $filename), "/");
if(file_exists($this->resourceFolder . $filename)){
$resource = fopen($this->resourceFolder . $filename, "rb");
if($resource === false) throw new AssumptionFailedError("fopen() should not fail on a file which exists");
return $resource;
}
return null;
}
/**
* Saves an embedded resource to its relative location in the data folder
*/