mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-05-15 10:19:39 +00:00
Remove deprecated APIs
This commit is contained in:
parent
32d67080e5
commit
9fd6653f36
@ -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
|
||||
*/
|
||||
|
@ -87,13 +87,6 @@ abstract class AsyncTask extends Runnable{
|
||||
$worker->getNotifier()->wakeupSleeper();
|
||||
}
|
||||
|
||||
/**
|
||||
* @deprecated
|
||||
*/
|
||||
public function isCrashed() : bool{
|
||||
return $this->isTerminated();
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns whether this task has finished executing, whether successfully or not. This differs from isRunning()
|
||||
* because it is not true prior to task execution.
|
||||
@ -120,20 +113,6 @@ abstract class AsyncTask extends Runnable{
|
||||
$this->result = is_scalar($result) || is_null($result) || $result instanceof ThreadSafe ? $result : new NonThreadSafeValue($result);
|
||||
}
|
||||
|
||||
/**
|
||||
* @deprecated
|
||||
*/
|
||||
public function cancelRun() : void{
|
||||
//NOOP
|
||||
}
|
||||
|
||||
/**
|
||||
* @deprecated
|
||||
*/
|
||||
public function hasCancelledRun() : bool{
|
||||
return false;
|
||||
}
|
||||
|
||||
public function setSubmitted() : void{
|
||||
$this->submitted = true;
|
||||
}
|
||||
@ -193,13 +172,6 @@ abstract class AsyncTask extends Runnable{
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* @deprecated No longer used
|
||||
*/
|
||||
public function onError() : void{
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Saves mixed data in thread-local storage. Data stored using this storage is **only accessible from the thread it
|
||||
* was stored on**. Data stored using this method will **not** be serialized.
|
||||
|
Loading…
x
Reference in New Issue
Block a user