Allow plugins to create their own AsyncPools more easily by exposing the autoloader on the Server object.
Justification
Many a time I've seen others' plugins implement what is basically a clone of PM's AsyncPool for doing things like file and network I/O. This is wasteful to me when PM already contains such functionality. Sometimes, this means that plugin developers will just use the server's own AsyncPool for I/O and block compression and chunk generation.
Alternative methods
Reflection on the Server class
$server = $this->getServer();
$r = new ReflectionObject($server);
$p = $r->getProperty('autoloader');
$p->setAccessible(true);
$this->pool = new AsyncPool(5, 500, $p->getValue($server), $server->getLogger(), $server->getTickSleeper());
Description
Allow plugins to create their own AsyncPools more easily by exposing the autoloader on the Server object.
Justification
Many a time I've seen others' plugins implement what is basically a clone of PM's AsyncPool for doing things like file and network I/O. This is wasteful to me when PM already contains such functionality. Sometimes, this means that plugin developers will just use the server's own AsyncPool for I/O and block compression and chunk generation.
Alternative methods
Reflection on the Server class