Merge branch 'next-minor'

This commit is contained in:
Dylan K. Taylor 2019-10-22 19:05:11 +01:00
commit ebbb99b96b
11 changed files with 39 additions and 16 deletions

View File

@ -74,3 +74,29 @@ Plugin developers should **only** update their required API to this version if y
- Fixed some issues with multiple consecutive commas inside quotes in form responses.
- Fixed server crash when the manifest json does not contain a json object in a resource pack.
- Ender pearls no longer collide with blocks that do not have any collision boxes.
# 3.9.6
- Updated Composer dependencies to their latest versions.
- Prevent clients repeating the resource pack sequence. This fixes error spam with bugged 1.12 clients.
- `Internet::simpleCurl()` now includes the PocketMine-MP version in the user-agent string.
- Spawn protection is now disabled by default in the setup wizard.
- Default difficulty is now NORMAL(2) instead of EASY(1).
- Fixed crashing on corrupted world manifest and unsupported world formats.
- Fixed `/transferserver` being usable without appropriate permissions.
- `RegionLoader->removeChunk()` now writes the region header as appropriate.
- Fixed performance issue when loading large regions (bug in header validation).
- Fixed skin geometry being removed when the JSON contained comments.
- Added new constants to `EventPacket`.
- Added encode/decode for `StructureTemplateDataExportRequestPacket` and `StructureTemplateDataExportResponsePacket`.
- Fixed broken type asserts in `LevelChunkPacket::withCache()` and `ClientCacheMissResponsePacket::create()`.
- `types\CommandParameter` field `byte1` has been renamed to `flags`.
- Cleaned up public interface of `AvailableCommandsPacket`, removing fields which exposed details of the encoding scheme.
- Improved documentation for the following API methods:
- `pocketmine\item\Item`:
- `addCreativeItem()`
- `removeCreativeItem()`
- `clearCreativeItems()`
- `pocketmine\level\Explosion`:
- `explodeA()`
- `explodeB()`
- Fixed various cosmetic documentation inconsistencies in the core and dependencies.

View File

@ -45,7 +45,7 @@ class Chest extends Spawnable implements Container, Nameable{
/** @var ChestInventory */
protected $inventory;
/** @var DoubleChestInventory */
/** @var DoubleChestInventory|null */
protected $doubleInventory = null;
/** @var int|null */

View File

@ -199,6 +199,9 @@ class Human extends Living implements ProjectileSource, InventoryHolder{
return (int) min(100, 7 * $this->xpManager->getXpLevel());
}
/**
* @return PlayerInventory
*/
public function getInventory(){
return $this->inventory;
}

View File

@ -23,9 +23,9 @@ declare(strict_types=1);
namespace pocketmine\entity;
use Ahc\Json\Comment as CommentedJsonDecoder;
use function implode;
use function in_array;
use function json_decode;
use function json_encode;
use function json_last_error_msg;
use function strlen;
@ -61,7 +61,7 @@ final class Skin{
}
if($geometryData !== ""){
$decodedGeometry = json_decode($geometryData);
$decodedGeometry = (new CommentedJsonDecoder())->decode($geometryData);
if($decodedGeometry === false){
throw new \InvalidArgumentException("Invalid geometry data (" . json_last_error_msg() . ")");
}

View File

@ -164,7 +164,7 @@ class AvailableCommandsPacket extends DataPacket implements ClientboundPacket{
/**
* @param CommandEnum $enum
* @param string[] $enumValueMap
* @param int[] $enumValueMap
*/
protected function putEnum(CommandEnum $enum, array $enumValueMap) : void{
$this->putString($enum->getName());

View File

@ -42,7 +42,7 @@ class ClientCacheMissResponsePacket extends DataPacket implements ClientboundPac
*/
public static function create(array $blobs) : self{
//type check
(static function(ChunkCacheBlob ...$blobs){})($blobs);
(static function(ChunkCacheBlob ...$blobs){})(...$blobs);
$result = new self;
$result->blobs = $blobs;

View File

@ -57,7 +57,7 @@ class LevelChunkPacket extends DataPacket implements ClientboundPacket{
}
public static function withCache(int $chunkX, int $chunkZ, int $subChunkCount, array $usedBlobHashes, string $extraPayload) : self{
(static function(int ...$hashes){})($usedBlobHashes);
(static function(int ...$hashes){})(...$usedBlobHashes);
$result = new self;
$result->chunkX = $chunkX;
$result->chunkZ = $chunkZ;

View File

@ -95,12 +95,7 @@ class PermissionParser{
$desc = null;
$children = [];
if(isset($data["default"])){
$value = PermissionParser::defaultFromString($data["default"]);
if($value !== null){
$default = $value;
}else{
throw new \InvalidStateException("'default' key contained unknown value");
}
$default = PermissionParser::defaultFromString($data["default"]);
}
if(isset($data["children"])){

View File

@ -27,7 +27,7 @@ use pocketmine\utils\Utils;
abstract class Task{
/** @var TaskHandler */
/** @var TaskHandler|null */
private $taskHandler = null;
/**

View File

@ -45,7 +45,7 @@ class MainLogger extends \AttachableThreadedLogger{
/** @var \Threaded */
protected $logStream;
/** @var bool */
protected $shutdown;
protected $shutdown = false;
/** @var bool */
protected $logDebug;
/** @var bool */
@ -272,7 +272,6 @@ class MainLogger extends \AttachableThreadedLogger{
}
public function run() : void{
$this->shutdown = false;
$logResource = fopen($this->logFile, "ab");
if(!is_resource($logResource)){
throw new \RuntimeException("Couldn't open log file");

View File

@ -36,7 +36,7 @@ abstract class LightUpdate{
/** @var ChunkManager */
protected $world;
/** @var int[] blockhash => new light level */
/** @var int[][] blockhash => [x, y, z, new light level] */
protected $updateNodes = [];
/** @var \SplQueue */